Unverified Commit 9d724d4c authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Compatibility pass on flutter/widgets tests for JavaScript compilation. (8) (#33377)

parent d9c19629
......@@ -348,6 +348,7 @@ Future<void> _runWebTests() async {
'test/services/',
'test/painting/',
'test/scheduler/',
'test/widgets/',
'test/semantics/',
]);
}
......
......@@ -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),
......
......@@ -286,6 +286,6 @@ void main() {
expect(description[0], equalsIgnoringHashCodes('dispatcher: ActionDispatcher#00000'));
expect(description[1], equals('actions: {[<\'bar\'>]: Closure: () => TestAction}'));
});
}, skip: isBrowser);
});
}
......@@ -55,6 +55,6 @@ void main() {
await tester.pump();
expect(tester.widget<Title>(find.byType(Title)).title, 'en_US');
expect(tester.widget<Title>(find.byType(Title)).color, kTitleColor);
});
}, skip: isBrowser);
}
......@@ -46,5 +46,5 @@ void main() {
matchesGoldenFile('backdrop_filter_test.cull_rect.1.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
}
......@@ -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;
......
......@@ -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', () {
......
......@@ -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>[];
......
......@@ -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 {
......
......@@ -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;
});
......
......@@ -2085,8 +2085,7 @@ void main() {
],
), ignoreTransform: true, ignoreRect: true));
semantics.dispose();
});
}, skip: isBrowser);
}
Future<void> _testLongPressDraggableHapticFeedback({ WidgetTester tester, bool hapticFeedbackOnStart, int expectedHapticFeedbackCount }) async {
......
......@@ -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>();
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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],
......
......@@ -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';
......
......@@ -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(
......
......@@ -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);
......
......@@ -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);
}
......@@ -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:
//
......
// 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';
......
......@@ -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);
}
......@@ -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)}');
}
}
......
......@@ -259,7 +259,7 @@ void main() {
));
semantics.dispose();
});
}, skip: isBrowser);
testWidgets('correct scrollProgress for unbound', (WidgetTester tester) async {
semantics = SemanticsTester(tester);
......
......@@ -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);
}
......@@ -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);
......
......@@ -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';
......
......@@ -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);
}
......@@ -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;
......
......@@ -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>[];
......
......@@ -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);
}
......@@ -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.
......
......@@ -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 }) {
......
......@@ -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);
}
......@@ -309,5 +309,5 @@ void main() {
log.clear();
semantics.dispose();
});
}, skip: isBrowser);
}
......@@ -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);
}
}
......
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment