mirror of
https://github.com/flutter/flutter
synced 2024-08-24 18:36:03 +00:00
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.
This commit is contained in:
parent
b586bd9188
commit
71c6cd0cb9
|
@ -21,6 +21,7 @@ import '../test/runner.dart';
|
|||
import '../test/test_time_recorder.dart';
|
||||
import '../test/test_wrapper.dart';
|
||||
import '../test/watcher.dart';
|
||||
import '../web/compile.dart';
|
||||
|
||||
/// The name of the directory where Integration Tests are placed.
|
||||
///
|
||||
|
@ -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(
|
||||
buildInfo,
|
||||
startPaused: startPaused,
|
||||
|
@ -365,6 +370,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
|||
usingCISystem: usingCISystem,
|
||||
enableImpeller: ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?),
|
||||
debugLogsDirectoryPath: debugLogsDirectoryPath,
|
||||
webRenderer: webRenderer,
|
||||
);
|
||||
|
||||
String? testAssetDirectory;
|
||||
|
|
|
@ -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_wrapper.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:vm_service/vm_service.dart';
|
||||
|
||||
|
@ -1057,6 +1058,24 @@ dev_dependencies:
|
|||
FileSystem: () => fs,
|
||||
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(),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue