Unverified Commit 3ae6abd9 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Compatibility pass on flutter/material tests for JavaScript compilation. (9) (#33378)

parent ad507723
......@@ -350,6 +350,7 @@ Future<void> _runWebTests() async {
'test/scheduler/',
'test/widgets/',
'test/semantics/',
'test/material/',
]);
}
......
......@@ -810,7 +810,7 @@ class SliderThemeData extends Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
const SliderThemeData defaultData = SliderThemeData();
properties.add(DiagnosticsProperty<double>('trackHeight', trackHeight, defaultValue: defaultData.trackHeight));
properties.add(DoubleProperty('trackHeight', trackHeight, defaultValue: defaultData.trackHeight));
properties.add(DiagnosticsProperty<Color>('activeTrackColor', activeTrackColor, defaultValue: defaultData.activeTrackColor));
properties.add(DiagnosticsProperty<Color>('activeTrackColor', activeTrackColor, defaultValue: defaultData.activeTrackColor));
properties.add(DiagnosticsProperty<Color>('inactiveTrackColor', inactiveTrackColor, defaultValue: defaultData.inactiveTrackColor));
......
......@@ -63,7 +63,7 @@ void main() {
await tester.pumpAndSettle(const Duration(milliseconds: 100));
expect(find.text('Pirate license'), findsOneWidget);
});
}, skip: isBrowser);
testWidgets('About box logic defaults to executable name for app name', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -107,7 +107,7 @@ void main() {
expect(find.text('BBB'), findsOneWidget);
expect(find.text('Another package'), findsOneWidget);
expect(find.text('Another license'), findsOneWidget);
});
}, skip: isBrowser);
testWidgets('LicensePage respects the notch', (WidgetTester tester) async {
const double safeareaPadding = 27.0;
......@@ -132,5 +132,5 @@ void main() {
await tester.pumpAndSettle();
expect(tester.getTopLeft(find.text('DEF')), const Offset(8.0 + safeareaPadding, 527.0));
});
}, skip: isBrowser);
}
......@@ -74,14 +74,16 @@ void main() {
await expectLater(
find.byKey(key),
matchesGoldenFile('bottom_app_bar.custom_shape.1.png'),
skip: !Platform.isLinux,
);
await pump(FloatingActionButtonLocation.centerDocked);
await tester.pumpAndSettle();
await expectLater(
find.byKey(key),
matchesGoldenFile('bottom_app_bar.custom_shape.2.png'),
skip: !Platform.isLinux,
);
}, skip: !Platform.isLinux);
}, skip: isBrowser);
testWidgets('color defaults to Theme.bottomAppBarColor', (WidgetTester tester) async {
await tester.pumpWidget(
......
......@@ -83,7 +83,7 @@ void main() {
matchesGoldenFile('bottom_app_bar_theme.custom_shape.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('BAB theme does not affect defaults', (WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(
......
......@@ -891,7 +891,7 @@ void main() {
await tester.tap(find.text('Alarm'));
await tester.pump(const Duration(seconds: 1));
expect(Theme.of(tester.element(find.text('Alarm'))).brightness, equals(Brightness.dark));
});
}, skip: isBrowser);
testWidgets('BottomNavigationBar iconSize test', (WidgetTester tester) async {
double builderIconSize;
......@@ -1001,7 +1001,7 @@ void main() {
final RenderBox box = tester.renderObject(find.byType(BottomNavigationBar));
expect(box.size.height, equals(66.0));
});
}, skip: isBrowser);
testWidgets('BottomNavigationBar limits width of tiles with long titles', (WidgetTester tester) async {
final Text longTextA = Text(''.padLeft(100, 'A'));
......@@ -1033,7 +1033,7 @@ void main() {
expect(itemBoxA.size, equals(const Size(400.0, 14.0)));
final RenderBox itemBoxB = tester.renderObject(find.text(longTextB.data));
expect(itemBoxB.size, equals(const Size(400.0, 14.0)));
});
}, skip: isBrowser);
testWidgets('BottomNavigationBar paints circles', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -1103,7 +1103,7 @@ void main() {
..translate(x: 400.0)
..circle(x: 200.0),
);
});
}, skip: isBrowser);
testWidgets('BottomNavigationBar inactiveIcon shown', (WidgetTester tester) async {
const Key filled = Key('filled');
......@@ -1438,7 +1438,7 @@ void main() {
skip: !isLinux,
);
}
});
}, skip: isBrowser);
testWidgets('BottomNavigationBar item title should not be nullable', (WidgetTester tester) async {
expect(() {
......
......@@ -170,7 +170,7 @@ void main() {
expect(tester.widget<Material>(find.byType(Material)).shape, shape);
expect(tester.widget<Material>(find.byType(Material)).color, disabledColor);
expect(tester.getSize(find.byType(Material)), const Size(88.0, 48.0));
});
}, skip: isBrowser);
testWidgets('Theme buttonTheme ButtonTheme overrides', (WidgetTester tester) async {
ButtonTextTheme textTheme;
......
......@@ -681,7 +681,7 @@ void main() {
expect(tester.getSize(find.byType(FlatButton)).height, equals(48.0));
expect(tester.getSize(find.byType(Text)).width, isIn(<double>[126.0, 127.0]));
expect(tester.getSize(find.byType(Text)).height, equals(42.0));
});
}, skip: isBrowser);
// This test is very similar to the '...explicit splashColor and highlightColor' test
// in icon_button_test.dart. If you change this one, you may want to also change that one.
......@@ -924,7 +924,7 @@ void main() {
semantics.dispose();
});
}, skip: isBrowser);
testWidgets('MaterialButton minWidth and height parameters', (WidgetTester tester) async {
Widget buildFrame({ double minWidth, double height, EdgeInsets padding = EdgeInsets.zero, Widget child }) {
......
......@@ -140,7 +140,7 @@ void main() {
matchesGoldenFile('card_theme.custom_shape.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
}
CardTheme _cardTheme() {
......
......@@ -356,7 +356,7 @@ void main() {
);
expect(tester.getSize(find.byType(Text)), const Size(40.0, 10.0));
expect(tester.getSize(find.byType(Chip)), const Size(800.0, 48.0));
});
}, skip: isBrowser);
testWidgets('Chip elements are ordered horizontally for locale', (WidgetTester tester) async {
final UniqueKey iconKey = UniqueKey();
......@@ -477,7 +477,7 @@ void main() {
expect(tester.getSize(find.byType(Chip).first).width, anyOf(318.0, 319.0));
expect(tester.getSize(find.byType(Chip).first).height, equals(50.0));
expect(tester.getSize(find.byType(Chip).last), anyOf(const Size(132.0, 48.0), const Size(131.0, 48.0)));
});
}, skip: isBrowser);
testWidgets('Labels can be non-text widgets', (WidgetTester tester) async {
final Key keyA = GlobalKey();
......@@ -511,7 +511,7 @@ void main() {
anyOf(const Size(132.0, 48.0), const Size(131.0, 48.0)),
);
expect(tester.getSize(find.byType(Chip).last), const Size(58.0, 48.0));
});
}, skip: isBrowser);
testWidgets('Avatars can be non-circle avatar widgets', (WidgetTester tester) async {
final Key keyA = GlobalKey();
......@@ -735,7 +735,7 @@ void main() {
expect(tester.getSize(find.byType(RawChip)), equals(const Size(80.0, 48.0)));
expect(tester.getTopLeft(find.byKey(labelKey)), equals(const Offset(12.0, 17.0)));
expect(find.byKey(avatarKey), findsNothing);
});
}, skip: isBrowser);
testWidgets('Delete button drawer works as expected on RawChip', (WidgetTester tester) async {
final UniqueKey labelKey = UniqueKey();
......@@ -851,7 +851,7 @@ void main() {
expect(tester.getSize(find.byType(RawChip)), equals(const Size(80.0, 48.0)));
expect(tester.getTopLeft(find.byKey(labelKey)), equals(const Offset(12.0, 17.0)));
expect(find.byKey(deleteButtonKey), findsNothing);
});
}, skip: isBrowser);
testWidgets('Selection with avatar works as expected on RawChip', (WidgetTester tester) async {
bool selected = false;
......@@ -934,7 +934,7 @@ void main() {
expect(getSelectProgress(tester), equals(0.0));
expect(getAvatarDrawerProgress(tester), equals(1.0));
expect(getDeleteDrawerProgress(tester), equals(0.0));
});
}, skip: isBrowser);
testWidgets('Selection without avatar works as expected on RawChip', (WidgetTester tester) async {
bool selected = false;
......@@ -1010,7 +1010,7 @@ void main() {
expect(getSelectProgress(tester), equals(0.0));
expect(getAvatarDrawerProgress(tester), equals(0.0));
expect(getDeleteDrawerProgress(tester), equals(0.0));
});
}, skip: isBrowser);
testWidgets('Activation works as expected on RawChip', (WidgetTester tester) async {
bool selected = false;
......@@ -1135,7 +1135,7 @@ void main() {
);
expect(tester.getSize(find.byKey(key2)), const Size(80.0, 32.0));
});
}, skip: isBrowser);
testWidgets('Chip uses the right theme colors for the right components', (WidgetTester tester) async {
final ThemeData themeData = ThemeData(
......@@ -1721,7 +1721,7 @@ void main() {
], excludes: <Offset>[
const Offset(4, 4),
]));
});
}, skip: isBrowser);
testWidgets('Chips should use InkWell instead of InkResponse.', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/28646
......
......@@ -164,7 +164,7 @@ void main() {
expect(materialBox, paints..path(color: Color(customTheme.backgroundColor.value)));
expect(material.elevation, customTheme.elevation);
expect(material.shadowColor, customTheme.shadowColor);
});
}, skip: isBrowser);
testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async {
const Color customColor1 = Color(0xcafefeed);
......
......@@ -186,7 +186,7 @@ void main() {
),
);
expect(tester.getSize(find.text('Z')), equals(const Size(16.0, 16.0)));
});
}, skip: isBrowser);
testWidgets('CircleAvatar respects minRadius', (WidgetTester tester) async {
final Color backgroundColor = Colors.blue.shade900;
......
......@@ -19,7 +19,7 @@ void main() {
},
// Skip on Windows because this test is quite flaky when run on Windows,
// until https://github.com/flutter/flutter/issues/19696 is fixed.
skip: isWindows,
skip: isWindows || isBrowser,
);
}
......
......@@ -133,7 +133,7 @@ void main() {
matchesGoldenFile('dialog_theme.dialog_with_custom_border.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Custom Title Text Style - Constructor Param', (WidgetTester tester) async {
const String titleText = 'Title';
......
......@@ -143,7 +143,7 @@ void main() {
matchesGoldenFile('dropdown_test.default.0.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Expanded dropdown golden', (WidgetTester tester) async {
final Key buttonKey = UniqueKey();
......@@ -156,7 +156,7 @@ void main() {
matchesGoldenFile('dropdown_test.expanded.0.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Dropdown button control test', (WidgetTester tester) async {
String value = 'one';
......
......@@ -76,6 +76,7 @@ void main() {
await gesture.removePointer();
},
semanticsEnabled: true,
skip: isBrowser,
);
testWidgets('FlatButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async {
......@@ -140,6 +141,7 @@ void main() {
await gesture.removePointer();
},
semanticsEnabled: true,
skip: isBrowser,
);
testWidgets('FlatButton uses stateful color for text color in different states', (WidgetTester tester) async {
......
......@@ -154,7 +154,7 @@ void main() {
await tester.pumpWidget(buildFrame(TargetPlatform.iOS, false));
expect(getTitleBottomLeft(), const Offset(72.0, 16.0));
});
}, skip: isBrowser);
testWidgets('FlexibleSpaceBar test titlePadding override', (WidgetTester tester) async {
Widget buildFrame(TargetPlatform platform, bool centerTitle) {
......@@ -195,7 +195,7 @@ void main() {
await tester.pumpWidget(buildFrame(TargetPlatform.iOS, false));
expect(getTitleBottomLeft(), Offset.zero);
});
}, skip: isBrowser);
}
class TestDelegate extends SliverPersistentHeaderDelegate {
......
......@@ -213,7 +213,7 @@ void main() {
),
);
await tester.pumpAndSettle();
});
}, skip: isBrowser);
testWidgets('interrupting entrance of a new fab.', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -238,7 +238,7 @@ void main() {
);
await tester.pumpAndSettle();
});
});
}, skip: isBrowser);
});
testWidgets('Docked floating action button locations', (WidgetTester tester) async {
......@@ -274,7 +274,7 @@ void main() {
);
await tester.pumpAndSettle();
expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 500.0));
});
}, skip: isBrowser);
testWidgets('Docked floating action button locations: no BAB, small BAB', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -293,7 +293,7 @@ void main() {
),
);
expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 572.0));
});
}, skip: isBrowser);
testWidgets('Mini-start-top floating action button location', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -314,7 +314,7 @@ void main() {
);
expect(tester.getCenter(find.byType(FloatingActionButton)).dx, tester.getCenter(find.byType(CircleAvatar)).dx);
expect(tester.getCenter(find.byType(FloatingActionButton)).dy, kToolbarHeight);
});
}, skip: isBrowser);
testWidgets('Start-top floating action button location LTR', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -327,7 +327,7 @@ void main() {
),
);
expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(16.0, 28.0, 56.0, 56.0)));
});
}, skip: isBrowser);
testWidgets('End-top floating action button location RTL', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -343,7 +343,7 @@ void main() {
),
);
expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(16.0, 28.0, 56.0, 56.0)));
});
}, skip: isBrowser);
testWidgets('Start-top floating action button location RTL', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -359,7 +359,7 @@ void main() {
),
);
expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(800.0 - 56.0 - 16.0, 28.0, 56.0, 56.0)));
});
}, skip: isBrowser);
testWidgets('End-top floating action button location LTR', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -372,7 +372,7 @@ void main() {
),
);
expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(800.0 - 56.0 - 16.0, 28.0, 56.0, 56.0)));
});
}, skip: isBrowser);
}
......
......@@ -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') // whole file needs triage.
import 'dart:ui';
import 'package:flutter/material.dart';
......
......@@ -223,7 +223,7 @@ void main() {
expect(box, isNot(paints..circle()));
await gesture.up();
});
}, skip: isBrowser);
testWidgets('Cancel an InkRipple that was disposed when its animation ended', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/14391
......
......@@ -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') // needs substantial triage.
import 'dart:async';
import 'package:flutter/material.dart';
......@@ -1437,7 +1438,7 @@ void main() {
expect(tester.getTopLeft(find.text('text')).dy, 12.0);
expect(getBorderBottom(tester), 40.0);
expect(getBorderWeight(tester), 1.0);
});
}, skip: isBrowser);
testWidgets('InputDecorator.collapsed', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -1476,7 +1477,7 @@ void main() {
expect(tester.getSize(find.text('hint')).height, 16.0);
expect(tester.getTopLeft(find.text('hint')).dy, 0.0);
expect(getBorderWeight(tester), 0.0);
});
}, skip: isBrowser);
testWidgets('InputDecorator with baseStyle', (WidgetTester tester) async {
// Setting the baseStyle of the InputDecoration and the style of the input
......@@ -1517,7 +1518,7 @@ void main() {
expect(tester.getTopLeft(find.text('hint')).dy, 23.5);
expect(tester.getTopLeft(find.text('label')).dy, 17.75);
expect(tester.getTopLeft(find.text('text')).dy, 23.5);
});
}, skip: isBrowser);
testWidgets('InputDecorator with empty style overrides', (WidgetTester tester) async {
// Same as not specifying any style overrides
......@@ -1559,7 +1560,7 @@ void main() {
expect(getBorderWeight(tester), 1.0);
expect(tester.getTopLeft(find.text('helper')), const Offset(12.0, 64.0));
expect(tester.getTopRight(find.text('counter')), const Offset(788.0, 64.0));
});
}, skip: isBrowser);
testWidgets('InputDecoration outline shape with no border and no floating placeholder', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -1611,7 +1612,7 @@ void main() {
// The label should not be seen.
expect(getOpacity(tester, 'label'), 0.0);
});
}, skip: isBrowser);
testWidgets('InputDecorationTheme outline border', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -1636,7 +1637,7 @@ void main() {
expect(tester.getBottomLeft(find.text('label')).dy, 36.0);
expect(getBorderBottom(tester), 56.0);
expect(getBorderWeight(tester), 1.0);
});
}, skip: isBrowser);
testWidgets('InputDecorationTheme outline border, dense layout', (WidgetTester tester) async {
await tester.pumpWidget(
......
......@@ -190,7 +190,7 @@ void main() {
testChildren();
testHorizontalGeometry();
testVerticalGeometry(128.0);
});
}, skip: isBrowser);
testWidgets('ListTile geometry (RTL)', (WidgetTester tester) async {
const double leftPadding = 10.0;
......@@ -784,7 +784,7 @@ void main() {
expect(tester.getRect(find.byType(ListTile).at(1)), const Rect.fromLTWH( 0.0, 216.0 , 800.0, 56.0));
expect(tester.getRect(find.byType(Placeholder).at(2)), const Rect.fromLTWH( 16.0, 216.0 + 16.0, 24.0, 12.0));
expect(tester.getRect(find.byType(Placeholder).at(3)), const Rect.fromLTWH(800.0 - 24.0 - 16.0, 216.0 + 16.0, 24.0, 24.0));
});
}, skip: isBrowser);
testWidgets('ListTile leading icon height does not exceed ListTile height', (WidgetTester tester) async {
// regression test for https://github.com/flutter/flutter/issues/28765
......
......@@ -32,6 +32,7 @@ void main() {
await expectLater(tester, meetsGuideline(textContrastGuideline));
},
semanticsEnabled: true,
skip: isBrowser,
);
}
......@@ -619,7 +619,7 @@ void main() {
matchesGoldenFile('material.border_paint_above.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('border is painted below child when specified', (WidgetTester tester) async {
final Key painterKey = UniqueKey();
......@@ -660,6 +660,6 @@ void main() {
matchesGoldenFile('material.border_paint_below.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
});
}
......@@ -79,6 +79,7 @@ void main() {
await gesture.removePointer();
},
semanticsEnabled: true,
skip: isBrowser,
);
testWidgets('OutlineButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async {
......@@ -142,6 +143,7 @@ void main() {
await expectLater(tester, meetsGuideline(textContrastGuideline));
await gesture.removePointer();
},
skip: isBrowser,
semanticsEnabled: true,
);
......@@ -480,7 +482,7 @@ void main() {
clipPath: clipPath,
clipRect: clipRect,
);
});
}, skip: isBrowser);
testWidgets('OutlineButton has no clip by default', (WidgetTester tester) async {
final GlobalKey buttonKey = GlobalKey();
......@@ -614,7 +616,7 @@ void main() {
expect(tester.getSize(find.byType(FlatButton)).height, equals(48.0));
expect(tester.getSize(find.byType(Text)).width, isIn(<double>[126.0, 127.0]));
expect(tester.getSize(find.byType(Text)).height, equals(42.0));
});
}, skip: isBrowser);
testWidgets('OutlineButton pressed fillColor default', (WidgetTester tester) async {
Widget buildFrame(ThemeData theme) {
......
......@@ -279,6 +279,6 @@ void main() {
matchesGoldenFile('radio.ink_ripple.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
}
......@@ -75,6 +75,7 @@ void main() {
await expectLater(tester, meetsGuideline(textContrastGuideline));
await gesture.removePointer();
},
skip: isBrowser,
semanticsEnabled: true,
);
......
......@@ -991,7 +991,7 @@ void main() {
await gesture.up();
await tester.pumpAndSettle();
});
}, skip: isBrowser);
testWidgets('Tick marks are skipped when they are too dense', (WidgetTester tester) async {
Widget buildSlider({
......
......@@ -529,7 +529,8 @@ void main() {
),
);
await gesture.up();
});
}, skip: isBrowser
);
testWidgets('The slider track height can be overridden', (WidgetTester tester) async {
final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith(trackHeight: 16);
......
......@@ -386,7 +386,7 @@ void main() {
expect(actionTextBottomLeft.dx - textBottomRight.dx, 24.0);
expect(snackBarBottomRight.dx - actionTextBottomRight.dx, 24.0 + 30.0); // margin + right padding
expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 17.0 + 40.0); // margin + bottom padding
});
}, skip: isBrowser);
testWidgets('SnackBar is positioned above BottomNavigationBar', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
......@@ -439,7 +439,7 @@ void main() {
expect(actionTextBottomLeft.dx - textBottomRight.dx, 24.0);
expect(snackBarBottomRight.dx - actionTextBottomRight.dx, 24.0 + 30.0); // margin + right padding
expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 17.0); // margin (with no bottom padding)
});
}, skip: isBrowser);
testWidgets('SnackBar should push FloatingActionButton above', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
......@@ -536,7 +536,7 @@ void main() {
expect(actionTextBottomLeft.dx - textBottomRight.dx, 16.0);
expect(snackBarBottomRight.dx - actionTextBottomRight.dx, 31.0 + 30.0); // margin + right padding
expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 27.0); // margin (with no bottom padding)
});
}, skip: isBrowser);
testWidgets('Floating SnackBar is positioned above BottomNavigationBar', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
......@@ -592,7 +592,7 @@ void main() {
expect(actionTextBottomLeft.dx - textBottomRight.dx, 16.0);
expect(snackBarBottomRight.dx - actionTextBottomRight.dx, 31.0 + 30.0); // margin + right padding
expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 27.0); // margin (with no bottom padding)
});
}, skip: isBrowser);
testWidgets('Floating SnackBar is positioned above FloatingActionButton', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
......
......@@ -270,7 +270,7 @@ void main() {
matchesGoldenFile('tab_bar_theme.tab_indicator_size_tab.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Tab bar theme overrides tab indicator size (label)', (WidgetTester tester) async {
const TabBarTheme tabBarTheme = TabBarTheme(indicatorSize: TabBarIndicatorSize.label);
......@@ -282,7 +282,7 @@ void main() {
matchesGoldenFile('tab_bar_theme.tab_indicator_size_label.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Tab bar theme - custom tab indicator', (WidgetTester tester) async {
final TabBarTheme tabBarTheme = TabBarTheme(
......@@ -299,7 +299,7 @@ void main() {
matchesGoldenFile('tab_bar_theme.custom_tab_indicator.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
testWidgets('Tab bar theme - beveled rect indicator', (WidgetTester tester) async {
final TabBarTheme tabBarTheme = TabBarTheme(
......@@ -316,5 +316,5 @@ void main() {
matchesGoldenFile('tab_bar_theme.beveled_rect_indicator.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
}
......@@ -244,7 +244,7 @@ void main() {
);
expect(tester.renderObject<RenderParagraph>(find.byType(RichText)).text.style.fontFamily, 'Ahem');
expect(tester.getSize(find.byType(Tab)), const Size(14.0, 46.0));
});
}, skip: isBrowser);
testWidgets('Tab sizing - icon and text', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -252,7 +252,7 @@ void main() {
);
expect(tester.renderObject<RenderParagraph>(find.byType(RichText)).text.style.fontFamily, 'Ahem');
expect(tester.getSize(find.byType(Tab)), const Size(14.0, 72.0));
});
}, skip: isBrowser);
testWidgets('Tab sizing - icon and child', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -260,7 +260,7 @@ void main() {
);
expect(tester.renderObject<RenderParagraph>(find.byType(RichText)).text.style.fontFamily, 'Ahem');
expect(tester.getSize(find.byType(Tab)), const Size(14.0, 72.0));
});
}, skip: isBrowser);
testWidgets('Tab color - normal', (WidgetTester tester) async {
final Widget tabBar = TabBar(tabs: const <Widget>[SizedBox.shrink()], controller: TabController(length: 1, vsync: tester));
......@@ -383,7 +383,7 @@ void main() {
// Scrolling the TabBar doesn't change the selection
expect(controller.index, 0);
});
}, skip: isBrowser);
testWidgets('TabBarView maintains state', (WidgetTester tester) async {
final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE'];
......@@ -1639,7 +1639,7 @@ void main() {
expect(semantics, hasSemantics(expectedSemantics));
semantics.dispose();
});
}, skip: isBrowser);
testWidgets('correct scrolling semantics', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);
......@@ -1903,7 +1903,7 @@ void main() {
expect(semantics, hasSemantics(expectedSemantics));
semantics.dispose();
});
}, skip: isBrowser);
testWidgets('can be notified of TabBar onTap behavior', (WidgetTester tester) async {
int tabIndex = -1;
......
......@@ -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') // This whole test suite needs triage.
import 'dart:async';
import 'dart:math' as math;
import 'dart:ui' as ui show window;
......@@ -490,7 +491,7 @@ void main() {
matchesGoldenFile('text_field_opacity_test.0.2.png'),
skip: !isLinux,
);
});
}, skip: isBrowser);
// TODO(hansmuller): restore these tests after the fix for #24876 has landed.
/*
......@@ -2635,7 +2636,7 @@ void main() {
// and the left edge of the input and label.
expect(iconRight + 28.0, equals(tester.getTopLeft(find.text('label')).dx));
expect(iconRight + 28.0, equals(tester.getTopLeft(find.byType(EditableText)).dx));
});
}, skip: isBrowser);
testWidgets('Collapsed hint text placement', (WidgetTester tester) async {
await tester.pumpWidget(
......
......@@ -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') // entire file needs triage.
import 'dart:async';
import 'dart:ui' as ui;
......
......@@ -139,7 +139,7 @@ void main() {
final RenderBox tip = tester.renderObject(find.text(tooltipText)).parent.parent.parent.parent.parent;
expect(tip.size.height, equals(24.0)); // 14.0 height + 5.0 padding * 2 (top, bottom)
expect(tip.localToGlobal(tip.size.topLeft(Offset.zero)), equals(const Offset(10.0, 20.0)));
});
}, skip: isBrowser);
testWidgets('Does tooltip end up in the right place - center prefer above fits', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
......@@ -366,7 +366,7 @@ void main() {
expect(tip.localToGlobal(tip.size.topLeft(Offset.zero)).dy, equals(310.0));
expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dx, equals(790.0));
expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(324.0));
});
}, skip: isBrowser);
testWidgets('Does tooltip end up in the right place - near the edge', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
......@@ -421,7 +421,7 @@ void main() {
expect(tip.localToGlobal(tip.size.topLeft(Offset.zero)).dy, equals(310.0));
expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dx, equals(790.0));
expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(324.0));
});
}, skip: isBrowser);
testWidgets('Does tooltip end up with the right default size, shape, and color', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
......@@ -457,7 +457,7 @@ void main() {
rrect: RRect.fromRectAndRadius(tip.paintBounds, const Radius.circular(4.0)),
color: const Color(0xe6616161),
));
});
}, skip: isBrowser);
testWidgets('Can tooltip decoration be customized', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
......@@ -497,7 +497,7 @@ void main() {
expect(tip, paints..path(
color: const Color(0x80800000),
));
});
}, skip: isBrowser);
testWidgets('Tooltip stays around', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -707,7 +707,7 @@ void main() {
expect(tester.getSize(find.text(tooltipText)), equals(const Size(168.0, 56.0)));
tip = tester.renderObject(find.text(tooltipText)).parent;
expect(tip.size.height, equals(56.0));
});
}, skip: isBrowser);
testWidgets('Haptic feedback', (WidgetTester tester) async {
final FeedbackTester feedback = FeedbackTester();
......
......@@ -1056,7 +1056,7 @@ void main() {
expect(chunkEvents.length, 4);
expect(find.byType(Text), findsNothing);
expect(find.byType(RawImage), findsOneWidget);
});
}, skip: isBrowser);
testWidgets('Image doesn\'t rebuild on chunk events if loadingBuilder is null', (WidgetTester tester) async {
final ui.Image image = await tester.runAsync(createTestImage);
......@@ -1109,7 +1109,7 @@ void main() {
expect(find.byType(RawImage), findsOneWidget);
expect(tester.widget<Center>(find.byType(Center)).child, isInstanceOf<Padding>());
expect(tester.widget<Padding>(find.byType(Padding)).child, isInstanceOf<RawImage>());
});
}, skip: isBrowser);
testWidgets('Image state handles loadingBuilder update from null to non-null', (WidgetTester tester) async {
final TestImageStreamCompleter streamCompleter = TestImageStreamCompleter();
......@@ -1141,7 +1141,7 @@ void main() {
await tester.pump();
expect(find.byType(Center), findsOneWidget);
expect(find.byType(RawImage), findsOneWidget);
});
}, skip: isBrowser);
testWidgets('Image state handles loadingBuilder update from non-null to null', (WidgetTester tester) async {
final TestImageStreamCompleter streamCompleter = TestImageStreamCompleter();
......@@ -1174,7 +1174,7 @@ void main() {
expect(tester.state(find.byType(Image)), same(state));
streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100));
expect(tester.binding.hasScheduledFrame, isFalse);
});
}, skip: isBrowser);
}
class TestImageProvider extends ImageProvider<TestImageProvider> {
......
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