Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/targets/web_dart_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ tasks:
args: [
"dart-test",
"--platform=chrome",
"--package-tags=script/configs/web_dart_unit_test_tags.yaml",
"--exclude=script/configs/dart_unit_tests_exceptions.yaml"
]
2 changes: 2 additions & 0 deletions packages/material_ui/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tags:
reduced-web-test-set:
2 changes: 2 additions & 0 deletions packages/material_ui/example/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tags:
reduced-web-test-set:
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ void main() {
expect(find.text('Paste'), findsNothing);
expect(find.text('Select all'), findsNothing);
},
tags: 'reduced-web-test-set',
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ void main() {
await tester.pumpAndSettle();

expect(find.byType(AdaptiveTextSelectionToolbar), findsNothing);
});
}, tags: 'reduced-web-test-set');
}
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,6 @@ void main() {
isNull,
);
},
tags: 'reduced-web-test-set',
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ void main() {
} else {
expect(getFocuses(), const <bool>[true, false, false, false, false]);
}
});
}, tags: 'reduced-web-test-set');
}
2 changes: 1 addition & 1 deletion packages/material_ui/test/action_chip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('ActionChip mouse cursor behavior', (WidgetTester tester) async {
const SystemMouseCursor customCursor = SystemMouseCursors.grab;
Expand Down
6 changes: 3 additions & 3 deletions packages/material_ui/test/back_button_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void main() {
expect(macOSIcon.icon == androidIcon.icon, kIsWeb ? isTrue : isFalse);
expect(macOSIcon.icon == iOSIcon.icon, isTrue);
expect(windowsIcon.icon == androidIcon.icon, isTrue);
});
}, tags: 'reduced-web-test-set');

testWidgets('BackButton color', (WidgetTester tester) async {
await tester.pumpWidget(
Expand Down Expand Up @@ -399,7 +399,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('CloseButton has expected default mouse cursor on hover', (
WidgetTester tester,
Expand All @@ -421,7 +421,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('BackButton has expected mouse cursor when explicitly configured', (
WidgetTester tester,
Expand Down
3 changes: 2 additions & 1 deletion packages/material_ui/test/checkbox_list_tile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ void main() {
);

await tester.pumpAndSettle();
});
}, tags: 'reduced-web-test-set');

testWidgets('CheckboxListTile respects fillColor in enabled/disabled states', (
WidgetTester tester,
Expand Down Expand Up @@ -1039,6 +1039,7 @@ void main() {
await gesture4.up();
await tester.pumpAndSettle();
},
tags: 'reduced-web-test-set',
);

testWidgets('CheckboxListTile respects splashRadius', (WidgetTester tester) async {
Expand Down
5 changes: 3 additions & 2 deletions packages/material_ui/test/checkbox_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.space);
await tester.pumpAndSettle();
expect(value, isTrue);
});
}, tags: 'reduced-web-test-set');

testWidgets(
'Material3 - Checkbox visual density cannot be overridden by ThemeData.visualDensity',
Expand Down Expand Up @@ -1328,7 +1328,7 @@ void main() {
);

await tester.pumpAndSettle();
});
}, tags: 'reduced-web-test-set');

testWidgets('Checkbox fill color resolves in enabled/disabled states', (
WidgetTester tester,
Expand Down Expand Up @@ -2383,6 +2383,7 @@ void main() {
TargetPlatform.iOS,
TargetPlatform.macOS,
}),
tags: 'reduced-web-test-set',
);

testWidgets('Material2 - Checkbox respects fillColor when it is unchecked', (
Expand Down
22 changes: 11 additions & 11 deletions packages/material_ui/test/chip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ void main() {
expect(getSelectProgress(tester), equals(0.0));
expect(getAvatarDrawerProgress(tester), equals(1.0));
expect(getDeleteDrawerProgress(tester), equals(0.0));
});
}, tags: 'reduced-web-test-set');

testWidgets('Material2 - Selection without avatar works as expected on RawChip', (
WidgetTester tester,
Expand Down Expand Up @@ -2390,7 +2390,7 @@ void main() {
expect(getSelectProgress(tester), equals(0.0));
expect(getAvatarDrawerProgress(tester), equals(0.0));
expect(getDeleteDrawerProgress(tester), equals(0.0));
});
}, tags: 'reduced-web-test-set');

testWidgets('Material2 - Activation works as expected on RawChip', (WidgetTester tester) async {
var selected = false;
Expand Down Expand Up @@ -2503,7 +2503,7 @@ void main() {
expect(getAvatarDrawerProgress(tester), equals(1.0));
expect(getDeleteDrawerProgress(tester), equals(0.0));
await tester.pumpAndSettle();
});
}, tags: 'reduced-web-test-set');

testWidgets('Chip uses ThemeData chip theme if present', (WidgetTester tester) async {
final theme = ThemeData(chipTheme: const ChipThemeData(backgroundColor: Color(0xffff0000)));
Expand Down Expand Up @@ -2876,7 +2876,7 @@ void main() {
),
);
semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('delete', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -2940,7 +2940,7 @@ void main() {
),
);
semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('with onPressed', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -2994,7 +2994,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('with onSelected', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -3117,7 +3117,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('disabled', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -3169,7 +3169,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('tapEnabled explicitly false', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -3218,7 +3218,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('enabled when tapEnabled and canTap', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -3273,7 +3273,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('disabled when tapEnabled but not canTap', (WidgetTester tester) async {
final semanticsTester = SemanticsTester(tester);
Expand Down Expand Up @@ -3322,7 +3322,7 @@ void main() {
);

semanticsTester.dispose();
});
}, tags: 'reduced-web-test-set');
});

testWidgets('can be tapped outside of chip delete icon', (WidgetTester tester) async {
Expand Down
2 changes: 1 addition & 1 deletion packages/material_ui/test/choice_chip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('ChoiceChip mouse cursor behavior', (WidgetTester tester) async {
const SystemMouseCursor customCursor = SystemMouseCursors.grab;
Expand Down
2 changes: 1 addition & 1 deletion packages/material_ui/test/data_table_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
SystemMouseCursors.copy,
);
});
}, tags: 'reduced-web-test-set');

// This is a regression test for https://github.com/flutter/flutter/issues/114470.
testWidgets('DataTable text styles are merged with default text style', (
Expand Down
4 changes: 2 additions & 2 deletions packages/material_ui/test/date_picker_theme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ void main() {
..circle() // Selected day decoration.
..circle(color: dayOverlayColor.resolve(<WidgetState>{WidgetState.focused})),
);
});
}, tags: 'reduced-web-test-set');

testWidgets('DatePickerDialog resolves DatePickerTheme.yearOverlayColor states', (
WidgetTester tester,
Expand Down Expand Up @@ -1216,7 +1216,7 @@ void main() {
..circle(color: rangeSelectionOverlayColor.resolve(<WidgetState>{WidgetState.pressed})),
);
}
});
}, tags: 'reduced-web-test-set');

testWidgets('YearPicker maintains default year shape at textScaleFactor 1, 1.5, 2', (
WidgetTester tester,
Expand Down
4 changes: 2 additions & 2 deletions packages/material_ui/test/drawer_button_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('EndDrawerButton has expected default mouse cursor on hover', (
WidgetTester tester,
Expand All @@ -334,7 +334,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('DrawerButton has expected mouse cursor when explicitly configured', (
WidgetTester tester,
Expand Down
2 changes: 1 addition & 1 deletion packages/material_ui/test/dropdown_form_field_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('DropdownButtonFormField has expected mouse cursor when explicitly configured', (
WidgetTester tester,
Expand Down
8 changes: 4 additions & 4 deletions packages/material_ui/test/dropdown_menu_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3018,7 +3018,7 @@ void main() {
await tester.tap(findMenuItemText('Item 0'));
await tester.pumpAndSettle();
expect(controller.text, 'Item 0 $longText');
});
}, tags: 'reduced-web-test-set');

testWidgets('DropdownMenuEntry.labelWidget is Text that specifies maxLines 1 or 2', (
WidgetTester tester,
Expand Down Expand Up @@ -3080,7 +3080,7 @@ void main() {
await tester.tap(find.byType(TextField));
await tester.pumpAndSettle();
expect(controller.text, ''); // nothing selected
});
}, tags: 'reduced-web-test-set');

// Regression test for https://github.com/flutter/flutter/issues/131350.
testWidgets('DropdownMenuEntry.leadingIcon default layout', (WidgetTester tester) async {
Expand Down Expand Up @@ -3750,7 +3750,7 @@ void main() {
textDirection: TextDirection.ltr,
),
);
});
}, tags: 'reduced-web-test-set');

// This is a regression test for https://github.com/flutter/flutter/issues/151854.
testWidgets('scrollToHighlight does not scroll parent', (WidgetTester tester) async {
Expand Down Expand Up @@ -4450,7 +4450,7 @@ void main() {
);

semantics.dispose();
});
}, tags: 'reduced-web-test-set');

testWidgets('restorationId is passed to inner TextField', (WidgetTester tester) async {
const restorationId = 'dropdown_menu';
Expand Down
4 changes: 2 additions & 2 deletions packages/material_ui/test/dropdown_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4007,7 +4007,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('DropdownButton changes mouse cursor when hovered as expected', (
WidgetTester tester,
Expand Down Expand Up @@ -4080,7 +4080,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('DropdownButton has expected mouse cursor when explicitly configured', (
WidgetTester tester,
Expand Down
45 changes: 24 additions & 21 deletions packages/material_ui/test/elevated_button_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1629,30 +1629,33 @@ void main() {
}
});

testWidgets('ElevatedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (
WidgetTester tester,
) async {
final theme = ThemeData();
testWidgets(
'ElevatedButton uses InkSparkle only for Android non-web when useMaterial3 is true',
(WidgetTester tester) async {
final theme = ThemeData();

await tester.pumpWidget(
MaterialApp(
theme: theme,
home: Center(
child: ElevatedButton(onPressed: () {}, child: const Text('button')),
await tester.pumpWidget(
MaterialApp(
theme: theme,
home: Center(
child: ElevatedButton(onPressed: () {}, child: const Text('button')),
),
),
),
);
);

final InkWell buttonInkWell = tester.widget<InkWell>(
find.descendant(of: find.byType(ElevatedButton), matching: find.byType(InkWell)),
);
final InkWell buttonInkWell = tester.widget<InkWell>(
find.descendant(of: find.byType(ElevatedButton), matching: find.byType(InkWell)),
);

if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
}
}, variant: TargetPlatformVariant.all());
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
}
},
variant: TargetPlatformVariant.all(),
tags: 'reduced-web-test-set',
);

testWidgets('ElevatedButton uses InkRipple when useMaterial3 is false', (
WidgetTester tester,
Expand Down Expand Up @@ -1892,7 +1895,7 @@ void main() {
RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
SystemMouseCursors.basic,
);
});
}, tags: 'reduced-web-test-set');

testWidgets('ElevatedButton in SelectionArea changes mouse cursor when hovered', (
WidgetTester tester,
Expand Down
Loading
Loading