accessibility_test.dart 36.2 KB
Newer Older
1 2 3
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_gallery/demo/all.dart';
4
import 'package:flutter_gallery/gallery/themes.dart';
5 6 7 8 9

void main() {
  group('All material demos meet recommended tap target sizes', () {
    testWidgets('backdrop_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
10
      await tester.pumpWidget(MaterialApp(home: BackdropDemo()));
11
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
12 13 14 15 16
      handle.dispose();
    });

    testWidgets('bottom_app_bar_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
17
      await tester.pumpWidget(MaterialApp(home: BottomAppBarDemo()));
18
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
19 20 21 22 23
      handle.dispose();
    });

    testWidgets('bottom_navigation_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
24
      await tester.pumpWidget(MaterialApp(home: BottomNavigationDemo()));
25
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
26 27 28 29 30
      handle.dispose();
    });

    testWidgets('buttons_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
31
      await tester.pumpWidget(MaterialApp(home: ButtonsDemo()));
32
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
33 34 35 36 37
      handle.dispose();
    });

    testWidgets('cards_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
38
      await tester.pumpWidget(MaterialApp(home: CardsDemo()));
39
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
40 41 42 43 44
      handle.dispose();
    });

    testWidgets('chip_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
45
      await tester.pumpWidget(MaterialApp(home: ChipDemo()));
46
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
47 48 49 50 51
      handle.dispose();
    });

    testWidgets('data_table_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
52
      await tester.pumpWidget(MaterialApp(home: DataTableDemo()));
53
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
54 55 56 57 58
      handle.dispose();
    });

    testWidgets('date_and_time_picker_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
59
      await tester.pumpWidget(MaterialApp(home: DateAndTimePickerDemo()));
60
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
61
      handle.dispose();
62
    });
63 64 65

    testWidgets('dialog_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
66
      await tester.pumpWidget(MaterialApp(home: DialogDemo()));
67
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
68 69 70 71 72
      handle.dispose();
    });

    testWidgets('drawer_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
73
      await tester.pumpWidget(MaterialApp(home: DrawerDemo()));
74
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
75 76 77 78 79
      handle.dispose();
    });

    testWidgets('elevation_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
80
      await tester.pumpWidget(MaterialApp(home: ElevationDemo()));
81
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
82 83 84 85 86
      handle.dispose();
    });

    testWidgets('expansion_panels_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
87
      await tester.pumpWidget(MaterialApp(home: ExpansionPanelsDemo()));
88
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
89 90 91 92 93
      handle.dispose();
    });

    testWidgets('grid_list_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
94
      await tester.pumpWidget(const MaterialApp(home: GridListDemo()));
95
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
96 97 98 99 100
      handle.dispose();
    });

    testWidgets('icons_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
101
      await tester.pumpWidget(MaterialApp(home: IconsDemo()));
102
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
103 104 105 106 107
      handle.dispose();
    });

    testWidgets('leave_behind_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
108
      await tester.pumpWidget(const MaterialApp(home: LeaveBehindDemo()));
109
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
110 111 112 113 114
      handle.dispose();
    });

    testWidgets('list_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
115
      await tester.pumpWidget(const MaterialApp(home: ListDemo()));
116
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
117 118 119 120 121
      handle.dispose();
    });

    testWidgets('menu_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
122
      await tester.pumpWidget(const MaterialApp(home: MenuDemo()));
123
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
124 125 126 127 128
      handle.dispose();
    });

    testWidgets('modal_bottom_sheet_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
129
      await tester.pumpWidget(MaterialApp(home: ModalBottomSheetDemo()));
130
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
131 132 133 134 135
      handle.dispose();
    });

    testWidgets('overscroll_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
136
      await tester.pumpWidget(const MaterialApp(home: OverscrollDemo()));
137
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
138 139 140 141 142
      handle.dispose();
    });

    testWidgets('page_selector_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
143
      await tester.pumpWidget(MaterialApp(home: PageSelectorDemo()));
144
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
145 146 147 148 149
      handle.dispose();
    });

    testWidgets('persistent_bottom_sheet_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
150
      await tester.pumpWidget(MaterialApp(home: PersistentBottomSheetDemo()));
151
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
152 153 154 155 156
      handle.dispose();
    });

    testWidgets('progress_indicator_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
157
      await tester.pumpWidget(MaterialApp(home: ProgressIndicatorDemo()));
158
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
159 160 161 162 163
      handle.dispose();
    });

    testWidgets('reorderable_list_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
164
      await tester.pumpWidget(const MaterialApp(home: ReorderableListDemo()));
165
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
166 167 168 169 170
      handle.dispose();
    });

    testWidgets('scrollable_tabs_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
171
      await tester.pumpWidget(MaterialApp(home: ScrollableTabsDemo()));
172
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
173 174 175 176 177
      handle.dispose();
    });

    testWidgets('search_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
178
      await tester.pumpWidget(MaterialApp(home: SearchDemo()));
179
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
180 181 182 183 184
      handle.dispose();
    });

    testWidgets('selection_controls_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
185
      await tester.pumpWidget(MaterialApp(home: SelectionControlsDemo()));
186
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
187 188 189 190 191
      handle.dispose();
    });

    testWidgets('slider_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
192
      await tester.pumpWidget(MaterialApp(home: SliderDemo()));
193
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
194 195 196 197 198
      handle.dispose();
    });

    testWidgets('snack_bar_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
199
      await tester.pumpWidget(const MaterialApp(home: SnackBarDemo()));
200
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
201 202 203 204 205
      handle.dispose();
    });

    testWidgets('tabs_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
206
      await tester.pumpWidget(MaterialApp(home: TabsDemo()));
207
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
208 209 210 211 212
      handle.dispose();
    });

    testWidgets('tabs_fab_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
213
      await tester.pumpWidget(MaterialApp(home: TabsFabDemo()));
214
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
215 216 217 218 219
      handle.dispose();
    });

    testWidgets('text_form_field_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
220
      await tester.pumpWidget(const MaterialApp(home: TextFormFieldDemo()));
221
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
222 223 224 225 226
      handle.dispose();
    });

    testWidgets('tooltip_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
227
      await tester.pumpWidget(MaterialApp(home: TooltipDemo()));
228
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
229 230 231
      handle.dispose();
    });

232
    testWidgets('expansion_tile_list_demo', (WidgetTester tester) async {
233
      final SemanticsHandle handle = tester.ensureSemantics();
234
      await tester.pumpWidget(MaterialApp(home: ExpansionTileListDemo()));
235 236 237 238 239 240 241 242 243 244 245
      await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
      handle.dispose();
    });
  });

  group('All material demos have labeled tap targets', () {
    testWidgets('backdrop_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: BackdropDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
246
    });
247 248 249 250 251 252

    testWidgets('bottom_app_bar_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: BottomAppBarDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
253
    });
254 255 256 257 258 259 260 261 262 263 264 265 266

    testWidgets('bottom_navigation_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: BottomNavigationDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('buttons_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ButtonsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
267
    });
268 269 270 271 272 273

    testWidgets('cards_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: CardsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
274
    });
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448

    testWidgets('chip_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ChipDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('data_table_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: DataTableDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    }, skip: true);

    testWidgets('date_and_time_picker_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: DateAndTimePickerDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('dialog_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: DialogDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('drawer_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: DrawerDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('elevation_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ElevationDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    }, skip: true);

    testWidgets('expansion_panels_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ExpansionPanelsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('grid_list_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: GridListDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    }, skip: true);

    testWidgets('icons_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: IconsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('leave_behind_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: LeaveBehindDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('list_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: ListDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('menu_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: MenuDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('modal_bottom_sheet_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ModalBottomSheetDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('overscroll_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: OverscrollDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('page_selector_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: PageSelectorDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('persistent_bottom_sheet_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: PersistentBottomSheetDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('progress_indicator_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ProgressIndicatorDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('reorderable_list_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: ReorderableListDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('scrollable_tabs_demo', (WidgetTester tester) async {
     final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: ScrollableTabsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    }, skip: true);

    testWidgets('search_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: SearchDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('selection_controls_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: SelectionControlsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    }, skip: true);

    testWidgets('slider_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: SliderDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('snack_bar_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: SnackBarDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('tabs_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: TabsDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

    testWidgets('tabs_fab_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: TabsFabDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
449
    });
450 451 452 453 454 455

    testWidgets('text_form_field_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: TextFormFieldDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
456
    });
457 458 459 460 461 462 463 464

    testWidgets('tooltip_demo', (WidgetTester tester) async {
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(MaterialApp(home: TooltipDemo()));
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
      handle.dispose();
    });

465
    testWidgets('expansion_tile_list_demo', (WidgetTester tester) async {
466
      final SemanticsHandle handle = tester.ensureSemantics();
467
      await tester.pumpWidget(MaterialApp(home: ExpansionTileListDemo()));
468
      await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
469 470 471 472 473
      handle.dispose();
    });
  });

  group('All material demos meet text contrast guidelines', () {
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
    final List<ThemeData> themes = <ThemeData>[
      kLightGalleryTheme.data,
      ThemeData.light(),
      // TODO(hansmuller): add kDarkGalleryTheme.data, ThemeData.dark(), see #22044
    ];

    const List<String> themeNames = <String>[
      'kLightGalleryTheme',
      'ThemeData.light()',
      // TODO(hansmuller): add 'kDarkGalleryTheme', 'ThemeData.dark()', see 22044
    ];

    for (int themeIndex = 0; themeIndex < themes.length; themeIndex += 1) {
      final ThemeData theme = themes[themeIndex];
      final String themeName = themeNames[themeIndex];

      testWidgets('backdrop_demo $themeName', (WidgetTester tester) async {
491 492
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
493 494 495 496 497 498 499
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: BackdropDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('bottom_app_bar_demo $themeName', (WidgetTester tester) async {
500 501
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
502 503 504 505
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: BottomAppBarDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
506
      });
507 508

      testWidgets('bottom_navigation_demo $themeName', (WidgetTester tester) async {
509 510
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
511 512 513 514 515 516 517
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: BottomNavigationDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('buttons_demo $themeName', (WidgetTester tester) async {
518 519
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
520 521 522 523
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ButtonsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
524
      });
525 526

      testWidgets('cards_demo $themeName', (WidgetTester tester) async {
527 528
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
529 530 531 532
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: CardsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
533
      });
534 535

      testWidgets('chip_demo $themeName', (WidgetTester tester) async {
536 537
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
538 539 540 541 542 543 544
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ChipDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      }, skip: true); // https://github.com/flutter/flutter/issues/21647

      testWidgets('data_table_demo $themeName', (WidgetTester tester) async {
545 546
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
547 548 549 550 551 552 553
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: DataTableDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      }, skip: true); // https://github.com/flutter/flutter/issues/21647

      testWidgets('date_and_time_picker_demo $themeName', (WidgetTester tester) async {
554 555
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
556 557 558 559 560 561 562
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: DateAndTimePickerDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      }, skip: true); // https://github.com/flutter/flutter/issues/21647

      testWidgets('dialog_demo $themeName', (WidgetTester tester) async {
563 564
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
565 566 567 568 569 570 571
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: DialogDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('drawer_demo $themeName', (WidgetTester tester) async {
572 573
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
574 575 576 577 578 579 580
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: DrawerDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('elevation_demo $themeName', (WidgetTester tester) async {
581 582
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
583 584 585 586 587 588 589
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ElevationDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('expansion_panels_demo $themeName', (WidgetTester tester) async {
590 591
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
592 593 594 595 596 597 598
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ExpansionPanelsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('grid_list_demo $themeName', (WidgetTester tester) async {
599 600
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
601 602 603 604 605 606 607
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const GridListDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('icons_demo $themeName', (WidgetTester tester) async {
608 609
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
610 611 612 613 614 615 616
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: IconsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      }, skip: true); // https://github.com/flutter/flutter/issues/21647

      testWidgets('leave_behind_demo $themeName', (WidgetTester tester) async {
617 618
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
619 620 621 622 623 624 625
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const LeaveBehindDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('list_demo $themeName', (WidgetTester tester) async {
626 627
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
628 629 630 631 632 633 634
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const ListDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('menu_demo $themeName', (WidgetTester tester) async {
635 636
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
637 638 639 640 641 642 643
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const MenuDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('modal_bottom_sheet_demo $themeName', (WidgetTester tester) async {
644 645
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
646 647 648 649 650 651
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ModalBottomSheetDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

652 653 654 655 656 657 658 659
    testWidgets('overscroll_demo', (WidgetTester tester) async {
      final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
      binding.addTime(const Duration(seconds: 3));
      final SemanticsHandle handle = tester.ensureSemantics();
      await tester.pumpWidget(const MaterialApp(home: OverscrollDemo()));
      await expectLater(tester, meetsGuideline(textContrastGuideline));
      handle.dispose();
    });
660 661

      testWidgets('page_selector_demo $themeName', (WidgetTester tester) async {
662 663
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
664 665 666 667 668 669 670
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: PageSelectorDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('persistent_bottom_sheet_demo $themeName', (WidgetTester tester) async {
671 672
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
673 674 675 676 677 678 679
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: PersistentBottomSheetDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('progress_indicator_demo $themeName', (WidgetTester tester) async {
680 681
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
682 683 684 685 686 687 688
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ProgressIndicatorDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('reorderable_list_demo $themeName', (WidgetTester tester) async {
689 690
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
691 692 693 694 695 696 697
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const ReorderableListDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('scrollable_tabs_demo $themeName', (WidgetTester tester) async {
698 699
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
700 701 702 703 704 705 706
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: ScrollableTabsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('search_demo $themeName', (WidgetTester tester) async {
707 708
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
709 710 711 712 713 714 715
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: SearchDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      }, skip: true); // https://github.com/flutter/flutter/issues/21651

      testWidgets('selection_controls_demo $themeName', (WidgetTester tester) async {
716 717
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
718 719 720 721 722 723 724
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: SelectionControlsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('slider_demo $themeName', (WidgetTester tester) async {
725 726
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
727 728 729 730 731 732 733
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: SliderDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('snack_bar_demo $themeName', (WidgetTester tester) async {
734 735
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
736 737 738 739 740 741 742
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const SnackBarDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('tabs_demo $themeName', (WidgetTester tester) async {
743 744
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
745 746 747 748 749 750 751
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: TabsDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('tabs_fab_demo $themeName', (WidgetTester tester) async {
752 753
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
754 755 756 757 758 759 760
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: TabsFabDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('text_form_field_demo $themeName', (WidgetTester tester) async {
761 762
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
763 764 765 766 767 768 769
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: const TextFormFieldDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

      testWidgets('tooltip_demo $themeName', (WidgetTester tester) async {
770 771
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
772 773 774 775 776 777
        final SemanticsHandle handle = tester.ensureSemantics();
        await tester.pumpWidget(MaterialApp(theme: theme, home: TooltipDemo()));
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });

778
      testWidgets('expansion_tile_list_demo $themeName', (WidgetTester tester) async {
779 780
        final AutomatedTestWidgetsFlutterBinding binding = tester.binding;
        binding.addTime(const Duration(seconds: 3));
781
        final SemanticsHandle handle = tester.ensureSemantics();
782
        await tester.pumpWidget(MaterialApp(theme: theme, home: ExpansionTileListDemo()));
783 784 785 786
        await expectLater(tester, meetsGuideline(textContrastGuideline));
        handle.dispose();
      });
    }
787
  });
788
}