diff --git a/script/tool/lib/src/dart_test_command.dart b/script/tool/lib/src/dart_test_command.dart index df0ee71400..1c188ff38a 100644 --- a/script/tool/lib/src/dart_test_command.dart +++ b/script/tool/lib/src/dart_test_command.dart @@ -98,9 +98,11 @@ class DartTestCommand extends PackageLoopingCommand { platform = 'chrome'; } + // All the web tests assume the html renderer currently. + final String? webRenderer = (platform == 'chrome') ? 'html' : null; bool passed; if (package.requiresFlutter()) { - passed = await _runFlutterTests(package, platform: platform); + passed = await _runFlutterTests(package, platform: platform, webRenderer: webRenderer); } else { passed = await _runDartTests(package, platform: platform); } @@ -109,7 +111,7 @@ class DartTestCommand extends PackageLoopingCommand { /// Runs the Dart tests for a Flutter package, returning true on success. Future _runFlutterTests(RepositoryPackage package, - {String? platform}) async { + {String? platform, String? webRenderer}) async { final String experiment = getStringArg(kEnableExperiment); final int exitCode = await processRunner.runAndStream( @@ -121,6 +123,7 @@ class DartTestCommand extends PackageLoopingCommand { // Flutter defaults to VM mode (under a different name) and explicitly // setting it is deprecated, so pass nothing in that case. if (platform != null && platform != 'vm') '--platform=$platform', + if (webRenderer != null) '--web-renderer=$webRenderer', ], workingDir: package.directory, ); diff --git a/script/tool/lib/src/drive_examples_command.dart b/script/tool/lib/src/drive_examples_command.dart index ff73044f6c..f3baa5c7ce 100644 --- a/script/tool/lib/src/drive_examples_command.dart +++ b/script/tool/lib/src/drive_examples_command.dart @@ -119,6 +119,7 @@ class DriveExamplesCommand extends PackageLoopingCommand { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', if (platform.environment.containsKey('CHROME_EXECUTABLE')) '--chrome-binary=${platform.environment['CHROME_EXECUTABLE']}', ], diff --git a/script/tool/test/dart_test_command_test.dart b/script/tool/test/dart_test_command_test.dart index 5752d7439e..d56bb44b0f 100644 --- a/script/tool/test/dart_test_command_test.dart +++ b/script/tool/test/dart_test_command_test.dart @@ -265,7 +265,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], package.path), ]), ); @@ -289,7 +289,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -314,7 +314,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -339,7 +339,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -409,7 +409,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); diff --git a/script/tool/test/drive_examples_command_test.dart b/script/tool/test/drive_examples_command_test.dart index 60df1b70ae..92d4921a0b 100644 --- a/script/tool/test/drive_examples_command_test.dart +++ b/script/tool/test/drive_examples_command_test.dart @@ -678,6 +678,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -726,6 +727,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -777,6 +779,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--chrome-binary=/path/to/chrome', '--driver', 'test_driver/integration_test.dart', @@ -1223,6 +1226,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1237,6 +1241,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1334,6 +1339,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1413,6 +1419,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target',