Unverified Commit 38f318b4 authored by Kostia Sokolovskyi's avatar Kostia Sokolovskyi Committed by GitHub

Cover last test/material tests with leak tracking. (#137004)

parent abf20877
......@@ -381,8 +381,9 @@ void main() {
});
});
testWidgets('FocusNode can request focus', (WidgetTester tester) async {
testWidgetsWithLeakTracking('FocusNode can request focus', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
addTearDown(focusNode.dispose);
await tester.pumpWidget(inputDatePickerField(
focusNode: focusNode,
));
......
......@@ -196,21 +196,21 @@ void main() {
expect(inputText.style.fontSize, headerTextStyle.fontSize);
}
testWidgets('SearchView properties overrides defaults', (WidgetTester tester) async {
testWidgetsWithLeakTracking('SearchView properties overrides defaults', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(useSearchViewProperties: true));
await tester.tap(find.byIcon(Icons.search));
await tester.pumpAndSettle(); // allow the animations to finish
checkSearchView(tester);
});
testWidgets('SearchView theme data overrides defaults', (WidgetTester tester) async {
testWidgetsWithLeakTracking('SearchView theme data overrides defaults', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme));
await tester.tap(find.byIcon(Icons.search));
await tester.pumpAndSettle();
checkSearchView(tester);
});
testWidgets('Overall Theme SearchView theme overrides defaults', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Overall Theme SearchView theme overrides defaults', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme));
await tester.tap(find.byIcon(Icons.search));
await tester.pumpAndSettle();
......@@ -219,7 +219,7 @@ void main() {
// Same as the previous tests with empty SearchViewThemeData's instead of null.
testWidgets('SearchView properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async {
testWidgetsWithLeakTracking('SearchView properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(useSearchViewProperties: true,
searchViewThemeData: const SearchViewThemeData(),
overallTheme: const SearchViewThemeData()));
......@@ -228,7 +228,7 @@ void main() {
checkSearchView(tester);
});
testWidgets('SearchView theme overrides defaults and overall theme', (WidgetTester tester) async {
testWidgetsWithLeakTracking('SearchView theme overrides defaults and overall theme', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme,
overallTheme: const SearchViewThemeData()));
await tester.tap(find.byIcon(Icons.search));
......@@ -236,7 +236,7 @@ void main() {
checkSearchView(tester);
});
testWidgets('Overall Theme SearchView theme overrides defaults and null theme', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Overall Theme SearchView theme overrides defaults and null theme', (WidgetTester tester) async {
await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme));
await tester.tap(find.byIcon(Icons.search));
await tester.pumpAndSettle(); // allow the animations to finish
......
......@@ -404,7 +404,7 @@ void main() {
expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString()));
});
testWidgets('Material2 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Material2 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async {
final ThemeData defaultTheme = ThemeData(useMaterial3: false);
await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme, entryMode: TimePickerEntryMode.input));
await tester.tap(find.text('X'));
......@@ -446,7 +446,7 @@ void main() {
expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString()));
});
testWidgets('Material3 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Material3 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async {
final ThemeData defaultTheme = ThemeData(useMaterial3: true);
await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme, entryMode: TimePickerEntryMode.input));
await tester.tap(find.text('X'));
......@@ -737,7 +737,7 @@ void main() {
expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(timePickerTheme.confirmButtonStyle.toString()));
});
testWidgets('Time picker uses values from TimePickerThemeData with InputDecorationTheme - input mode', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Time picker uses values from TimePickerThemeData with InputDecorationTheme - input mode', (WidgetTester tester) async {
final TimePickerThemeData timePickerTheme = _timePickerTheme(includeInputDecoration: true);
final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme);
await tester.pumpWidget(_TimePickerLauncher(themeData: theme, entryMode: TimePickerEntryMode.input));
......@@ -754,7 +754,7 @@ void main() {
expect(hourDecoration.hintStyle, timePickerTheme.inputDecorationTheme!.hintStyle);
});
testWidgets('Time picker uses values from TimePickerThemeData without InputDecorationTheme - input mode', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Time picker uses values from TimePickerThemeData without InputDecorationTheme - input mode', (WidgetTester tester) async {
final TimePickerThemeData timePickerTheme = _timePickerTheme();
final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme);
await tester.pumpWidget(_TimePickerLauncher(themeData: theme, entryMode: TimePickerEntryMode.input));
......
......@@ -1480,16 +1480,18 @@ void main() {
semantics.dispose();
});
testWidgets('Tooltip semantics does not merge into child', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Tooltip semantics does not merge into child', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);
final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>();
late final OverlayEntry entry;
addTearDown(() => entry..remove()..dispose());
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Overlay(
initialEntries: <OverlayEntry>[
OverlayEntry(
entry = OverlayEntry(
builder: (BuildContext context) {
return ListView(
children: <Widget>[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment