mirror of
https://github.com/flutter/flutter
synced 2024-09-13 21:32:11 +00:00
[flutter_tools] Fix type error in ChromiumDevice.startApp (#111935)
This commit is contained in:
parent
3a1a25339e
commit
eead1efe5f
|
@ -118,7 +118,7 @@ abstract class ChromiumDevice extends Device {
|
|||
|
||||
@override
|
||||
Future<LaunchResult> startApp(
|
||||
covariant WebApplicationPackage package, {
|
||||
WebApplicationPackage? package, {
|
||||
String? mainPath,
|
||||
String? route,
|
||||
required DebuggingOptions debuggingOptions,
|
||||
|
@ -454,7 +454,7 @@ class WebServerDevice extends Device {
|
|||
Future<String> get sdkNameAndVersion async => 'Flutter Tools';
|
||||
|
||||
@override
|
||||
Future<LaunchResult> startApp(ApplicationPackage package, {
|
||||
Future<LaunchResult> startApp(ApplicationPackage? package, {
|
||||
String? mainPath,
|
||||
String? route,
|
||||
required DebuggingOptions debuggingOptions,
|
||||
|
|
|
@ -340,7 +340,7 @@ void main() {
|
|||
fakeVmServiceHost =
|
||||
FakeVmServiceHost(requests: kAttachExpectations.toList());
|
||||
setupMocks();
|
||||
fileSystem.file(fileSystem.path.join('web', 'index.html')).deleteSync();
|
||||
fileSystem.directory('web').deleteSync(recursive: true);
|
||||
final ResidentWebRunner residentWebRunner = ResidentWebRunner(
|
||||
flutterDevice,
|
||||
flutterProject:
|
||||
|
|
|
@ -112,6 +112,37 @@ void main() {
|
|||
expect(device.supportsRuntimeMode(BuildMode.jitRelease), false);
|
||||
});
|
||||
|
||||
testWithoutContext('ChromiumDevice accepts null package', () async {
|
||||
final MemoryFileSystem fs = MemoryFileSystem.test();
|
||||
final FakePlatform platform = FakePlatform();
|
||||
final FakeProcessManager pm = FakeProcessManager.any();
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
final GoogleChromeDevice device = GoogleChromeDevice(
|
||||
fileSystem: fs,
|
||||
processManager: pm,
|
||||
platform: platform,
|
||||
chromiumLauncher: ChromiumLauncher(
|
||||
fileSystem: fs,
|
||||
platform: platform,
|
||||
processManager: pm,
|
||||
operatingSystemUtils: FakeOperatingSystemUtils(),
|
||||
browserFinder: findChromeExecutable,
|
||||
logger: logger,
|
||||
),
|
||||
logger: logger,
|
||||
);
|
||||
await expectLater(
|
||||
() => device.startApp(
|
||||
null,
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
platformArgs: <String, Object?>{'uri': 'localhost:1234'},
|
||||
),
|
||||
// The tool exit here is irrelevant, this test simply ensures ChromiumDevice.startApp
|
||||
// will accept a null value for a package.
|
||||
throwsToolExit(message: 'Failed to launch browser'),
|
||||
);
|
||||
});
|
||||
|
||||
testWithoutContext('Chrome device is listed when Chrome can be run', () async {
|
||||
final WebDevices webDevices = WebDevices(
|
||||
featureFlags: TestFeatureFlags(isWebEnabled: true),
|
||||
|
|
Loading…
Reference in a new issue