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