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
5d5175b0
Unverified
Commit
5d5175b0
authored
Apr 22, 2020
by
Kate Lovett
Committed by
GitHub
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip Audit - Material Library (#54322)
parent
418007d1
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
116 additions
and
92 deletions
+116
-92
about_test.dart
packages/flutter/test/material/about_test.dart
+6
-6
bottom_app_bar_test.dart
packages/flutter/test/material/bottom_app_bar_test.dart
+2
-1
button_theme_test.dart
packages/flutter/test/material/button_theme_test.dart
+1
-1
chip_test.dart
packages/flutter/test/material/chip_test.dart
+13
-13
chip_theme_test.dart
packages/flutter/test/material/chip_theme_test.dart
+1
-1
circle_avatar_test.dart
packages/flutter/test/material/circle_avatar_test.dart
+1
-1
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+3
-3
flat_button_test.dart
packages/flutter/test/material/flat_button_test.dart
+3
-3
flexible_space_bar_test.dart
packages/flutter/test/material/flexible_space_bar_test.dart
+2
-2
floating_action_button_location_test.dart
...r/test/material/floating_action_button_location_test.dart
+9
-9
ink_paint_test.dart
packages/flutter/test/material/ink_paint_test.dart
+1
-1
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+1
-1
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+2
-2
material_button_test.dart
packages/flutter/test/material/material_button_test.dart
+2
-2
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+4
-4
paginated_data_table_test.dart
...ages/flutter/test/material/paginated_data_table_test.dart
+1
-1
raised_button_test.dart
packages/flutter/test/material/raised_button_test.dart
+1
-1
slider_test.dart
packages/flutter/test/material/slider_test.dart
+2
-2
slider_theme_test.dart
packages/flutter/test/material/slider_theme_test.dart
+2
-2
snack_bar_test.dart
packages/flutter/test/material/snack_bar_test.dart
+4
-8
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+7
-7
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+13
-4
text_form_field_test.dart
packages/flutter/test/material/text_form_field_test.dart
+1
-1
text_selection_test.dart
packages/flutter/test/material/text_selection_test.dart
+24
-6
tooltip_test.dart
packages/flutter/test/material/tooltip_test.dart
+6
-6
tooltip_theme_test.dart
packages/flutter/test/material/tooltip_theme_test.dart
+4
-4
No files found.
packages/flutter/test/material/about_test.dart
View file @
5d5175b0
...
@@ -91,7 +91,7 @@ void main() {
...
@@ -91,7 +91,7 @@ void main() {
findsOneWidget
,
findsOneWidget
,
);
);
expect
(
find
.
text
(
'Pirate license'
),
findsOneWidget
);
expect
(
find
.
text
(
'Pirate license'
),
findsOneWidget
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/54385
testWidgets
(
'About box logic defaults to executable name for app name'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'About box logic defaults to executable name for app name'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -138,7 +138,7 @@ void main() {
...
@@ -138,7 +138,7 @@ void main() {
expect
(
find
.
text
(
'BBB'
),
findsOneWidget
);
expect
(
find
.
text
(
'BBB'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another package'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another package'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another license'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another license'
),
findsOneWidget
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/54385
testWidgets
(
'LicensePage control test with all properties'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage control test with all properties'
,
(
WidgetTester
tester
)
async
{
const
FlutterLogo
logo
=
FlutterLogo
();
const
FlutterLogo
logo
=
FlutterLogo
();
...
@@ -199,7 +199,7 @@ void main() {
...
@@ -199,7 +199,7 @@ void main() {
expect
(
find
.
text
(
'BBB'
),
findsOneWidget
);
expect
(
find
.
text
(
'BBB'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another package'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another package'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another license'
),
findsOneWidget
);
expect
(
find
.
text
(
'Another license'
),
findsOneWidget
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/54385
testWidgets
(
'LicensePage respects the notch'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage respects the notch'
,
(
WidgetTester
tester
)
async
{
const
double
safeareaPadding
=
27.0
;
const
double
safeareaPadding
=
27.0
;
...
@@ -224,7 +224,7 @@ void main() {
...
@@ -224,7 +224,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getTopLeft
(
find
.
text
(
'DEF'
)),
const
Offset
(
8.0
+
safeareaPadding
,
287.0
));
expect
(
tester
.
getTopLeft
(
find
.
text
(
'DEF'
)),
const
Offset
(
8.0
+
safeareaPadding
,
287.0
));
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/54385
testWidgets
(
'LicensePage returns early if unmounted'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage returns early if unmounted'
,
(
WidgetTester
tester
)
async
{
final
Completer
<
LicenseEntry
>
licenseCompleter
=
Completer
<
LicenseEntry
>();
final
Completer
<
LicenseEntry
>
licenseCompleter
=
Completer
<
LicenseEntry
>();
...
@@ -249,7 +249,7 @@ void main() {
...
@@ -249,7 +249,7 @@ void main() {
final
FakeLicenseEntry
licenseEntry
=
FakeLicenseEntry
();
final
FakeLicenseEntry
licenseEntry
=
FakeLicenseEntry
();
licenseCompleter
.
complete
(
licenseEntry
);
licenseCompleter
.
complete
(
licenseEntry
);
expect
(
licenseEntry
.
paragraphsCalled
,
false
);
expect
(
licenseEntry
.
paragraphsCalled
,
false
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'LicensePage returns late if unmounted'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage returns late if unmounted'
,
(
WidgetTester
tester
)
async
{
final
Completer
<
LicenseEntry
>
licenseCompleter
=
Completer
<
LicenseEntry
>();
final
Completer
<
LicenseEntry
>
licenseCompleter
=
Completer
<
LicenseEntry
>();
...
@@ -274,7 +274,7 @@ void main() {
...
@@ -274,7 +274,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
expect
(
licenseEntry
.
paragraphsCalled
,
true
);
expect
(
licenseEntry
.
paragraphsCalled
,
true
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'LicensePage logic defaults to executable name for app name'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage logic defaults to executable name for app name'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/material/bottom_app_bar_test.dart
View file @
5d5175b0
...
@@ -79,7 +79,8 @@ void main() {
...
@@ -79,7 +79,8 @@ void main() {
find
.
byKey
(
key
),
find
.
byKey
(
key
),
matchesGoldenFile
(
'bottom_app_bar.custom_shape.2.png'
),
matchesGoldenFile
(
'bottom_app_bar.custom_shape.2.png'
),
);
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/51675,
// https://github.com/flutter/flutter/issues/44572
testWidgets
(
'color defaults to Theme.bottomAppBarColor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'color defaults to Theme.bottomAppBarColor'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/material/button_theme_test.dart
View file @
5d5175b0
...
@@ -170,7 +170,7 @@ void main() {
...
@@ -170,7 +170,7 @@ void main() {
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
shape
,
shape
);
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
shape
,
shape
);
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
color
,
disabledColor
);
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
color
,
disabledColor
);
expect
(
tester
.
getSize
(
find
.
byType
(
Material
)),
const
Size
(
88.0
,
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Material
)),
const
Size
(
88.0
,
48.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Theme buttonTheme ButtonTheme overrides'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Theme buttonTheme ButtonTheme overrides'
,
(
WidgetTester
tester
)
async
{
ButtonTextTheme
textTheme
;
ButtonTextTheme
textTheme
;
...
...
packages/flutter/test/material/chip_test.dart
View file @
5d5175b0
...
@@ -497,7 +497,7 @@ void main() {
...
@@ -497,7 +497,7 @@ void main() {
);
);
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)),
const
Size
(
40.0
,
10.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)),
const
Size
(
40.0
,
10.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
)),
const
Size
(
800.0
,
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
)),
const
Size
(
800.0
,
48.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Chip elements are ordered horizontally for locale'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip elements are ordered horizontally for locale'
,
(
WidgetTester
tester
)
async
{
final
UniqueKey
iconKey
=
UniqueKey
();
final
UniqueKey
iconKey
=
UniqueKey
();
...
@@ -618,7 +618,7 @@ void main() {
...
@@ -618,7 +618,7 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
first
).
width
,
anyOf
(
318.0
,
319.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
first
).
width
,
anyOf
(
318.0
,
319.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
first
).
height
,
equals
(
50.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
first
).
height
,
equals
(
50.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
last
),
anyOf
(
const
Size
(
132.0
,
48.0
),
const
Size
(
131.0
,
48.0
)));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
last
),
anyOf
(
const
Size
(
132.0
,
48.0
),
const
Size
(
131.0
,
48.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Labels can be non-text widgets'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Labels can be non-text widgets'
,
(
WidgetTester
tester
)
async
{
final
Key
keyA
=
GlobalKey
();
final
Key
keyA
=
GlobalKey
();
...
@@ -652,7 +652,7 @@ void main() {
...
@@ -652,7 +652,7 @@ void main() {
anyOf
(
const
Size
(
132.0
,
48.0
),
const
Size
(
131.0
,
48.0
)),
anyOf
(
const
Size
(
132.0
,
48.0
),
const
Size
(
131.0
,
48.0
)),
);
);
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
last
),
const
Size
(
58.0
,
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
last
),
const
Size
(
58.0
,
48.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Avatars can be non-circle avatar widgets'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Avatars can be non-circle avatar widgets'
,
(
WidgetTester
tester
)
async
{
final
Key
keyA
=
GlobalKey
();
final
Key
keyA
=
GlobalKey
();
...
@@ -876,7 +876,7 @@ void main() {
...
@@ -876,7 +876,7 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
RawChip
)),
equals
(
const
Size
(
80.0
,
48.0
)));
expect
(
tester
.
getSize
(
find
.
byType
(
RawChip
)),
equals
(
const
Size
(
80.0
,
48.0
)));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
labelKey
)),
equals
(
const
Offset
(
12.0
,
17.0
)));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
labelKey
)),
equals
(
const
Offset
(
12.0
,
17.0
)));
expect
(
find
.
byKey
(
avatarKey
),
findsNothing
);
expect
(
find
.
byKey
(
avatarKey
),
findsNothing
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'Delete button drawer works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Delete button drawer works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
final
UniqueKey
labelKey
=
UniqueKey
();
final
UniqueKey
labelKey
=
UniqueKey
();
...
@@ -992,7 +992,7 @@ void main() {
...
@@ -992,7 +992,7 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
RawChip
)),
equals
(
const
Size
(
80.0
,
48.0
)));
expect
(
tester
.
getSize
(
find
.
byType
(
RawChip
)),
equals
(
const
Size
(
80.0
,
48.0
)));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
labelKey
)),
equals
(
const
Offset
(
12.0
,
17.0
)));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
labelKey
)),
equals
(
const
Offset
(
12.0
,
17.0
)));
expect
(
find
.
byKey
(
deleteButtonKey
),
findsNothing
);
expect
(
find
.
byKey
(
deleteButtonKey
),
findsNothing
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'Chip creates centered, unique ripple when label is tapped'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip creates centered, unique ripple when label is tapped'
,
(
WidgetTester
tester
)
async
{
// Creates a chip with a delete button.
// Creates a chip with a delete button.
...
@@ -1046,7 +1046,7 @@ void main() {
...
@@ -1046,7 +1046,7 @@ void main() {
expect
(
findTooltipContainer
(
'Delete'
),
findsNothing
);
expect
(
findTooltipContainer
(
'Delete'
),
findsNothing
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Delete button creates non-centered, unique ripple when tapped'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Delete button creates non-centered, unique ripple when tapped'
,
(
WidgetTester
tester
)
async
{
// Creates a chip with a delete button.
// Creates a chip with a delete button.
...
@@ -1104,7 +1104,7 @@ void main() {
...
@@ -1104,7 +1104,7 @@ void main() {
expect
(
findTooltipContainer
(
'Delete'
),
findsOneWidget
);
expect
(
findTooltipContainer
(
'Delete'
),
findsOneWidget
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'RTL delete button responds to tap on the left of the chip'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'RTL delete button responds to tap on the left of the chip'
,
(
WidgetTester
tester
)
async
{
// Creates an RTL chip with a delete button.
// Creates an RTL chip with a delete button.
...
@@ -1134,7 +1134,7 @@ void main() {
...
@@ -1134,7 +1134,7 @@ void main() {
expect
(
findTooltipContainer
(
'Delete'
),
findsOneWidget
);
expect
(
findTooltipContainer
(
'Delete'
),
findsOneWidget
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Chip without delete button creates correct ripple'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip without delete button creates correct ripple'
,
(
WidgetTester
tester
)
async
{
// Creates a chip with a delete button.
// Creates a chip with a delete button.
...
@@ -1188,7 +1188,7 @@ void main() {
...
@@ -1188,7 +1188,7 @@ void main() {
expect
(
findTooltipContainer
(
'Delete'
),
findsNothing
);
expect
(
findTooltipContainer
(
'Delete'
),
findsNothing
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Selection with avatar works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Selection with avatar works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
bool
selected
=
false
;
bool
selected
=
false
;
...
@@ -1271,7 +1271,7 @@ void main() {
...
@@ -1271,7 +1271,7 @@ void main() {
expect
(
getSelectProgress
(
tester
),
equals
(
0.0
));
expect
(
getSelectProgress
(
tester
),
equals
(
0.0
));
expect
(
getAvatarDrawerProgress
(
tester
),
equals
(
1.0
));
expect
(
getAvatarDrawerProgress
(
tester
),
equals
(
1.0
));
expect
(
getDeleteDrawerProgress
(
tester
),
equals
(
0.0
));
expect
(
getDeleteDrawerProgress
(
tester
),
equals
(
0.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Selection without avatar works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Selection without avatar works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
bool
selected
=
false
;
bool
selected
=
false
;
...
@@ -1347,7 +1347,7 @@ void main() {
...
@@ -1347,7 +1347,7 @@ void main() {
expect
(
getSelectProgress
(
tester
),
equals
(
0.0
));
expect
(
getSelectProgress
(
tester
),
equals
(
0.0
));
expect
(
getAvatarDrawerProgress
(
tester
),
equals
(
0.0
));
expect
(
getAvatarDrawerProgress
(
tester
),
equals
(
0.0
));
expect
(
getDeleteDrawerProgress
(
tester
),
equals
(
0.0
));
expect
(
getDeleteDrawerProgress
(
tester
),
equals
(
0.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Activation works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Activation works as expected on RawChip'
,
(
WidgetTester
tester
)
async
{
bool
selected
=
false
;
bool
selected
=
false
;
...
@@ -1472,7 +1472,7 @@ void main() {
...
@@ -1472,7 +1472,7 @@ void main() {
);
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key2
)),
const
Size
(
80.0
,
32.0
));
expect
(
tester
.
getSize
(
find
.
byKey
(
key2
)),
const
Size
(
80.0
,
32.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Chip uses the right theme colors for the right components'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip uses the right theme colors for the right components'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
themeData
=
ThemeData
(
final
ThemeData
themeData
=
ThemeData
(
...
@@ -2105,7 +2105,7 @@ void main() {
...
@@ -2105,7 +2105,7 @@ void main() {
],
excludes:
<
Offset
>[
],
excludes:
<
Offset
>[
const
Offset
(
4
,
4
),
const
Offset
(
4
,
4
),
]));
]));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Chips should use InkWell instead of InkResponse.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chips should use InkWell instead of InkResponse.'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/28646
// Regression test for https://github.com/flutter/flutter/issues/28646
...
...
packages/flutter/test/material/chip_theme_test.dart
View file @
5d5175b0
...
@@ -164,7 +164,7 @@ void main() {
...
@@ -164,7 +164,7 @@ void main() {
expect
(
materialBox
,
paints
..
path
(
color:
Color
(
customTheme
.
backgroundColor
.
value
)));
expect
(
materialBox
,
paints
..
path
(
color:
Color
(
customTheme
.
backgroundColor
.
value
)));
expect
(
material
.
elevation
,
customTheme
.
elevation
);
expect
(
material
.
elevation
,
customTheme
.
elevation
);
expect
(
material
.
shadowColor
,
customTheme
.
shadowColor
);
expect
(
material
.
shadowColor
,
customTheme
.
shadowColor
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'ChipThemeData generates correct opacities for defaults'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ChipThemeData generates correct opacities for defaults'
,
(
WidgetTester
tester
)
async
{
const
Color
customColor1
=
Color
(
0xcafefeed
);
const
Color
customColor1
=
Color
(
0xcafefeed
);
...
...
packages/flutter/test/material/circle_avatar_test.dart
View file @
5d5175b0
...
@@ -186,7 +186,7 @@ void main() {
...
@@ -186,7 +186,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getSize
(
find
.
text
(
'Z'
)),
equals
(
const
Size
(
16.0
,
16.0
)));
expect
(
tester
.
getSize
(
find
.
text
(
'Z'
)),
equals
(
const
Size
(
16.0
,
16.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'CircleAvatar respects minRadius'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'CircleAvatar respects minRadius'
,
(
WidgetTester
tester
)
async
{
final
Color
backgroundColor
=
Colors
.
blue
.
shade900
;
final
Color
backgroundColor
=
Colors
.
blue
.
shade900
;
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
5d5175b0
...
@@ -2336,7 +2336,7 @@ void main() {
...
@@ -2336,7 +2336,7 @@ void main() {
final
Element
element
=
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
String
>(
'two'
)).
last
);
final
Element
element
=
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
String
>(
'two'
)).
last
);
final
FocusNode
node
=
Focus
.
of
(
element
);
final
FocusNode
node
=
Focus
.
of
(
element
);
expect
(
node
.
hasFocus
,
isTrue
);
expect
(
node
.
hasFocus
,
isTrue
);
},
skip:
kIsWeb
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/55320
testWidgets
(
'Selected element is correctly focused with dropdown that more items than fit on the screen'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Selected element is correctly focused with dropdown that more items than fit on the screen'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
(
debugLabel:
'DropdownButton'
);
final
FocusNode
focusNode
=
FocusNode
(
debugLabel:
'DropdownButton'
);
...
@@ -2399,7 +2399,7 @@ void main() {
...
@@ -2399,7 +2399,7 @@ void main() {
final
Element
element
=
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
int
>(
42
)).
last
);
final
Element
element
=
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
int
>(
42
)).
last
);
final
FocusNode
node
=
Focus
.
of
(
element
);
final
FocusNode
node
=
Focus
.
of
(
element
);
expect
(
node
.
hasFocus
,
isTrue
);
expect
(
node
.
hasFocus
,
isTrue
);
},
skip:
kIsWeb
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/55320
testWidgets
(
"Having a focused element doesn't interrupt scroll when flung by touch"
,
(
WidgetTester
tester
)
async
{
testWidgets
(
"Having a focused element doesn't interrupt scroll when flung by touch"
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
(
debugLabel:
'DropdownButton'
);
final
FocusNode
focusNode
=
FocusNode
(
debugLabel:
'DropdownButton'
);
...
@@ -2473,7 +2473,7 @@ void main() {
...
@@ -2473,7 +2473,7 @@ void main() {
// Scrolling to the top again has removed the one the focus was on from the
// Scrolling to the top again has removed the one the focus was on from the
// tree, causing it to lose focus.
// tree, causing it to lose focus.
expect
(
Focus
.
of
(
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
int
>(
91
)).
last
)).
hasPrimaryFocus
,
isFalse
);
expect
(
Focus
.
of
(
tester
.
element
(
find
.
byKey
(
const
ValueKey
<
int
>(
91
)).
last
)).
hasPrimaryFocus
,
isFalse
);
},
skip:
kIsWeb
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/55320
testWidgets
(
'DropdownButton onTap callback is called when defined'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'DropdownButton onTap callback is called when defined'
,
(
WidgetTester
tester
)
async
{
int
dropdownButtonTapCounter
=
0
;
int
dropdownButtonTapCounter
=
0
;
...
...
packages/flutter/test/material/flat_button_test.dart
View file @
5d5175b0
...
@@ -153,8 +153,8 @@ void main() {
...
@@ -153,8 +153,8 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
skip:
isBrowser
,
);
);
testWidgets
(
'FlatButton with colored theme meets a11y contrast guidelines'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'FlatButton with colored theme meets a11y contrast guidelines'
,
(
WidgetTester
tester
)
async
{
...
@@ -218,8 +218,8 @@ void main() {
...
@@ -218,8 +218,8 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
skip:
isBrowser
,
);
);
testWidgets
(
'FlatButton uses stateful color for text color in different states'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'FlatButton uses stateful color for text color in different states'
,
(
WidgetTester
tester
)
async
{
...
@@ -571,7 +571,7 @@ void main() {
...
@@ -571,7 +571,7 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)).
height
,
equals
(
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)).
height
,
equals
(
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
width
,
isIn
(<
double
>[
126.0
,
127.0
]));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
width
,
isIn
(<
double
>[
126.0
,
127.0
]));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
height
,
equals
(
42.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
height
,
equals
(
42.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'FlatButton size is configurable by ThemeData.materialTapTargetSize'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'FlatButton size is configurable by ThemeData.materialTapTargetSize'
,
(
WidgetTester
tester
)
async
{
final
Key
key1
=
UniqueKey
();
final
Key
key1
=
UniqueKey
();
...
...
packages/flutter/test/material/flexible_space_bar_test.dart
View file @
5d5175b0
...
@@ -216,7 +216,7 @@ void main() {
...
@@ -216,7 +216,7 @@ void main() {
await
tester
.
pumpWidget
(
buildFrame
(
TargetPlatform
.
macOS
,
false
));
await
tester
.
pumpWidget
(
buildFrame
(
TargetPlatform
.
macOS
,
false
));
expect
(
getTitleBottomLeft
(),
const
Offset
(
72.0
,
16.0
));
expect
(
getTitleBottomLeft
(),
const
Offset
(
72.0
,
16.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'FlexibleSpaceBar test titlePadding override'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'FlexibleSpaceBar test titlePadding override'
,
(
WidgetTester
tester
)
async
{
Widget
buildFrame
(
TargetPlatform
platform
,
bool
centerTitle
)
{
Widget
buildFrame
(
TargetPlatform
platform
,
bool
centerTitle
)
{
...
@@ -284,7 +284,7 @@ void main() {
...
@@ -284,7 +284,7 @@ void main() {
await
tester
.
pumpWidget
(
buildFrame
(
TargetPlatform
.
linux
,
true
));
await
tester
.
pumpWidget
(
buildFrame
(
TargetPlatform
.
linux
,
true
));
expect
(
getTitleBottomLeft
(),
const
Offset
(
390.0
,
0.0
));
expect
(
getTitleBottomLeft
(),
const
Offset
(
390.0
,
0.0
));
}
,
skip:
isBrowser
);
});
}
}
class
TestDelegate
extends
SliverPersistentHeaderDelegate
{
class
TestDelegate
extends
SliverPersistentHeaderDelegate
{
...
...
packages/flutter/test/material/floating_action_button_location_test.dart
View file @
5d5175b0
...
@@ -213,7 +213,7 @@ void main() {
...
@@ -213,7 +213,7 @@ void main() {
),
),
);
);
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'interrupting entrance of a new fab.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'interrupting entrance of a new fab.'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -238,7 +238,7 @@ void main() {
...
@@ -238,7 +238,7 @@ void main() {
);
);
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
});
});
}
,
skip:
isBrowser
);
});
});
});
testWidgets
(
'Docked floating action button locations'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Docked floating action button locations'
,
(
WidgetTester
tester
)
async
{
...
@@ -274,7 +274,7 @@ void main() {
...
@@ -274,7 +274,7 @@ void main() {
);
);
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)),
const
Offset
(
756.0
,
500.0
));
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)),
const
Offset
(
756.0
,
500.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Docked floating action button locations: no BAB, small BAB'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Docked floating action button locations: no BAB, small BAB'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -293,7 +293,7 @@ void main() {
...
@@ -293,7 +293,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)),
const
Offset
(
756.0
,
572.0
));
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)),
const
Offset
(
756.0
,
572.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Mini-start-top floating action button location'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Mini-start-top floating action button location'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -314,7 +314,7 @@ void main() {
...
@@ -314,7 +314,7 @@ void main() {
);
);
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)).
dx
,
tester
.
getCenter
(
find
.
byType
(
CircleAvatar
)).
dx
);
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)).
dx
,
tester
.
getCenter
(
find
.
byType
(
CircleAvatar
)).
dx
);
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)).
dy
,
kToolbarHeight
);
expect
(
tester
.
getCenter
(
find
.
byType
(
FloatingActionButton
)).
dy
,
kToolbarHeight
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'Start-top floating action button location LTR'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Start-top floating action button location LTR'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -327,7 +327,7 @@ void main() {
...
@@ -327,7 +327,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
16.0
,
28.0
,
56.0
,
56.0
)));
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
16.0
,
28.0
,
56.0
,
56.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'End-top floating action button location RTL'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'End-top floating action button location RTL'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -343,7 +343,7 @@ void main() {
...
@@ -343,7 +343,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
16.0
,
28.0
,
56.0
,
56.0
)));
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
16.0
,
28.0
,
56.0
,
56.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Start-top floating action button location RTL'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Start-top floating action button location RTL'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -359,7 +359,7 @@ void main() {
...
@@ -359,7 +359,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
800.0
-
56.0
-
16.0
,
28.0
,
56.0
,
56.0
)));
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
800.0
-
56.0
-
16.0
,
28.0
,
56.0
,
56.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'End-top floating action button location LTR'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'End-top floating action button location LTR'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -372,7 +372,7 @@ void main() {
...
@@ -372,7 +372,7 @@ void main() {
),
),
);
);
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
800.0
-
56.0
-
16.0
,
28.0
,
56.0
,
56.0
)));
expect
(
tester
.
getRect
(
find
.
byType
(
FloatingActionButton
)),
rectMoreOrLessEquals
(
const
Rect
.
fromLTWH
(
800.0
-
56.0
-
16.0
,
28.0
,
56.0
,
56.0
)));
}
,
skip:
isBrowser
);
});
}
}
...
...
packages/flutter/test/material/ink_paint_test.dart
View file @
5d5175b0
...
@@ -250,7 +250,7 @@ void main() {
...
@@ -250,7 +250,7 @@ void main() {
expect
(
box
,
isNot
(
paints
..
circle
()));
expect
(
box
,
isNot
(
paints
..
circle
()));
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'The InkWell widget renders an SelectAction or ActivateAction-induced ink ripple'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'The InkWell widget renders an SelectAction or ActivateAction-induced ink ripple'
,
(
WidgetTester
tester
)
async
{
const
Color
highlightColor
=
Color
(
0xAAFF0000
);
const
Color
highlightColor
=
Color
(
0xAAFF0000
);
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
5d5175b0
...
@@ -3671,7 +3671,7 @@ void main() {
...
@@ -3671,7 +3671,7 @@ void main() {
)
)
..
restore
(),
..
restore
(),
);
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/55317
testWidgets
(
'OutlineInputBorder radius carries over when lerping'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'OutlineInputBorder radius carries over when lerping'
,
(
WidgetTester
tester
)
async
{
// This is a regression test for https://github.com/flutter/flutter/issues/23982
// This is a regression test for https://github.com/flutter/flutter/issues/23982
...
...
packages/flutter/test/material/list_tile_test.dart
View file @
5d5175b0
...
@@ -194,7 +194,7 @@ void main() {
...
@@ -194,7 +194,7 @@ void main() {
testChildren
();
testChildren
();
testHorizontalGeometry
();
testHorizontalGeometry
();
testVerticalGeometry
(
128.0
);
testVerticalGeometry
(
128.0
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'ListTile geometry (RTL)'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ListTile geometry (RTL)'
,
(
WidgetTester
tester
)
async
{
const
double
leftPadding
=
10.0
;
const
double
leftPadding
=
10.0
;
...
@@ -806,7 +806,7 @@ void main() {
...
@@ -806,7 +806,7 @@ void main() {
expect
(
tester
.
getRect
(
find
.
byType
(
ListTile
).
at
(
1
)),
const
Rect
.
fromLTWH
(
0.0
,
216.0
,
800.0
,
56.0
));
expect
(
tester
.
getRect
(
find
.
byType
(
ListTile
).
at
(
1
)),
const
Rect
.
fromLTWH
(
0.0
,
216.0
,
800.0
,
56.0
));
expect
(
tester
.
getRect
(
find
.
byType
(
Placeholder
).
at
(
2
)),
const
Rect
.
fromLTWH
(
16.0
,
216.0
+
16.0
,
24.0
,
12.0
));
expect
(
tester
.
getRect
(
find
.
byType
(
Placeholder
).
at
(
2
)),
const
Rect
.
fromLTWH
(
16.0
,
216.0
+
16.0
,
24.0
,
12.0
));
expect
(
tester
.
getRect
(
find
.
byType
(
Placeholder
).
at
(
3
)),
const
Rect
.
fromLTWH
(
800.0
-
24.0
-
16.0
,
216.0
+
16.0
,
24.0
,
24.0
));
expect
(
tester
.
getRect
(
find
.
byType
(
Placeholder
).
at
(
3
)),
const
Rect
.
fromLTWH
(
800.0
-
24.0
-
16.0
,
216.0
+
16.0
,
24.0
,
24.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'ListTile leading icon height does not exceed ListTile height'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ListTile leading icon height does not exceed ListTile height'
,
(
WidgetTester
tester
)
async
{
// regression test for https://github.com/flutter/flutter/issues/28765
// regression test for https://github.com/flutter/flutter/issues/28765
...
...
packages/flutter/test/material/material_button_test.dart
View file @
5d5175b0
...
@@ -260,8 +260,8 @@ void main() {
...
@@ -260,8 +260,8 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
skip:
isBrowser
,
);
);
testWidgets
(
'MaterialButton gets focus when autofocus is set.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MaterialButton gets focus when autofocus is set.'
,
(
WidgetTester
tester
)
async
{
...
@@ -596,7 +596,7 @@ void main() {
...
@@ -596,7 +596,7 @@ void main() {
semantics
.
dispose
();
semantics
.
dispose
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'MaterialButton minWidth and height parameters'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MaterialButton minWidth and height parameters'
,
(
WidgetTester
tester
)
async
{
Widget
buildFrame
({
double
minWidth
,
double
height
,
EdgeInsets
padding
=
EdgeInsets
.
zero
,
Widget
child
})
{
Widget
buildFrame
({
double
minWidth
,
double
height
,
EdgeInsets
padding
=
EdgeInsets
.
zero
,
Widget
child
})
{
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
5d5175b0
...
@@ -200,8 +200,8 @@ void main() {
...
@@ -200,8 +200,8 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
skip:
isBrowser
,
);
);
testWidgets
(
'OutlineButton with colored theme meets a11y contrast guidelines'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'OutlineButton with colored theme meets a11y contrast guidelines'
,
(
WidgetTester
tester
)
async
{
...
@@ -265,7 +265,7 @@ void main() {
...
@@ -265,7 +265,7 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
);
);
...
@@ -747,7 +747,7 @@ void main() {
...
@@ -747,7 +747,7 @@ void main() {
clipPath:
clipPath
,
clipPath:
clipPath
,
clipRect:
clipRect
,
clipRect:
clipRect
,
);
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'OutlineButton has no clip by default'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'OutlineButton has no clip by default'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
buttonKey
=
GlobalKey
();
final
GlobalKey
buttonKey
=
GlobalKey
();
...
@@ -882,7 +882,7 @@ void main() {
...
@@ -882,7 +882,7 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)).
height
,
equals
(
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)).
height
,
equals
(
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
width
,
isIn
(<
double
>[
126.0
,
127.0
]));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
width
,
isIn
(<
double
>[
126.0
,
127.0
]));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
height
,
equals
(
42.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Text
)).
height
,
equals
(
42.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'OutlineButton pressed fillColor default'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'OutlineButton pressed fillColor default'
,
(
WidgetTester
tester
)
async
{
Widget
buildFrame
(
ThemeData
theme
)
{
Widget
buildFrame
(
ThemeData
theme
)
{
...
...
packages/flutter/test/material/paginated_data_table_test.dart
View file @
5d5175b0
...
@@ -262,7 +262,7 @@ void main() {
...
@@ -262,7 +262,7 @@ void main() {
expect
(
find
.
text
(
'501'
),
findsOneWidget
);
expect
(
find
.
text
(
'501'
),
findsOneWidget
);
// Test that it fits:
// Test that it fits:
expect
(
tester
.
getTopRight
(
find
.
text
(
'501'
)).
dx
,
greaterThanOrEqualTo
(
tester
.
getTopRight
(
find
.
text
(
'Rows per page:'
)).
dx
+
40.0
));
expect
(
tester
.
getTopRight
(
find
.
text
(
'501'
)).
dx
,
greaterThanOrEqualTo
(
tester
.
getTopRight
(
find
.
text
(
'Rows per page:'
)).
dx
+
40.0
));
},
skip:
isBrowser
);
//
TODO(yjbanov):
https://github.com/flutter/flutter/issues/43433
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/43433
testWidgets
(
'PaginatedDataTable footer scrolls'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PaginatedDataTable footer scrolls'
,
(
WidgetTester
tester
)
async
{
final
TestDataSource
source
=
TestDataSource
();
final
TestDataSource
source
=
TestDataSource
();
...
...
packages/flutter/test/material/raised_button_test.dart
View file @
5d5175b0
...
@@ -155,7 +155,7 @@ void main() {
...
@@ -155,7 +155,7 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
tester
.
pump
(
const
Duration
(
milliseconds:
800
));
// Wait for splash and highlight to be well under way.
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
},
},
skip:
isBrowser
,
skip:
isBrowser
,
// https://github.com/flutter/flutter/issues/44115
semanticsEnabled:
true
,
semanticsEnabled:
true
,
);
);
...
...
packages/flutter/test/material/slider_test.dart
View file @
5d5175b0
...
@@ -1340,7 +1340,7 @@ void main() {
...
@@ -1340,7 +1340,7 @@ void main() {
await
gesture
.
up
();
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Slider respects textScaleFactor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Slider respects textScaleFactor'
,
(
WidgetTester
tester
)
async
{
final
Key
sliderKey
=
UniqueKey
();
final
Key
sliderKey
=
UniqueKey
();
...
@@ -1439,7 +1439,7 @@ void main() {
...
@@ -1439,7 +1439,7 @@ void main() {
await
gesture
.
up
();
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tick marks are skipped when they are too dense'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tick marks are skipped when they are too dense'
,
(
WidgetTester
tester
)
async
{
Widget
buildSlider
({
Widget
buildSlider
({
...
...
packages/flutter/test/material/slider_theme_test.dart
View file @
5d5175b0
...
@@ -607,7 +607,7 @@ void main() {
...
@@ -607,7 +607,7 @@ void main() {
)
)
);
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'Default paddle slider value indicator shape draws correctly'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Default paddle slider value indicator shape draws correctly'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
theme
=
ThemeData
(
final
ThemeData
theme
=
ThemeData
(
...
@@ -784,7 +784,7 @@ void main() {
...
@@ -784,7 +784,7 @@ void main() {
),
),
);
);
await
gesture
.
up
();
await
gesture
.
up
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'The slider track height can be overridden'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'The slider track height can be overridden'
,
(
WidgetTester
tester
)
async
{
final
SliderThemeData
sliderTheme
=
ThemeData
().
sliderTheme
.
copyWith
(
trackHeight:
16
);
final
SliderThemeData
sliderTheme
=
ThemeData
().
sliderTheme
.
copyWith
(
trackHeight:
16
);
...
...
packages/flutter/test/material/snack_bar_test.dart
View file @
5d5175b0
...
@@ -468,7 +468,7 @@ void main() {
...
@@ -468,7 +468,7 @@ void main() {
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
24.0
);
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
24.0
);
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
24.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
24.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
17.0
+
40.0
);
// margin + bottom padding
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
17.0
+
40.0
);
// margin + bottom padding
}
,
skip:
isBrowser
);
});
testWidgets
(
testWidgets
(
'Custom padding between SnackBar and its contents when set to SnackBarBehavior.fixed'
,
'Custom padding between SnackBar and its contents when set to SnackBarBehavior.fixed'
,
...
@@ -523,9 +523,7 @@ void main() {
...
@@ -523,9 +523,7 @@ void main() {
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
24.0
);
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
24.0
);
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
24.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
24.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
17.0
);
// margin (with no bottom padding)
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
17.0
);
// margin (with no bottom padding)
},
});
skip:
isBrowser
,
);
testWidgets
(
'SnackBar should push FloatingActionButton above'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'SnackBar should push FloatingActionButton above'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
...
@@ -630,7 +628,7 @@ void main() {
...
@@ -630,7 +628,7 @@ void main() {
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
16.0
);
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
16.0
);
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
31.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
31.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
27.0
);
// margin (with no bottom padding)
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
27.0
);
// margin (with no bottom padding)
}
,
skip:
isBrowser
);
});
testWidgets
(
testWidgets
(
'Custom padding between SnackBar and its contents when set to SnackBarBehavior.floating'
,
'Custom padding between SnackBar and its contents when set to SnackBarBehavior.floating'
,
...
@@ -688,9 +686,7 @@ void main() {
...
@@ -688,9 +686,7 @@ void main() {
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
16.0
);
expect
(
actionTextBottomLeft
.
dx
-
textBottomRight
.
dx
,
16.0
);
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
31.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dx
-
actionTextBottomRight
.
dx
,
31.0
+
30.0
);
// margin + right padding
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
27.0
);
// margin (with no bottom padding)
expect
(
snackBarBottomRight
.
dy
-
actionTextBottomRight
.
dy
,
27.0
);
// margin (with no bottom padding)
},
});
skip:
isBrowser
,
);
testWidgets
(
'SnackBarClosedReason'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'SnackBarClosedReason'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
...
...
packages/flutter/test/material/tabs_test.dart
View file @
5d5175b0
...
@@ -249,7 +249,7 @@ void main() {
...
@@ -249,7 +249,7 @@ void main() {
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
46.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
46.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tab sizing - icon and text'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon and text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -257,7 +257,7 @@ void main() {
...
@@ -257,7 +257,7 @@ void main() {
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tab sizing - icon, iconMargin and text'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon, iconMargin and text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -281,7 +281,7 @@ void main() {
...
@@ -281,7 +281,7 @@ void main() {
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
210.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
210.0
,
72.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tab sizing - icon and child'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon and child'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -289,7 +289,7 @@ void main() {
...
@@ -289,7 +289,7 @@ void main() {
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
.
fontFamily
,
'Ahem'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tab color - normal'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab color - normal'
,
(
WidgetTester
tester
)
async
{
final
Widget
tabBar
=
TabBar
(
tabs:
const
<
Widget
>[
SizedBox
.
shrink
()],
controller:
TabController
(
length:
1
,
vsync:
tester
));
final
Widget
tabBar
=
TabBar
(
tabs:
const
<
Widget
>[
SizedBox
.
shrink
()],
controller:
TabController
(
length:
1
,
vsync:
tester
));
...
@@ -412,7 +412,7 @@ void main() {
...
@@ -412,7 +412,7 @@ void main() {
// Scrolling the TabBar doesn't change the selection
// Scrolling the TabBar doesn't change the selection
expect
(
controller
.
index
,
0
);
expect
(
controller
.
index
,
0
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'TabBarView maintains state'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'TabBarView maintains state'
,
(
WidgetTester
tester
)
async
{
final
List
<
String
>
tabs
=
<
String
>[
'AAAAAA'
,
'BBBBBB'
,
'CCCCCC'
,
'DDDDDD'
,
'EEEEEE'
];
final
List
<
String
>
tabs
=
<
String
>[
'AAAAAA'
,
'BBBBBB'
,
'CCCCCC'
,
'DDDDDD'
,
'EEEEEE'
];
...
@@ -1671,7 +1671,7 @@ void main() {
...
@@ -1671,7 +1671,7 @@ void main() {
expect
(
semantics
,
hasSemantics
(
expectedSemantics
));
expect
(
semantics
,
hasSemantics
(
expectedSemantics
));
semantics
.
dispose
();
semantics
.
dispose
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'correct scrolling semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'correct scrolling semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
@@ -1939,7 +1939,7 @@ void main() {
...
@@ -1939,7 +1939,7 @@ void main() {
expect
(
semantics
,
hasSemantics
(
expectedSemantics
));
expect
(
semantics
,
hasSemantics
(
expectedSemantics
));
semantics
.
dispose
();
semantics
.
dispose
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'can be notified of TabBar onTap behavior'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'can be notified of TabBar onTap behavior'
,
(
WidgetTester
tester
)
async
{
int
tabIndex
=
-
1
;
int
tabIndex
=
-
1
;
...
...
packages/flutter/test/material/text_field_test.dart
View file @
5d5175b0
...
@@ -447,7 +447,7 @@ void main() {
...
@@ -447,7 +447,7 @@ void main() {
find
.
byType
(
Overlay
),
find
.
byType
(
Overlay
),
matchesGoldenFile
(
'text_field_opacity_test.0.png'
),
matchesGoldenFile
(
'text_field_opacity_test.0.png'
),
);
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'text field toolbar options correctly changes options'
,
testWidgets
(
'text field toolbar options correctly changes options'
,
(
WidgetTester
tester
)
async
{
(
WidgetTester
tester
)
async
{
...
@@ -496,7 +496,9 @@ void main() {
...
@@ -496,7 +496,9 @@ void main() {
expect
(
find
.
text
(
'Copy'
),
findsOneWidget
);
expect
(
find
.
text
(
'Copy'
),
findsOneWidget
);
expect
(
find
.
text
(
'Cut'
),
findsNothing
);
expect
(
find
.
text
(
'Cut'
),
findsNothing
);
expect
(
find
.
text
(
'Select All'
),
findsNothing
);
expect
(
find
.
text
(
'Select All'
),
findsNothing
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}),
);
testWidgets
(
'text selection style 1'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'text selection style 1'
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller
=
TextEditingController
(
final
TextEditingController
controller
=
TextEditingController
(
...
@@ -625,7 +627,14 @@ void main() {
...
@@ -625,7 +627,14 @@ void main() {
expect
(
find
.
text
(
'COPY'
),
findsOneWidget
);
expect
(
find
.
text
(
'COPY'
),
findsOneWidget
);
expect
(
find
.
text
(
'CUT'
),
findsNothing
);
expect
(
find
.
text
(
'CUT'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
,
TargetPlatform
.
fuchsia
,
TargetPlatform
.
linux
,
TargetPlatform
.
windows
}));
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
,
TargetPlatform
.
fuchsia
,
TargetPlatform
.
linux
,
TargetPlatform
.
windows
,
}),
);
testWidgets
(
'cursor layout has correct width'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'cursor layout has correct width'
,
(
WidgetTester
tester
)
async
{
EditableText
.
debugDeterministicCursor
=
true
;
EditableText
.
debugDeterministicCursor
=
true
;
...
@@ -2917,7 +2926,7 @@ void main() {
...
@@ -2917,7 +2926,7 @@ void main() {
// and the left edge of the input and label.
// and the left edge of the input and label.
expect
(
iconRight
+
28.0
,
equals
(
tester
.
getTopLeft
(
find
.
text
(
'label'
)).
dx
));
expect
(
iconRight
+
28.0
,
equals
(
tester
.
getTopLeft
(
find
.
text
(
'label'
)).
dx
));
expect
(
iconRight
+
28.0
,
equals
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
));
expect
(
iconRight
+
28.0
,
equals
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Collapsed hint text placement'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Collapsed hint text placement'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/material/text_form_field_test.dart
View file @
5d5175b0
...
@@ -303,7 +303,7 @@ void main() {
...
@@ -303,7 +303,7 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
expect
(
renderEditable
,
paintsExactlyCountTimes
(
#drawRect
,
0
));
expect
(
renderEditable
,
paintsExactlyCountTimes
(
#drawRect
,
0
));
},
skip:
isBrowser
);
//
w
e do not use Flutter-rendered context menu on the Web
},
skip:
isBrowser
);
//
W
e do not use Flutter-rendered context menu on the Web
testWidgets
(
'onTap is called upon tap'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'onTap is called upon tap'
,
(
WidgetTester
tester
)
async
{
int
tapCount
=
0
;
int
tapCount
=
0
;
...
...
packages/flutter/test/material/text_selection_test.dart
View file @
5d5175b0
...
@@ -123,7 +123,10 @@ void main() {
...
@@ -123,7 +123,10 @@ void main() {
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsOneWidget
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsOneWidget
);
expect
(
find
.
byType
(
IconButton
),
findsNothing
);
expect
(
find
.
byType
(
IconButton
),
findsNothing
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
testWidgets
(
'When menu items don
\'
t fit, an overflow menu is used.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'When menu items don
\'
t fit, an overflow menu is used.'
,
(
WidgetTester
tester
)
async
{
// Set the screen size to more narrow, so that SELECT ALL can't fit.
// Set the screen size to more narrow, so that SELECT ALL can't fit.
...
@@ -194,7 +197,10 @@ void main() {
...
@@ -194,7 +197,10 @@ void main() {
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
testWidgets
(
'A smaller menu bumps more items to the overflow menu.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'A smaller menu bumps more items to the overflow menu.'
,
(
WidgetTester
tester
)
async
{
// Set the screen size so narrow that only CUT and COPY can fit.
// Set the screen size so narrow that only CUT and COPY can fit.
...
@@ -256,7 +262,10 @@ void main() {
...
@@ -256,7 +262,10 @@ void main() {
expect
(
find
.
text
(
'PASTE'
),
findsNothing
);
expect
(
find
.
text
(
'PASTE'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
testWidgets
(
'When the menu renders below the text, the overflow menu back button is at the top.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'When the menu renders below the text, the overflow menu back button is at the top.'
,
(
WidgetTester
tester
)
async
{
// Set the screen size to more narrow, so that SELECT ALL can't fit.
// Set the screen size to more narrow, so that SELECT ALL can't fit.
...
@@ -327,7 +336,10 @@ void main() {
...
@@ -327,7 +336,10 @@ void main() {
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
text
(
'SELECT ALL'
),
findsNothing
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
expect
(
find
.
byType
(
IconButton
),
findsOneWidget
);
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
testWidgets
(
'When the menu items change, the menu is closed and _closedWidth reset.'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'When the menu items change, the menu is closed and _closedWidth reset.'
,
(
WidgetTester
tester
)
async
{
// Set the screen size to more narrow, so that SELECT ALL can't fit.
// Set the screen size to more narrow, so that SELECT ALL can't fit.
...
@@ -430,7 +442,10 @@ void main() {
...
@@ -430,7 +442,10 @@ void main() {
expect
(
find
.
byType
(
IconButton
),
findsNothing
);
expect
(
find
.
byType
(
IconButton
),
findsNothing
);
final
Offset
newCutOffset
=
tester
.
getTopLeft
(
find
.
text
(
'CUT'
));
final
Offset
newCutOffset
=
tester
.
getTopLeft
(
find
.
text
(
'CUT'
));
expect
(
newCutOffset
,
equals
(
cutOffset
));
expect
(
newCutOffset
,
equals
(
cutOffset
));
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
});
});
group
(
'menu position'
,
()
{
group
(
'menu position'
,
()
{
...
@@ -501,7 +516,10 @@ void main() {
...
@@ -501,7 +516,10 @@ void main() {
final
Offset
bottomHandlePos
=
endpoints
[
1
].
point
;
final
Offset
bottomHandlePos
=
endpoints
[
1
].
point
;
final
Offset
cutOffset
=
tester
.
getTopLeft
(
find
.
text
(
'CUT'
));
final
Offset
cutOffset
=
tester
.
getTopLeft
(
find
.
text
(
'CUT'
));
expect
(
cutOffset
.
dy
,
greaterThan
(
bottomHandlePos
.
dy
));
expect
(
cutOffset
.
dy
,
greaterThan
(
bottomHandlePos
.
dy
));
},
skip:
isBrowser
,
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}));
},
skip:
isBrowser
,
// We do not use Flutter-rendered context menu on the Web
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
}),
);
});
});
group
(
'material handles'
,
()
{
group
(
'material handles'
,
()
{
...
...
packages/flutter/test/material/tooltip_test.dart
View file @
5d5175b0
...
@@ -149,7 +149,7 @@ void main() {
...
@@ -149,7 +149,7 @@ void main() {
);
);
expect
(
tip
.
size
.
height
,
equals
(
24.0
));
// 14.0 height + 5.0 padding * 2 (top, bottom)
expect
(
tip
.
size
.
height
,
equals
(
24.0
));
// 14.0 height + 5.0 padding * 2 (top, bottom)
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)),
equals
(
const
Offset
(
10.0
,
20.0
)));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)),
equals
(
const
Offset
(
10.0
,
20.0
)));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Does tooltip end up in the right place - center prefer above fits'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Does tooltip end up in the right place - center prefer above fits'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -384,7 +384,7 @@ void main() {
...
@@ -384,7 +384,7 @@ void main() {
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)).
dy
,
equals
(
310.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)).
dy
,
equals
(
310.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dx
,
equals
(
790.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dx
,
equals
(
790.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dy
,
equals
(
324.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dy
,
equals
(
324.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Does tooltip end up in the right place - near the edge'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Does tooltip end up in the right place - near the edge'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -441,7 +441,7 @@ void main() {
...
@@ -441,7 +441,7 @@ void main() {
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)).
dy
,
equals
(
310.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
topLeft
(
Offset
.
zero
)).
dy
,
equals
(
310.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dx
,
equals
(
790.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dx
,
equals
(
790.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dy
,
equals
(
324.0
));
expect
(
tip
.
localToGlobal
(
tip
.
size
.
bottomRight
(
Offset
.
zero
)).
dy
,
equals
(
324.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Custom tooltip margin'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Custom tooltip margin'
,
(
WidgetTester
tester
)
async
{
const
double
_customMarginValue
=
10.0
;
const
double
_customMarginValue
=
10.0
;
...
@@ -677,7 +677,7 @@ void main() {
...
@@ -677,7 +677,7 @@ void main() {
rrect:
RRect
.
fromRectAndRadius
(
tip
.
paintBounds
,
const
Radius
.
circular
(
4.0
)),
rrect:
RRect
.
fromRectAndRadius
(
tip
.
paintBounds
,
const
Radius
.
circular
(
4.0
)),
color:
const
Color
(
0xe6616161
),
color:
const
Color
(
0xe6616161
),
));
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Can tooltip decoration be customized'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Can tooltip decoration be customized'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -718,7 +718,7 @@ void main() {
...
@@ -718,7 +718,7 @@ void main() {
expect
(
tip
,
paints
..
path
(
expect
(
tip
,
paints
..
path
(
color:
const
Color
(
0x80800000
),
color:
const
Color
(
0x80800000
),
));
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tooltip stays after long press'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip stays after long press'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -946,7 +946,7 @@ void main() {
...
@@ -946,7 +946,7 @@ void main() {
_findTooltipContainer
(
tooltipText
),
_findTooltipContainer
(
tooltipText
),
);
);
expect
(
tip
.
size
.
height
,
equals
(
56.0
));
expect
(
tip
.
size
.
height
,
equals
(
56.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Haptic feedback'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Haptic feedback'
,
(
WidgetTester
tester
)
async
{
final
FeedbackTester
feedback
=
FeedbackTester
();
final
FeedbackTester
feedback
=
FeedbackTester
();
...
...
packages/flutter/test/material/tooltip_theme_test.dart
View file @
5d5175b0
...
@@ -684,7 +684,7 @@ void main() {
...
@@ -684,7 +684,7 @@ void main() {
expect
(
tip
,
paints
..
path
(
expect
(
tip
,
paints
..
path
(
color:
const
Color
(
0x80800000
),
color:
const
Color
(
0x80800000
),
));
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tooltip decoration - TooltipTheme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip decoration - TooltipTheme'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -726,7 +726,7 @@ void main() {
...
@@ -726,7 +726,7 @@ void main() {
expect
(
tip
,
paints
..
path
(
expect
(
tip
,
paints
..
path
(
color:
const
Color
(
0x80800000
),
color:
const
Color
(
0x80800000
),
));
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tooltip height and padding - ThemeData.tooltipTheme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip height and padding - ThemeData.tooltipTheme'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -773,7 +773,7 @@ void main() {
...
@@ -773,7 +773,7 @@ void main() {
expect
(
tip
.
size
.
height
,
equals
(
customTooltipHeight
));
expect
(
tip
.
size
.
height
,
equals
(
customTooltipHeight
));
expect
(
content
.
size
.
height
,
equals
(
customTooltipHeight
-
2
*
customPaddingVal
));
expect
(
content
.
size
.
height
,
equals
(
customTooltipHeight
-
2
*
customPaddingVal
));
expect
(
content
.
size
.
width
,
equals
(
tip
.
size
.
width
-
2
*
customPaddingVal
));
expect
(
content
.
size
.
width
,
equals
(
tip
.
size
.
width
-
2
*
customPaddingVal
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tooltip height and padding - TooltipTheme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip height and padding - TooltipTheme'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
...
@@ -818,7 +818,7 @@ void main() {
...
@@ -818,7 +818,7 @@ void main() {
expect
(
tip
.
size
.
height
,
equals
(
customTooltipHeight
));
expect
(
tip
.
size
.
height
,
equals
(
customTooltipHeight
));
expect
(
content
.
size
.
height
,
equals
(
customTooltipHeight
-
2
*
customPaddingValue
));
expect
(
content
.
size
.
height
,
equals
(
customTooltipHeight
-
2
*
customPaddingValue
));
expect
(
content
.
size
.
width
,
equals
(
tip
.
size
.
width
-
2
*
customPaddingValue
));
expect
(
content
.
size
.
width
,
equals
(
tip
.
size
.
width
-
2
*
customPaddingValue
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Tooltip waitDuration - ThemeData.tooltipTheme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip waitDuration - ThemeData.tooltipTheme'
,
(
WidgetTester
tester
)
async
{
const
Duration
customWaitDuration
=
Duration
(
milliseconds:
500
);
const
Duration
customWaitDuration
=
Duration
(
milliseconds:
500
);
...
...
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