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

This commit is contained in:
Jonah Williams
2021-07-12 09:01:04 -07:00
committed by GitHub
parent d6a844360a
commit 7a0b4669fc
6 changed files with 23 additions and 17 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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);

View File

@@ -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']);
});
}