Unverified Commit 7a0b4669 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] switch web integration tests to use html (#85325)

parent d6a84436
......@@ -25,12 +25,21 @@ class HotReloadProject extends Project {
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(MyApp());
// See https://github.com/flutter/flutter/issues/86202
if (kIsWeb) {
while (true) {
runApp(MyApp());
await Future.delayed(const Duration(seconds: 1));
}
} else {
runApp(MyApp());
}
}
int count = 1;
......
......@@ -27,7 +27,7 @@ void main() {
await flutter.run(
withDebugger: true, startPaused: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
await flutter.addBreakpoint(_project.breakpointUri, _project.breakpointLine);
await flutter.resume();
await flutter.waitForPause(); // Now we should be on the breakpoint.
......@@ -48,8 +48,7 @@ void main() {
reason: 'After $i steps, debugger should stop at $expectedLine but stopped at $actualLine'
);
}
}, skip: true, // Flaky: https://github.com/flutter/flutter/issues/83260
);
});
tearDown(() async {
await flutter.stop();
......
......@@ -36,7 +36,7 @@ void main() {
await flutter.run(
withDebugger: true, chrome: true,
expressionEvaluation: expressionEvaluation,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
}
Future<void> breakInBuildMethod(FlutterTestDriver flutter) async {
......@@ -104,8 +104,7 @@ void main() {
await start(expressionEvaluation: true);
await evaluateComplexExpressionsInLibrary(flutter);
});
}, skip: true, // Flaky tests: https://github.com/flutter/flutter/issues/84012
);
});
group('Flutter test for web', () {
final TestsProject project = TestsProject();
......@@ -140,7 +139,7 @@ void main() {
withDebugger: true, chrome: true,
expressionEvaluation: expressionEvaluation,
startPaused: true, script: project.testFilePath,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
}
testWithoutContext('cannot evaluate expressions if feature is disabled', () async {
......@@ -170,8 +169,7 @@ void main() {
await startPaused(expressionEvaluation: true);
await evaluateComplexExpressionsInLibrary(flutter);
});
}, skip: true, // Flaky tests: https://github.com/flutter/flutter/issues/84012
);
});
}
Future<void> failToEvaluateExpression(FlutterTestDriver flutter) async {
......
......@@ -31,7 +31,7 @@ void main() {
});
testWithoutContext('hot restart works without error', () async {
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose']);
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
await flutter.hotRestart();
});
......@@ -43,7 +43,7 @@ void main() {
completer.complete();
}
});
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose']);
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
project.uncommentHotReloadPrint();
try {
await flutter.hotRestart();
......
......@@ -36,7 +36,7 @@ void main() {
testWithoutContext('can validate flutter version', () async {
await flutter.run(
withDebugger: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
expect(flutter.vmServiceWsUri, isNotNull);
......@@ -48,7 +48,7 @@ void main() {
testWithoutContext('can validate flutter version in parallel', () async {
await flutter.run(
withDebugger: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
expect(flutter.vmServiceWsUri, isNotNull);
......@@ -80,7 +80,7 @@ void main() {
testWithoutContext('can validate flutter version', () async {
await flutter.run(
withDebugger: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
expect(flutter.vmServiceWsUri, isNotNull);
......@@ -93,7 +93,7 @@ void main() {
testWithoutContext('can validate flutter version in parallel', () async {
await flutter.run(
withDebugger: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
expect(flutter.vmServiceWsUri, isNotNull);
......
......@@ -29,6 +29,6 @@ void main() {
});
testWithoutContext('flutter run works on web devices with a unary main function', () async {
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose']);
await flutter.run(chrome: true, additionalCommandArgs: <String>['--verbose', '--web-renderer=html']);
});
}
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