Unverified Commit 3bc3b323 authored by Yegor's avatar Yegor Committed by GitHub

Reland: fix and add painting web tests (#42689)

parent adf9d6f7
......@@ -443,7 +443,6 @@ Future<void> _runWebTests() async {
'test/cupertino',
'test/examples',
'test/material',
'test/painting',
'test/rendering',
'test/widgets',
];
......
......@@ -813,13 +813,13 @@ void main() {
for (Gradient gradient in gradients45) {
await runTest(tester, gradient, 45);
}
});
}, skip: isBrowser); // TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
testWidgets('Gradients - 90 degrees', (WidgetTester tester) async {
for (Gradient gradient in gradients90) {
await runTest(tester, gradient, 90);
}
});
}, skip: isBrowser); // TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
});
}
......
......@@ -181,7 +181,7 @@ void main() {
.having((NetworkImageLoadException e) => e.statusCode, 'statusCode', errorStatusCode)
.having((NetworkImageLoadException e) => e.uri, 'uri', Uri.base.resolve(requestUrl)),
);
});
}, skip: isBrowser); // Browser implementation does not use HTTP client but a <img> tag.
test('Disallows null urls', () {
expect(() {
......
......@@ -91,7 +91,7 @@ void main() {
expect(cache.isEmpty, isTrue);
final Element element = tester.element(find.byType(CupertinoDatePicker));
expect(element.dirty, isTrue);
});
}, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets('CupertinoDatePicker reset cache upon system fonts change - date mode', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -118,7 +118,7 @@ void main() {
expect(cache.isNotEmpty, isTrue);
final Element element = tester.element(find.byType(CupertinoDatePicker));
expect(element.dirty, isTrue);
});
}, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets('CupertinoDatePicker reset cache upon system fonts change - time mode', (WidgetTester tester) async {
await tester.pumpWidget(
......@@ -147,7 +147,7 @@ void main() {
expect(state.numberLabelBaseline - 18.400070190429688 < precisionErrorTolerance, isTrue);
final Element element = tester.element(find.byType(CupertinoTimerPicker));
expect(element.dirty, isTrue);
});
}, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets('RangeSlider relayout upon system fonts changes', (WidgetTester tester) async {
await tester.pumpWidget(
......
......@@ -277,6 +277,7 @@ Future<void> main() async {
// The following parameters are hard-coded in Flutter's test embedder. Since
// we don't have an embedder yet this is the lowest-most layer we can put
// this stuff in.
ui.debugEmulateFlutterTesterEnvironment = true;
await ui.webOnlyInitializeEngine();
// TODO(flutterweb): remove need for dynamic cast.
(ui.window as dynamic).debugOverrideDevicePixelRatio(3.0);
......
......@@ -5,12 +5,16 @@
@TestOn('chrome') // Uses web-only Flutter SDK
import 'dart:async';
import 'dart:ui' as ui;
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
void main() {
// Disabling tester emulation because this test relies on real message channel communication.
ui.debugEmulateFlutterTesterEnvironment = false; // ignore: undefined_prefixed_name
group('Plugin Event Channel', () {
setUp(() {
TestWidgetsFlutterBinding.ensureInitialized();
......
......@@ -4,6 +4,8 @@
@TestOn('chrome') // Uses web-only Flutter SDK
import 'dart:ui' as ui;
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
......@@ -27,6 +29,9 @@ class TestPlugin {
}
void main() {
// Disabling tester emulation because this test relies on real message channel communication.
ui.debugEmulateFlutterTesterEnvironment = false; // ignore: undefined_prefixed_name
group('Plugin Registry', () {
setUp(() {
TestWidgetsFlutterBinding.ensureInitialized();
......
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