Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
31a2c9d4
Unverified
Commit
31a2c9d4
authored
Oct 15, 2020
by
Michael Goderbauer
Committed by
GitHub
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate missed tests (#68241)
parent
4e3f4bb6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
53 deletions
+44
-53
listener_helpers_test.dart
packages/flutter/test/animation/listener_helpers_test.dart
+0
-2
tab_scaffold_test.dart
...es/flutter/test/cupertino/material/tab_scaffold_test.dart
+6
-8
sector_layout_test.dart
packages/flutter/test/examples/sector_layout_test.dart
+0
-2
trivial_test.dart
packages/flutter/test/harness/trivial_test.dart
+0
-2
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+38
-39
No files found.
packages/flutter/test/animation/listener_helpers_test.dart
View file @
31a2c9d4
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
packages/flutter/test/cupertino/material/tab_scaffold_test.dart
View file @
31a2c9d4
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'dart:typed_data'
;
import
'package:flutter/cupertino.dart'
;
...
...
@@ -12,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'../../image_data.dart'
;
List
<
int
>
selectedTabs
;
late
List
<
int
>
selectedTabs
;
void
main
(
)
{
setUp
(()
{
...
...
@@ -170,12 +168,12 @@ void main() {
matching:
find
.
byType
(
RichText
),
));
// Tab 2 should still be selected after changing theme.
expect
(
tab1
.
text
.
style
.
color
.
value
,
0xFF757575
);
expect
(
tab1
.
text
.
style
!.
color
!
.
value
,
0xFF757575
);
final
RichText
tab2
=
tester
.
widget
(
find
.
descendant
(
of:
find
.
text
(
'Tab 2'
),
matching:
find
.
byType
(
RichText
),
));
expect
(
tab2
.
text
.
style
.
color
.
value
,
CupertinoColors
.
systemRed
.
darkColor
.
value
);
expect
(
tab2
.
text
.
style
!.
color
!
.
value
,
CupertinoColors
.
systemRed
.
darkColor
.
value
);
});
testWidgets
(
'dark mode background color'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -205,7 +203,7 @@ void main() {
)
).
decoration
as
BoxDecoration
;
expect
(
tabDecoration
.
color
.
value
,
backgroundColor
.
color
.
value
);
expect
(
tabDecoration
.
color
!
.
value
,
backgroundColor
.
color
.
value
);
// Dark mode
await
tester
.
pumpWidget
(
...
...
@@ -228,7 +226,7 @@ void main() {
)
).
decoration
as
BoxDecoration
;
expect
(
tabDecoration
.
color
.
value
,
backgroundColor
.
darkColor
.
value
);
expect
(
tabDecoration
.
color
!
.
value
,
backgroundColor
.
darkColor
.
value
);
});
testWidgets
(
'Does not lose state when focusing on text input'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -284,7 +282,7 @@ void main() {
MaterialApp
(
home:
Builder
(
builder:
(
BuildContext
context
)
{
return
MediaQuery
(
data:
MediaQuery
.
of
(
context
).
copyWith
(
textScaleFactor:
99
),
data:
MediaQuery
.
of
(
context
)
!
.
copyWith
(
textScaleFactor:
99
),
child:
CupertinoTabScaffold
(
tabBar:
CupertinoTabBar
(
items:
List
<
BottomNavigationBarItem
>.
generate
(
...
...
packages/flutter/test/examples/sector_layout_test.dart
View file @
31a2c9d4
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'package:flutter_test/flutter_test.dart'
;
import
'../../../../examples/layers/rendering/custom_coordinate_systems.dart'
;
...
...
packages/flutter/test/harness/trivial_test.dart
View file @
31a2c9d4
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../flutter_test_alternative.dart'
;
void
main
(
)
{
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
31a2c9d4
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
@@ -37,10 +35,10 @@ void main() {
expect
(
material
.
color
,
const
Color
(
0x00000000
));
expect
(
material
.
elevation
,
0.0
);
expect
(
material
.
shadowColor
,
null
);
expect
(
material
.
textStyle
.
color
,
const
Color
(
0xdd000000
));
expect
(
material
.
textStyle
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
.
fontSize
,
14
);
expect
(
material
.
textStyle
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
textStyle
!
.
color
,
const
Color
(
0xdd000000
));
expect
(
material
.
textStyle
!
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
!
.
fontSize
,
14
);
expect
(
material
.
textStyle
!
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
type
,
MaterialType
.
button
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
OutlineButton
));
...
...
@@ -56,10 +54,10 @@ void main() {
expect
(
material
.
color
,
const
Color
(
0x00000000
));
expect
(
material
.
elevation
,
0.0
);
expect
(
material
.
shadowColor
,
null
);
expect
(
material
.
textStyle
.
color
,
const
Color
(
0xdd000000
));
expect
(
material
.
textStyle
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
.
fontSize
,
14
);
expect
(
material
.
textStyle
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
textStyle
!
.
color
,
const
Color
(
0xdd000000
));
expect
(
material
.
textStyle
!
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
!
.
fontSize
,
14
);
expect
(
material
.
textStyle
!
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
type
,
MaterialType
.
button
);
// Disabled OutlineButton
...
...
@@ -80,10 +78,10 @@ void main() {
expect
(
material
.
color
,
const
Color
(
0x00000000
));
expect
(
material
.
elevation
,
0.0
);
expect
(
material
.
shadowColor
,
null
);
expect
(
material
.
textStyle
.
color
,
const
Color
(
0x61000000
));
expect
(
material
.
textStyle
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
.
fontSize
,
14
);
expect
(
material
.
textStyle
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
textStyle
!
.
color
,
const
Color
(
0x61000000
));
expect
(
material
.
textStyle
!
.
fontFamily
,
'Roboto'
);
expect
(
material
.
textStyle
!
.
fontSize
,
14
);
expect
(
material
.
textStyle
!
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
type
,
MaterialType
.
button
);
});
...
...
@@ -132,7 +130,7 @@ void main() {
addTearDown
(
gesture
.
removePointer
);
await
tester
.
pump
();
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
text
);
expect
(
RendererBinding
.
instance
!
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
text
);
await
tester
.
pumpWidget
(
Directionality
(
...
...
@@ -147,7 +145,7 @@ void main() {
),
);
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
text
);
expect
(
RendererBinding
.
instance
!
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
text
);
// Test default cursor
await
tester
.
pumpWidget
(
...
...
@@ -162,7 +160,7 @@ void main() {
),
);
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
click
);
expect
(
RendererBinding
.
instance
!
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
click
);
// Test default cursor when disabled
await
tester
.
pumpWidget
(
...
...
@@ -177,7 +175,7 @@ void main() {
),
);
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
basic
);
expect
(
RendererBinding
.
instance
!
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
basic
);
});
testWidgets
(
'Does OutlineButton work with focus'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -311,9 +309,9 @@ void main() {
MaterialState
.
focused
,
};
if
(
states
.
any
(
interactiveStates
.
contains
))
{
return
Colors
.
blue
[
900
];
return
Colors
.
blue
[
900
]
!
;
}
return
Colors
.
blue
[
800
];
return
Colors
.
blue
[
800
]
!
;
}
await
tester
.
pumpWidget
(
...
...
@@ -400,8 +398,8 @@ void main() {
),
);
Color
textColor
()
{
return
tester
.
renderObject
<
RenderParagraph
>(
find
.
text
(
'OutlineButton'
)).
text
.
style
.
color
;
Color
?
textColor
()
{
return
tester
.
renderObject
<
RenderParagraph
>(
find
.
text
(
'OutlineButton'
)).
text
.
style
!
.
color
;
}
// Default, not disabled.
...
...
@@ -469,7 +467,7 @@ void main() {
),
);
Color
iconColor
()
=>
_iconStyle
(
tester
,
Icons
.
add
).
color
;
Color
?
iconColor
()
=>
_iconStyle
(
tester
,
Icons
.
add
).
color
;
// Default, not disabled.
expect
(
iconColor
(),
equals
(
defaultColor
));
...
...
@@ -526,8 +524,8 @@ void main() {
),
);
Color
textColor
()
{
return
tester
.
renderObject
<
RenderParagraph
>(
find
.
text
(
'OutlineButton'
)).
text
.
style
.
color
;
Color
?
textColor
()
{
return
tester
.
renderObject
<
RenderParagraph
>(
find
.
text
(
'OutlineButton'
)).
text
.
style
!
.
color
;
}
// Disabled.
...
...
@@ -672,7 +670,7 @@ void main() {
bool
wasPressed
;
Finder
outlineButton
;
Widget
buildFrame
({
VoidCallback
onPressed
,
VoidCallback
onLongPress
})
{
Widget
buildFrame
({
VoidCallback
?
onPressed
,
VoidCallback
?
onLongPress
})
{
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
OutlineButton
(
...
...
@@ -712,7 +710,7 @@ void main() {
});
testWidgets
(
"Outline button doesn't crash if disabled during a gesture"
,
(
WidgetTester
tester
)
async
{
Widget
buildFrame
(
VoidCallback
onPressed
)
{
Widget
buildFrame
(
VoidCallback
?
onPressed
)
{
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Theme
(
...
...
@@ -738,7 +736,7 @@ void main() {
const
Color
disabledBorderColor
=
Color
(
0xFFFF00FF
);
const
double
borderWidth
=
4.0
;
Widget
buildFrame
({
VoidCallback
onPressed
})
{
Widget
buildFrame
({
VoidCallback
?
onPressed
})
{
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Theme
(
...
...
@@ -1005,7 +1003,7 @@ void main() {
// Default value for dark Theme.of(context).canvasColor as well as
// the OutlineButton fill color when the button has been pressed.
Color
fillColor
=
Colors
.
grey
[
850
];
Color
fillColor
=
Colors
.
grey
[
850
]
!
;
// Initially the interior of the button is transparent.
_checkPhysicalLayer
(
buttonElement
,
fillColor
.
withAlpha
(
0x00
));
...
...
@@ -1026,7 +1024,7 @@ void main() {
// Default value for light Theme.of(context).canvasColor as well as
// the OutlineButton fill color when the button has been pressed.
fillColor
=
Colors
.
grey
[
50
];
fillColor
=
Colors
.
grey
[
50
]
!
;
// Initially the interior of the button is transparent.
// expect(button, paints..path(color: fillColor.withAlpha(0x00)));
...
...
@@ -1228,24 +1226,25 @@ void main() {
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
expect
(
element
,
isNotNull
);
RenderObject
object
=
element
.
renderObject
;
RenderObject
?
object
=
element
.
renderObject
;
while
(
object
!=
null
&&
object
is
!
RenderRepaintBoundary
&&
object
is
!
RenderView
)
{
object
=
object
.
parent
as
RenderObject
;
object
=
object
.
parent
as
RenderObject
?
;
}
expect
(
object
.
debugLayer
,
isNotNull
);
expect
(
object
.
debugLayer
.
firstChild
,
isA
<
PhysicalModelLayer
>());
final
PhysicalModelLayer
layer
=
object
.
debugLayer
.
firstChild
as
PhysicalModelLayer
;
final
Layer
child
=
layer
.
firstChild
;
assert
(
object
!=
null
);
expect
(
object
!.
debugLayer
,
isNotNull
);
expect
(
object
.
debugLayer
!.
firstChild
,
isA
<
PhysicalModelLayer
>());
final
PhysicalModelLayer
layer
=
object
.
debugLayer
!.
firstChild
!
as
PhysicalModelLayer
;
final
Layer
child
=
layer
.
firstChild
!;
return
child
is
PhysicalModelLayer
?
child
:
layer
;
}
void
_checkPhysicalLayer
(
Element
element
,
Color
expectedColor
,
{
Path
clipPath
,
Rect
clipRect
})
{
void
_checkPhysicalLayer
(
Element
element
,
Color
expectedColor
,
{
Path
?
clipPath
,
Rect
?
clipRect
})
{
final
PhysicalModelLayer
expectedLayer
=
_findPhysicalLayer
(
element
);
expect
(
expectedLayer
.
elevation
,
0.0
);
expect
(
expectedLayer
.
color
,
expectedColor
);
if
(
clipPath
!=
null
)
{
expect
(
clipRect
,
isNotNull
);
expect
(
expectedLayer
.
clipPath
,
coversSameAreaAs
(
clipPath
,
areaToCompare:
clipRect
.
inflate
(
10.0
)));
expect
(
expectedLayer
.
clipPath
,
coversSameAreaAs
(
clipPath
,
areaToCompare:
clipRect
!
.
inflate
(
10.0
)));
}
}
...
...
@@ -1253,5 +1252,5 @@ TextStyle _iconStyle(WidgetTester tester, IconData icon) {
final
RichText
iconRichText
=
tester
.
widget
<
RichText
>(
find
.
descendant
(
of:
find
.
byIcon
(
icon
),
matching:
find
.
byType
(
RichText
)),
);
return
iconRichText
.
text
.
style
;
return
iconRichText
.
text
.
style
!
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment