diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 135dfa37061..5044ce9c161 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -348,6 +348,7 @@ Future _runWebTests() async { 'test/services/', 'test/painting/', 'test/scheduler/', + 'test/widgets/', 'test/semantics/', ]); } diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index e4141d4f108..9e760a4d14e 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -15,6 +15,9 @@ import 'text_editing.dart'; export 'dart:ui' show TextAffinity; +// Whether we're compiled to JavaScript in a web browser. +const bool _kIsBrowser = identical(0, 0.0); + /// The type of information for which to optimize the text input control. /// /// On Android, behavior may vary across device and keyboard provider. @@ -825,6 +828,10 @@ class TextInput { static bool _debugEnsureInputActionWorksOnPlatform(TextInputAction inputAction) { assert(() { + if (_kIsBrowser) { + // TODO(flutterweb): what makes sense here? + return true; + } if (Platform.isIOS) { assert( _iOSSupportedInputActions.contains(inputAction), diff --git a/packages/flutter/test/widgets/actions_test.dart b/packages/flutter/test/widgets/actions_test.dart index 99398f6a878..17efccd3065 100644 --- a/packages/flutter/test/widgets/actions_test.dart +++ b/packages/flutter/test/widgets/actions_test.dart @@ -286,6 +286,6 @@ void main() { expect(description[0], equalsIgnoringHashCodes('dispatcher: ActionDispatcher#00000')); expect(description[1], equals('actions: {[<\'bar\'>]: Closure: () => TestAction}')); - }); + }, skip: isBrowser); }); } diff --git a/packages/flutter/test/widgets/app_title_test.dart b/packages/flutter/test/widgets/app_title_test.dart index cfe62560a83..c5f07e3f046 100644 --- a/packages/flutter/test/widgets/app_title_test.dart +++ b/packages/flutter/test/widgets/app_title_test.dart @@ -55,6 +55,6 @@ void main() { await tester.pump(); expect(tester.widget(find.byType(Title)).title, 'en_US'); expect(tester.widget<Title>(find.byType(Title)).color, kTitleColor); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/backdrop_filter_test.dart b/packages/flutter/test/widgets/backdrop_filter_test.dart index aa27ee3ebd9..ed0d958786d 100644 --- a/packages/flutter/test/widgets/backdrop_filter_test.dart +++ b/packages/flutter/test/widgets/backdrop_filter_test.dart @@ -46,5 +46,5 @@ void main() { matchesGoldenFile('backdrop_filter_test.cull_rect.1.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/baseline_test.dart b/packages/flutter/test/widgets/baseline_test.dart index 1af069b77d0..631bcf5e59c 100644 --- a/packages/flutter/test/widgets/baseline_test.dart +++ b/packages/flutter/test/widgets/baseline_test.dart @@ -19,7 +19,7 @@ void main() { ), ); expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0)); - }); + }, skip: isBrowser); testWidgets('Baseline - position test', (WidgetTester tester) async { await tester.pumpWidget( @@ -40,7 +40,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0)); expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size, within<Size>(from: const Size(100.0, 200.0), distance: 0.001)); - }); + }, skip: isBrowser); testWidgets('Chip caches baseline', (WidgetTester tester) async { int calls = 0; @@ -65,7 +65,7 @@ void main() { tester.renderObject<RenderBaselineDetector>(find.byType(BaselineDetector)).dirty(); await tester.pump(); expect(calls, 2); - }); + }, skip: isBrowser); testWidgets('ListTile caches baseline', (WidgetTester tester) async { int calls = 0; diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index 15c69966f81..fa0f32e3bd7 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -51,7 +51,7 @@ void main() { expect(tester.hitTestOnBinding(const Offset(100.0, 300.0)), hits(renderPhysicalShape)); expect(tester.hitTestOnBinding(const Offset(100.0, 299.0)), doesNotHit(renderPhysicalShape)); expect(tester.hitTestOnBinding(const Offset(100.0, 301.0)), doesNotHit(renderPhysicalShape)); - }); + }, skip: isBrowser); }); @@ -202,7 +202,7 @@ void main() { tester.getTopLeft(find.byKey(key2)).dy, closeTo(aboveBaseline1 - aboveBaseline2, .001), ); - }); + }, skip: isBrowser); }); test('UnconstrainedBox toString', () { diff --git a/packages/flutter/test/widgets/clip_test.dart b/packages/flutter/test/widgets/clip_test.dart index 668ba730d5d..3557fb8d5d4 100644 --- a/packages/flutter/test/widgets/clip_test.dart +++ b/packages/flutter/test/widgets/clip_test.dart @@ -358,7 +358,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.ClipRect.1.png'), ); - }); + }, skip: isBrowser); testWidgets('ClipRect save, overlay, and antialiasing', (WidgetTester tester) async { await tester.pumpWidget( @@ -398,7 +398,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.ClipRectOverlay.1.png'), ); - }); + }, skip: isBrowser); testWidgets('ClipRRect painting', (WidgetTester tester) async { await tester.pumpWidget( @@ -447,7 +447,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.ClipRRect.1.png'), ); - }); + }, skip: isBrowser); testWidgets('ClipOval painting', (WidgetTester tester) async { await tester.pumpWidget( @@ -490,7 +490,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.ClipOval.1.png'), ); - }); + }, skip: isBrowser); testWidgets('ClipPath painting', (WidgetTester tester) async { await tester.pumpWidget( @@ -538,7 +538,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.ClipPath.1.png'), ); - }); + }, skip: isBrowser); Center genPhysicalModel(Clip clipBehavior) { return Center( @@ -583,7 +583,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalModel.antiAlias.1.png'), ); - }); + }, skip: isBrowser); testWidgets('PhysicalModel painting with Clip.hardEdge', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalModel(Clip.hardEdge)); @@ -591,7 +591,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalModel.hardEdge.1.png'), ); - }); + }, skip: isBrowser); // There will be bleeding edges on the rect edges, but there shouldn't be any bleeding edges on the // round corners. @@ -601,7 +601,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalModel.antiAliasWithSaveLayer.png'), ); - }); + }, skip: isBrowser); testWidgets('Default PhysicalModel painting', (WidgetTester tester) async { await tester.pumpWidget( @@ -643,7 +643,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalModel.default.1.png'), ); - }); + }, skip: isBrowser); Center genPhysicalShape(Clip clipBehavior) { return Center( @@ -692,7 +692,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalShape.antiAlias.1.png'), ); - }); + }, skip: isBrowser); testWidgets('PhysicalShape painting with Clip.hardEdge', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalShape(Clip.hardEdge)); @@ -700,7 +700,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalShape.hardEdge.1.png'), ); - }); + }, skip: isBrowser); testWidgets('PhysicalShape painting with Clip.antiAliasWithSaveLayer', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalShape(Clip.antiAliasWithSaveLayer)); @@ -708,7 +708,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalShape.antiAliasWithSaveLayer.png'), ); - }); + }, skip: isBrowser); testWidgets('PhysicalShape painting', (WidgetTester tester) async { await tester.pumpWidget( @@ -754,7 +754,7 @@ void main() { find.byType(RepaintBoundary).first, matchesGoldenFile('clip.PhysicalShape.default.1.png'), ); - }); + }, skip: isBrowser); testWidgets('ClipPath.shape', (WidgetTester tester) async { final List<String> logs = <String>[]; diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index 725fea19c46..e7267224f08 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -493,7 +493,7 @@ void _defineTests() { ); expect(semantics, hasSemantics(expectedSemantics, ignoreRect: true, ignoreTransform: true)); semantics.dispose(); - }); + }, skip: isBrowser); group('diffing', () { testWidgets('complains about duplicate keys', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart index b8924ee04a0..00ec06ed1ec 100644 --- a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart +++ b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart @@ -101,7 +101,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsOneWidget); expect(find.text('Item 31'), findsOneWidget); - }); + }, skip: isBrowser); testWidgets('Can be dragged down when not full height', (WidgetTester tester) async { await tester.pumpWidget(_boilerplate(null)); @@ -114,7 +114,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsNothing); expect(find.text('Item 36'), findsNothing); - }); + }, skip: isBrowser); testWidgets('Can be dragged down when list is shorter than full height', (WidgetTester tester) async { await tester.pumpWidget(_boilerplate(null, itemCount: 30, initialChildSize: .25)); @@ -131,7 +131,7 @@ void main() { await tester.pumpAndSettle(); expect(find.text('Item 1').hitTestable(), findsOneWidget); expect(find.text('Item 29').hitTestable(), findsNothing); - }); + }, skip: isBrowser); testWidgets('Can be dragged up and cover its container and scroll in single motion, and then dragged back down', (WidgetTester tester) async { int taps = 0; @@ -160,7 +160,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 18'), findsOneWidget); expect(find.text('Item 36'), findsNothing); - }); + }, skip: isBrowser); testWidgets('Can be flung up gently', (WidgetTester tester) async { int taps = 0; @@ -183,7 +183,7 @@ void main() { expect(find.text('Item 21'), findsOneWidget); expect(find.text('Item 36'), findsOneWidget); expect(find.text('Item 70'), findsNothing); - }); + }, skip: isBrowser); testWidgets('Can be flung up', (WidgetTester tester) async { int taps = 0; @@ -204,7 +204,7 @@ void main() { expect(find.text('Item 1'), findsNothing); expect(find.text('Item 21'), findsNothing); expect(find.text('Item 70'), findsOneWidget); - }); + }, skip: isBrowser); testWidgets('Can be flung down when not full height', (WidgetTester tester) async { await tester.pumpWidget(_boilerplate(null)); @@ -217,7 +217,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsNothing); expect(find.text('Item 36'), findsNothing); - }); + }, skip: isBrowser); testWidgets('Can be flung up and then back down', (WidgetTester tester) async { int taps = 0; @@ -256,7 +256,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsNothing); expect(find.text('Item 70'), findsNothing); - }); + }, skip: isBrowser); debugDefaultTargetPlatformOverride = null; }); diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index e785f4e073e..5377cec38a1 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -2085,8 +2085,7 @@ void main() { ], ), ignoreTransform: true, ignoreRect: true)); semantics.dispose(); - }); - + }, skip: isBrowser); } Future<void> _testLongPressDraggableHapticFeedback({ WidgetTester tester, bool hapticFeedbackOnStart, int expectedHapticFeedbackCount }) async { diff --git a/packages/flutter/test/widgets/editable_text_cursor_test.dart b/packages/flutter/test/widgets/editable_text_cursor_test.dart index 0d731556109..da5b16e15be 100644 --- a/packages/flutter/test/widgets/editable_text_cursor_test.dart +++ b/packages/flutter/test/widgets/editable_text_cursor_test.dart @@ -445,7 +445,7 @@ void main() { await tester.pumpAndSettle(); expect(controller.selection.baseOffset, 10); - }); + }, skip: isBrowser); testWidgets('Updating the floating cursor correctly moves the cursor', (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; @@ -501,7 +501,7 @@ void main() { await tester.pumpAndSettle(); // The cursor has been set. expect(controller.selection.baseOffset, 10); - }); + }, skip: isBrowser); // Regression test for https://github.com/flutter/flutter/pull/30475. testWidgets('Trying to select with the floating cursor does not crash', (WidgetTester tester) async { @@ -567,7 +567,7 @@ void main() { offset: const Offset(-250, 20))); editableTextState.updateFloatingCursor(RawFloatingCursorPoint(state: FloatingCursorDragState.End)); await tester.pumpAndSettle(); - }); + }, skip: isBrowser); testWidgets('autofocus sets cursor to the end of text', (WidgetTester tester) async { const String text = 'hello world'; @@ -599,7 +599,7 @@ void main() { expect(focusNode.hasFocus, true); expect(controller.selection.isCollapsed, true); expect(controller.selection.baseOffset, text.length); - }); + }, skip: isBrowser); testWidgets('Floating cursor is painted on iOS', (WidgetTester tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.iOS; @@ -687,7 +687,7 @@ void main() { editableTextState.updateFloatingCursor(RawFloatingCursorPoint(state: FloatingCursorDragState.End)); await tester.pumpAndSettle(); debugDefaultTargetPlatformOverride = null; - }); + }, skip: isBrowser); testWidgets('cursor layout iOS', (WidgetTester tester) async { final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 015795c489f..edd41b39c77 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -129,7 +129,7 @@ void main() { equals('TextInputType.text')); expect(tester.testTextInput.setClientArgs['inputAction'], equals('TextInputAction.done')); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "unspecified" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -161,7 +161,7 @@ void main() { action: TextInputAction.send, serializedActionName: 'TextInputAction.send', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "go" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -185,7 +185,7 @@ void main() { action: TextInputAction.send, serializedActionName: 'TextInputAction.send', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "next" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -193,7 +193,7 @@ void main() { action: TextInputAction.next, serializedActionName: 'TextInputAction.next', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "previous" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -201,7 +201,7 @@ void main() { action: TextInputAction.previous, serializedActionName: 'TextInputAction.previous', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "continue" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -209,7 +209,7 @@ void main() { action: TextInputAction.continueAction, serializedActionName: 'TextInputAction.continueAction', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "join" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -217,7 +217,7 @@ void main() { action: TextInputAction.join, serializedActionName: 'TextInputAction.join', ); - }); + }, skip: isBrowser); testWidgets('Keyboard is configured for "route" action when explicitly requested', (WidgetTester tester) async { await _desiredKeyboardActionIsRequested( @@ -1170,7 +1170,7 @@ void main() { expect(controller.selection.extentOffset, 9); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('can extend selection with a11y means - character', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -1271,7 +1271,7 @@ void main() { expect(controller.selection.extentOffset, 2); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('can extend selection with a11y means - word', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -1373,7 +1373,7 @@ void main() { expect(controller.selection.extentOffset, 9); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('password fields have correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -2046,7 +2046,7 @@ void main() { // at all. Again, both handles should be invisible. scrollable.controller.jumpTo(0); await verifyVisibility(HandlePositionInViewport.rightEdge, false, HandlePositionInViewport.rightEdge, false); - }); + }, skip: isBrowser); testWidgets('text selection handle visibility RTL', (WidgetTester tester) async { // Text with two separate words to select. @@ -2103,7 +2103,7 @@ void main() { expect(state.selectionOverlay.handlesAreVisible, isTrue); expect(controller.selection.base.offset, 0); expect(controller.selection.extent.offset, 5); - }); + }, skip: isBrowser); // Regression test for https://github.com/flutter/flutter/issues/31287 testWidgets('iOS text selection handle visibility', (WidgetTester tester) async { @@ -2273,7 +2273,7 @@ void main() { await verifyVisibility(HandlePositionInViewport.rightEdge, false, HandlePositionInViewport.rightEdge, false); debugDefaultTargetPlatformOverride = null; - }); + }, skip: isBrowser); } class MockTextSelectionControls extends Mock implements TextSelectionControls { diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index 0592624680e..ebf2db3e823 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +@TestOn('!chrome') // asset bundle behaves differently. import 'dart:async'; import 'dart:typed_data'; import 'dart:ui' as ui show Image, ImageByteFormat; diff --git a/packages/flutter/test/widgets/invert_colors_test.dart b/packages/flutter/test/widgets/invert_colors_test.dart index 2cd3e5451ad..100dbddd1ed 100644 --- a/packages/flutter/test/widgets/invert_colors_test.dart +++ b/packages/flutter/test/widgets/invert_colors_test.dart @@ -23,7 +23,7 @@ void main() { matchesGoldenFile('invert_colors_test.0.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('InvertColors and ColorFilter', (WidgetTester tester) async { await tester.pumpWidget(const RepaintBoundary( @@ -42,7 +42,7 @@ void main() { matchesGoldenFile('invert_colors_test.1.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); } // Draws a rectangle sized by the parent widget with [color], [colorFilter], diff --git a/packages/flutter/test/widgets/keep_alive_test.dart b/packages/flutter/test/widgets/keep_alive_test.dart index f74307a4609..2d22837c0ee 100644 --- a/packages/flutter/test/widgets/keep_alive_test.dart +++ b/packages/flutter/test/widgets/keep_alive_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +@TestOn('!chrome') // diagnostics use Platform.operatingSystem. import 'dart:io' show Platform; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index 432bb356871..0893e910389 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -212,7 +212,7 @@ void main() { await tester.pumpWidget(_StatefulListView((int i) => i % 3 == 0)); await checkAndScroll('0:true'); - }); + }, skip: isBrowser); testWidgets('ListView can build out of underflow', (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart index 162f5b7af46..db97008e7c7 100644 --- a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart +++ b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart @@ -538,7 +538,7 @@ void main() { matchesGoldenFile('list_wheel_scroll_view.center_child.magnified.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('Default middle transform', (WidgetTester tester) async { await tester.pumpWidget( @@ -593,7 +593,7 @@ void main() { matchesGoldenFile('list_wheel_scroll_view.curved_wheel.left.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('Scrolling, diameterRatio, perspective all changes matrix', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 200.0); diff --git a/packages/flutter/test/widgets/opacity_test.dart b/packages/flutter/test/widgets/opacity_test.dart index d02b278cb33..46cc50ee490 100644 --- a/packages/flutter/test/widgets/opacity_test.dart +++ b/packages/flutter/test/widgets/opacity_test.dart @@ -180,7 +180,7 @@ void main() { matchesGoldenFile('opacity_test.offset.1.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('empty opacity does not crash', (WidgetTester tester) async { await tester.pumpWidget( @@ -190,5 +190,5 @@ void main() { // The following line will send the layer to engine and cause crash if an // empty opacity layer is sent. await element.renderObject.layer.toImage(const Rect.fromLTRB(0.0, 0.0, 1.0, 1.0)); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/physical_model_test.dart b/packages/flutter/test/widgets/physical_model_test.dart index 433a044cffd..35c8837bc2a 100644 --- a/packages/flutter/test/widgets/physical_model_test.dart +++ b/packages/flutter/test/widgets/physical_model_test.dart @@ -113,7 +113,7 @@ void main() { matchesGoldenFile('physical_model_overflow.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); group('PhysicalModelLayer checks elevation', () { Future<void> _testStackChildren( @@ -278,7 +278,7 @@ void main() { await _testStackChildren(tester, children, expectedErrorCount: 0); expect(find.byType(Material), findsNWidgets(2)); - }); + }, skip: isBrowser); // Tests: // @@ -485,7 +485,7 @@ void main() { await _testStackChildren(tester, children, expectedErrorCount: 0); expect(find.byType(Material), findsNWidgets(2)); - }); + }, skip: isBrowser); // Tests: // diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index 31da4f615c6..9fae5a6058a 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -1,7 +1,7 @@ // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - +@TestOn('!chrome') import 'dart:async'; import 'dart:typed_data'; diff --git a/packages/flutter/test/widgets/scrollable_fling_test.dart b/packages/flutter/test/widgets/scrollable_fling_test.dart index fa99a489678..6e92cce8a11 100644 --- a/packages/flutter/test/widgets/scrollable_fling_test.dart +++ b/packages/flutter/test/widgets/scrollable_fling_test.dart @@ -83,7 +83,7 @@ void main() { await tester.tap(find.byType(Scrollable)); await tester.pump(const Duration(milliseconds: 50)); expect(log, equals(<String>['tap 21', 'tap 35'])); - }); + }, skip: isBrowser); testWidgets('fling and wait and tap', (WidgetTester tester) async { final List<String> log = <String>[]; @@ -110,5 +110,5 @@ void main() { await tester.tap(find.byType(Scrollable)); await tester.pump(const Duration(milliseconds: 50)); expect(log, equals(<String>['tap 21', 'tap 48'])); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/scrollable_of_test.dart b/packages/flutter/test/widgets/scrollable_of_test.dart index 013b3a41501..ed69e09ebb0 100644 --- a/packages/flutter/test/widgets/scrollable_of_test.dart +++ b/packages/flutter/test/widgets/scrollable_of_test.dart @@ -24,7 +24,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> { _position?.removeListener(listener); _position = Scrollable.of(context)?.position; _position?.addListener(listener); - widget.log('didChangeDependencies ${_position?.pixels}'); + widget.log('didChangeDependencies ${_position?.pixels?.toStringAsFixed(1)}'); } @override @@ -37,7 +37,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> { Widget build(BuildContext context) => widget.child; void listener() { - widget.log('listener ${_position?.pixels}'); + widget.log('listener ${_position?.pixels?.toStringAsFixed(1)}'); } } diff --git a/packages/flutter/test/widgets/scrollable_semantics_test.dart b/packages/flutter/test/widgets/scrollable_semantics_test.dart index 253d7c76500..0f28aa987c5 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_test.dart @@ -259,7 +259,7 @@ void main() { )); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('correct scrollProgress for unbound', (WidgetTester tester) async { semantics = SemanticsTester(tester); diff --git a/packages/flutter/test/widgets/semantics_clipping_test.dart b/packages/flutter/test/widgets/semantics_clipping_test.dart index 48201557839..7611a7dcced 100644 --- a/packages/flutter/test/widgets/semantics_clipping_test.dart +++ b/packages/flutter/test/widgets/semantics_clipping_test.dart @@ -63,7 +63,7 @@ void main() { )); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -124,5 +124,5 @@ void main() { )); semantics.dispose(); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart index e19af5e51d5..723930ae0fb 100644 --- a/packages/flutter/test/widgets/semantics_test.dart +++ b/packages/flutter/test/widgets/semantics_test.dart @@ -536,7 +536,7 @@ void main() { expect(semantics, hasSemantics(expectedSemantics, ignoreId: true)); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('Actions can be replaced without triggering semantics update', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); diff --git a/packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart b/packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart index d4b79e37188..f4126f770a7 100644 --- a/packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart +++ b/packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +@TestOn('!chrome') import 'dart:async'; import 'dart:io'; diff --git a/packages/flutter/test/widgets/shader_mask_test.dart b/packages/flutter/test/widgets/shader_mask_test.dart index 1a1809af33a..10578b36de9 100644 --- a/packages/flutter/test/widgets/shader_mask_test.dart +++ b/packages/flutter/test/widgets/shader_mask_test.dart @@ -21,7 +21,7 @@ void main() { testWidgets('Can be constructed', (WidgetTester tester) async { final Widget child = Container(width: 100.0, height: 100.0); await tester.pumpWidget(ShaderMask(child: child, shaderCallback: createShader)); - }); + }, skip: isBrowser); testWidgets('Bounds rect includes offset', (WidgetTester tester) async { Rect shaderBounds; @@ -45,5 +45,5 @@ void main() { // The shader bounds rectangle should reflect the position of the centered SizedBox. expect(shaderBounds, equals(const Rect.fromLTWH(200.0, 100.0, 400.0, 400.0))); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/shadow_test.dart b/packages/flutter/test/widgets/shadow_test.dart index adcecd2e698..4ff401f8e56 100644 --- a/packages/flutter/test/widgets/shadow_test.dart +++ b/packages/flutter/test/widgets/shadow_test.dart @@ -34,7 +34,7 @@ void main() { skip: !isLinux ); // shadows render differently on different platforms debugDisableShadows = true; - }); + }, skip: isBrowser); testWidgets('Shadows on ShapeDecoration', (WidgetTester tester) async { debugDisableShadows = false; @@ -95,7 +95,7 @@ void main() { skip: !isLinux, ); // shadows render differently on different platforms debugDisableShadows = true; - }); + }, skip: isBrowser); testWidgets('Shadows with PhysicalShape', (WidgetTester tester) async { debugDisableShadows = false; diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart index 0ef27a9668e..2496bc08b9d 100644 --- a/packages/flutter/test/widgets/shape_decoration_test.dart +++ b/packages/flutter/test/widgets/shape_decoration_test.dart @@ -59,7 +59,7 @@ Future<void> main() async { ..rect(color: Colors.black) ..rect(color: Colors.white), ); - }); + }, skip: isBrowser); testWidgets('TestBorder and Directionality - 1', (WidgetTester tester) async { final List<String> log = <String>[]; diff --git a/packages/flutter/test/widgets/simple_semantics_test.dart b/packages/flutter/test/widgets/simple_semantics_test.dart index 4104ceee5bd..ba2a32ddc51 100644 --- a/packages/flutter/test/widgets/simple_semantics_test.dart +++ b/packages/flutter/test/widgets/simple_semantics_test.dart @@ -34,7 +34,7 @@ void main() { ))); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('Simple tree is simple - material', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -78,5 +78,5 @@ void main() { ))); semantics.dispose(); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart index f6ac603c32f..84e2e265c5f 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart @@ -66,7 +66,7 @@ void main() { // initial position of E was 200 + 56 + cSize.height + cSize.height + 500 // we've scrolled that up by 600.0, meaning it's at that minus 600 now: expect(tester.getTopLeft(find.text('E')), Offset(0.0, 200.0 + 56.0 + cSize.height * 2.0 + 500.0 - 600.0)); - }); + }, skip: isBrowser); testWidgets('Does not crash when there is less than minExtent remainingPaintExtent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/21887. diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart index 269263bd8bb..55f039a86c1 100644 --- a/packages/flutter/test/widgets/text_test.dart +++ b/packages/flutter/test/widgets/text_test.dart @@ -55,7 +55,7 @@ void main() { final Size largeSize = tester.getSize(find.byType(RichText)); expect(largeSize.width, 105.0); expect(largeSize.height, equals(21.0)); - }); + }, skip: isBrowser); testWidgets('Text respects textScaleFactor with explicit font size', (WidgetTester tester) async { await tester.pumpWidget(const Center( @@ -83,7 +83,7 @@ void main() { final Size largeSize = tester.getSize(find.byType(RichText)); expect(largeSize.width, anyOf(131.0, 130.0)); expect(largeSize.height, equals(26.0)); - }); + }, skip: isBrowser); testWidgets('Text throws a nice error message if there\'s no Directionality', (WidgetTester tester) async { await tester.pumpWidget(const Text('Hello')); @@ -227,7 +227,7 @@ void main() { ); expect(semantics, hasSemantics(expectedSemantics, ignoreTransform: true, ignoreId: true, ignoreRect: true)); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('recognizers split semantic node - bidi', (WidgetTester tester) async { @@ -356,7 +356,7 @@ void main() { ); expect(semantics, hasSemantics(expectedSemantics, ignoreTransform: true, ignoreId: true, ignoreRect: true)); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('inline widgets semantic nodes scale', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -427,7 +427,7 @@ void main() { ); expect(semantics, hasSemantics(expectedSemantics, ignoreTransform: true, ignoreId: true,)); semantics.dispose(); - }); + }, skip: isBrowser); testWidgets('Overflow is clipping correctly - short text with overflow: clip', (WidgetTester tester) async { await _pumpTextWidget( @@ -447,7 +447,7 @@ void main() { ); expect(find.byType(Text), paints..clipRect(rect: const Rect.fromLTWH(0, 0, 50, 50))); - }); + }, skip: isBrowser); testWidgets('Overflow is clipping correctly - short text with overflow: ellipsis', (WidgetTester tester) async { await _pumpTextWidget( @@ -534,7 +534,7 @@ void main() { final Size textSizeLongestLine = tester.getSize(find.byType(Text)); expect(textSizeLongestLine.width, equals(630.0)); expect(textSizeLongestLine.height, equals(fontHeight * 2)); - }); + }, skip: isBrowser); } Future<void> _pumpTextWidget({ WidgetTester tester, String text, TextOverflow overflow }) { diff --git a/packages/flutter/test/widgets/transformed_scrollable_test.dart b/packages/flutter/test/widgets/transformed_scrollable_test.dart index 0fae7015925..e983e73f6c1 100644 --- a/packages/flutter/test/widgets/transformed_scrollable_test.dart +++ b/packages/flutter/test/widgets/transformed_scrollable_test.dart @@ -214,5 +214,5 @@ void main() { // coordinate space of the screen, the scroll view actually moved far more // pixels in its local coordinate system due to the perspective transform. expect(controller.offset, greaterThan(100)); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart index ad586a72111..3317510f1da 100644 --- a/packages/flutter/test/widgets/visibility_test.dart +++ b/packages/flutter/test/widgets/visibility_test.dart @@ -309,5 +309,5 @@ void main() { log.clear(); semantics.dispose(); - }); + }, skip: isBrowser); } diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart index 8db54de1654..fbd8f2bbf77 100644 --- a/packages/flutter/test/widgets/widget_inspector_test.dart +++ b/packages/flutter/test/widgets/widget_inspector_test.dart @@ -930,7 +930,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService { expect(json.decode(service.getSelectedWidget(null, 'my-group')), contains('createdByLocalProject')); service.setSelection(richText, 'my-group'); expect(json.decode(service.getSelectedWidget(null, 'my-group')), contains('createdByLocalProject')); - }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // Test requires --track-widget-creation flag. + }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked() || isBrowser); // Test requires --track-widget-creation flag. test('ext.flutter.inspector.disposeGroup', () async { final Object a = Object(); @@ -1490,7 +1490,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService { expect(await service.testExtension('getSelectedWidget', <String, String>{'objectGroup': 'my-group'}), contains('createdByLocalProject')); service.setSelection(richText, 'my-group'); expect(await service.testExtension('getSelectedWidget', <String, String>{'objectGroup': 'my-group'}), contains('createdByLocalProject')); - }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // Test requires --track-widget-creation flag. + }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked() || isBrowser); // Test requires --track-widget-creation flag. testWidgets('ext.flutter.inspector.trackRebuildDirtyWidgets', (WidgetTester tester) async { service.rebuildCount = 0; @@ -2152,7 +2152,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService { matchesGoldenFile('inspector.sizedBox_debugPaint_margin.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('Screenshot of composited transforms - only offsets', (WidgetTester tester) async { // Composited transforms are challenging to take screenshots of as the @@ -2250,7 +2250,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService { matchesGoldenFile('inspector.composited_transform.only_offsets_target.png'), skip: !isLinux, ); - }); + }, skip: isBrowser); testWidgets('Screenshot composited transforms - with rotations', (WidgetTester tester) async { final LayerLink link = LayerLink(); @@ -2360,7 +2360,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService { expect(identical(key2.currentContext.findRenderObject(), box2), isTrue); expect(box1.localToGlobal(Offset.zero), equals(position1)); expect(box2.localToGlobal(Offset.zero), equals(position2)); - }); + }, skip: isBrowser); } } diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart index 1bb2a208bff..74cafc51f1c 100644 --- a/packages/flutter/test/widgets/wrap_test.dart +++ b/packages/flutter/test/widgets/wrap_test.dart @@ -827,7 +827,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0)); expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size, within<Size>(from: const Size(100.0, 200.0), distance: 0.001)); - }); + }, skip: isBrowser); testWidgets('Spacing with slight overflow', (WidgetTester tester) async { await tester.pumpWidget(Wrap(