Unverified Commit 71c6cd0c authored by Jackson Gardner's avatar Jackson Gardner Committed by GitHub

Pass along web renderer into debugging options in the test command. (#143128)

We need to pass along the web renderer in the debugging options to make sure that the resident web runner sets up the targets correctly.
parent b586bd91
...@@ -21,6 +21,7 @@ import '../test/runner.dart'; ...@@ -21,6 +21,7 @@ import '../test/runner.dart';
import '../test/test_time_recorder.dart'; import '../test/test_time_recorder.dart';
import '../test/test_wrapper.dart'; import '../test/test_wrapper.dart';
import '../test/watcher.dart'; import '../test/watcher.dart';
import '../web/compile.dart';
/// The name of the directory where Integration Tests are placed. /// The name of the directory where Integration Tests are placed.
/// ///
...@@ -353,6 +354,10 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts { ...@@ -353,6 +354,10 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
); );
} }
final String? webRendererString = stringArg('web-renderer');
final WebRendererMode webRenderer = (webRendererString != null)
? WebRendererMode.values.byName(webRendererString)
: WebRendererMode.auto;
final DebuggingOptions debuggingOptions = DebuggingOptions.enabled( final DebuggingOptions debuggingOptions = DebuggingOptions.enabled(
buildInfo, buildInfo,
startPaused: startPaused, startPaused: startPaused,
...@@ -365,6 +370,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts { ...@@ -365,6 +370,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
usingCISystem: usingCISystem, usingCISystem: usingCISystem,
enableImpeller: ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?), enableImpeller: ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?),
debugLogsDirectoryPath: debugLogsDirectoryPath, debugLogsDirectoryPath: debugLogsDirectoryPath,
webRenderer: webRenderer,
); );
String? testAssetDirectory; String? testAssetDirectory;
......
...@@ -22,6 +22,7 @@ import 'package:flutter_tools/src/test/test_device.dart'; ...@@ -22,6 +22,7 @@ import 'package:flutter_tools/src/test/test_device.dart';
import 'package:flutter_tools/src/test/test_time_recorder.dart'; import 'package:flutter_tools/src/test/test_time_recorder.dart';
import 'package:flutter_tools/src/test/test_wrapper.dart'; import 'package:flutter_tools/src/test/test_wrapper.dart';
import 'package:flutter_tools/src/test/watcher.dart'; import 'package:flutter_tools/src/test/watcher.dart';
import 'package:flutter_tools/src/web/compile.dart';
import 'package:stream_channel/stream_channel.dart'; import 'package:stream_channel/stream_channel.dart';
import 'package:vm_service/vm_service.dart'; import 'package:vm_service/vm_service.dart';
...@@ -1057,6 +1058,24 @@ dev_dependencies: ...@@ -1057,6 +1058,24 @@ dev_dependencies:
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testUsingContext('Passes web renderer into debugging options', () async {
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
final TestCommand testCommand = TestCommand(testRunner: testRunner);
final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand);
await commandRunner.run(const <String>[
'test',
'--no-pub',
'--platform=chrome',
'--web-renderer=canvaskit',
]);
expect(testRunner.lastDebuggingOptionsValue.webRenderer, WebRendererMode.canvaskit);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
});
}); });
} }
......
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