@@ -300,6 +300,66 @@ void main() {
300300 ),
301301 );
302302 });
303+
304+ testWithoutContext ('Desktop devices that support impeller pass through the enable-impeller flag' , () async {
305+ final FakeProcessManager processManager = FakeProcessManager .list (< FakeCommand > [
306+ const FakeCommand (
307+ command: < String > ['debug' ],
308+ exitCode: - 1 ,
309+ environment: < String , String > {
310+ 'FLUTTER_ENGINE_SWITCH_1' : 'enable-dart-profiling=true' ,
311+ 'FLUTTER_ENGINE_SWITCH_2' : 'enable-impeller=true' ,
312+ 'FLUTTER_ENGINE_SWITCH_3' : 'enable-checked-mode=true' ,
313+ 'FLUTTER_ENGINE_SWITCH_4' : 'verify-entry-points=true' ,
314+ 'FLUTTER_ENGINE_SWITCHES' : '4'
315+ }
316+ ),
317+ ]);
318+ final FakeDesktopDevice device = setUpDesktopDevice (
319+ processManager: processManager,
320+ supportsImpeller: true ,
321+ );
322+
323+ final FakeApplicationPackage package = FakeApplicationPackage ();
324+ await device.startApp (
325+ package,
326+ prebuiltApplication: true ,
327+ debuggingOptions: DebuggingOptions .enabled (
328+ BuildInfo .debug,
329+ enableImpeller: ImpellerStatus .enabled,
330+ dartEntrypointArgs: < String > [],
331+ ),
332+ );
333+ });
334+
335+ testWithoutContext ('Desktop devices that do not support impeller ignore the enable-impeller flag' , () async {
336+ final FakeProcessManager processManager = FakeProcessManager .list (< FakeCommand > [
337+ const FakeCommand (
338+ command: < String > ['debug' ],
339+ exitCode: - 1 ,
340+ environment: < String , String > {
341+ 'FLUTTER_ENGINE_SWITCH_1' : 'enable-dart-profiling=true' ,
342+ 'FLUTTER_ENGINE_SWITCH_2' : 'enable-checked-mode=true' ,
343+ 'FLUTTER_ENGINE_SWITCH_3' : 'verify-entry-points=true' ,
344+ 'FLUTTER_ENGINE_SWITCHES' : '3'
345+ }
346+ ),
347+ ]);
348+ final FakeDesktopDevice device = setUpDesktopDevice (
349+ processManager: processManager,
350+ );
351+
352+ final FakeApplicationPackage package = FakeApplicationPackage ();
353+ await device.startApp (
354+ package,
355+ prebuiltApplication: true ,
356+ debuggingOptions: DebuggingOptions .enabled (
357+ BuildInfo .debug,
358+ enableImpeller: ImpellerStatus .enabled,
359+ dartEntrypointArgs: < String > [],
360+ ),
361+ );
362+ });
303363}
304364
305365FakeDesktopDevice setUpDesktopDevice ({
@@ -308,13 +368,15 @@ FakeDesktopDevice setUpDesktopDevice({
308368 ProcessManager ? processManager,
309369 OperatingSystemUtils ? operatingSystemUtils,
310370 bool nullExecutablePathForDevice = false ,
371+ bool supportsImpeller = false ,
311372}) {
312373 return FakeDesktopDevice (
313374 fileSystem: fileSystem ?? MemoryFileSystem .test (),
314375 logger: logger ?? BufferLogger .test (),
315376 processManager: processManager ?? FakeProcessManager .any (),
316377 operatingSystemUtils: operatingSystemUtils ?? FakeOperatingSystemUtils (),
317378 nullExecutablePathForDevice: nullExecutablePathForDevice,
379+ supportsImpeller: supportsImpeller,
318380 );
319381}
320382
@@ -326,6 +388,7 @@ class FakeDesktopDevice extends DesktopDevice {
326388 required FileSystem fileSystem,
327389 required OperatingSystemUtils operatingSystemUtils,
328390 this .nullExecutablePathForDevice = false ,
391+ this .supportsImpeller = false ,
329392 }) : super (
330393 'dummy' ,
331394 platformType: PlatformType .linux,
@@ -344,6 +407,9 @@ class FakeDesktopDevice extends DesktopDevice {
344407
345408 final bool nullExecutablePathForDevice;
346409
410+ @override
411+ final bool supportsImpeller;
412+
347413 @override
348414 String get name => 'dummy' ;
349415
0 commit comments