@@ -466,6 +466,205 @@ void main() {
466466 expect (deserialized.enableImpeller, original.enableImpeller);
467467 });
468468 });
469+
470+ group ('Get iOS launch arguments from DebuggingOptions' , () {
471+ testWithoutContext ('Get launch arguments for physical device with debugging enabled with all launch arguments' , () {
472+ final DebuggingOptions original = DebuggingOptions .enabled (
473+ BuildInfo .debug,
474+ startPaused: true ,
475+ disableServiceAuthCodes: true ,
476+ disablePortPublication: true ,
477+ dartFlags: '--foo' ,
478+ useTestFonts: true ,
479+ enableSoftwareRendering: true ,
480+ skiaDeterministicRendering: true ,
481+ traceSkia: true ,
482+ traceAllowlist: 'foo' ,
483+ traceSkiaAllowlist: 'skia.a,skia.b' ,
484+ traceSystrace: true ,
485+ endlessTraceBuffer: true ,
486+ dumpSkpOnShaderCompilation: true ,
487+ cacheSkSL: true ,
488+ purgePersistentCache: true ,
489+ verboseSystemLogs: true ,
490+ nullAssertions: true ,
491+ enableImpeller: true ,
492+ deviceVmServicePort: 0 ,
493+ hostVmServicePort: 1 ,
494+ );
495+
496+ final List <String > launchArguments = original.getIOSLaunchArguments (
497+ EnvironmentType .physical,
498+ '/test' ,
499+ < String , dynamic > {
500+ 'trace-startup' : true ,
501+ },
502+ );
503+
504+ expect (
505+ launchArguments.join (' ' ),
506+ < String > [
507+ '--enable-dart-profiling' ,
508+ '--disable-service-auth-codes' ,
509+ '--disable-observatory-publication' ,
510+ '--start-paused' ,
511+ '--dart-flags="--foo,--null_assertions"' ,
512+ '--use-test-fonts' ,
513+ '--enable-checked-mode' ,
514+ '--verify-entry-points' ,
515+ '--enable-software-rendering' ,
516+ '--trace-systrace' ,
517+ '--skia-deterministic-rendering' ,
518+ '--trace-skia' ,
519+ '--trace-allowlist="foo"' ,
520+ '--trace-skia-allowlist="skia.a,skia.b"' ,
521+ '--endless-trace-buffer' ,
522+ '--dump-skp-on-shader-compilation' ,
523+ '--verbose-logging' ,
524+ '--cache-sksl' ,
525+ '--purge-persistent-cache' ,
526+ '--route=/test' ,
527+ '--trace-startup' ,
528+ '--enable-impeller' ,
529+ '--observatory-port=0' ,
530+ ].join (' ' ),
531+ );
532+ });
533+
534+ testWithoutContext ('Get launch arguments for physical device with debugging enabled with no launch arguments' , () {
535+ final DebuggingOptions original = DebuggingOptions .enabled (
536+ BuildInfo .debug,
537+ );
538+
539+ final List <String > launchArguments = original.getIOSLaunchArguments (
540+ EnvironmentType .physical,
541+ null ,
542+ < String , Object ? > {},
543+ );
544+
545+ expect (
546+ launchArguments.join (' ' ),
547+ < String > [
548+ '--enable-dart-profiling' ,
549+ '--enable-checked-mode' ,
550+ '--verify-entry-points' ,
551+ ].join (' ' ),
552+ );
553+ });
554+
555+ testWithoutContext ('Get launch arguments for physical device with debugging disabled with available launch arguments' , () {
556+ final DebuggingOptions original = DebuggingOptions .disabled (
557+ BuildInfo .debug,
558+ traceAllowlist: 'foo' ,
559+ cacheSkSL: true ,
560+ enableImpeller: true ,
561+ );
562+
563+ final List <String > launchArguments = original.getIOSLaunchArguments (
564+ EnvironmentType .physical,
565+ '/test' ,
566+ < String , dynamic > {
567+ 'trace-startup' : true ,
568+ },
569+ );
570+
571+ expect (
572+ launchArguments.join (' ' ),
573+ < String > [
574+ '--enable-dart-profiling' ,
575+ '--trace-allowlist="foo"' ,
576+ '--cache-sksl' ,
577+ '--route=/test' ,
578+ '--trace-startup' ,
579+ '--enable-impeller' ,
580+ ].join (' ' ),
581+ );
582+ });
583+
584+ testWithoutContext ('Get launch arguments for simulator device with debugging enabled with all launch arguments' , () {
585+ final DebuggingOptions original = DebuggingOptions .enabled (
586+ BuildInfo .debug,
587+ startPaused: true ,
588+ disableServiceAuthCodes: true ,
589+ disablePortPublication: true ,
590+ dartFlags: '--foo' ,
591+ useTestFonts: true ,
592+ enableSoftwareRendering: true ,
593+ skiaDeterministicRendering: true ,
594+ traceSkia: true ,
595+ traceAllowlist: 'foo' ,
596+ traceSkiaAllowlist: 'skia.a,skia.b' ,
597+ traceSystrace: true ,
598+ endlessTraceBuffer: true ,
599+ dumpSkpOnShaderCompilation: true ,
600+ cacheSkSL: true ,
601+ purgePersistentCache: true ,
602+ verboseSystemLogs: true ,
603+ nullAssertions: true ,
604+ enableImpeller: true ,
605+ deviceVmServicePort: 0 ,
606+ hostVmServicePort: 1 ,
607+ );
608+
609+ final List <String > launchArguments = original.getIOSLaunchArguments (
610+ EnvironmentType .simulator,
611+ '/test' ,
612+ < String , dynamic > {
613+ 'trace-startup' : true ,
614+ },
615+ );
616+
617+ expect (
618+ launchArguments.join (' ' ),
619+ < String > [
620+ '--enable-dart-profiling' ,
621+ '--disable-service-auth-codes' ,
622+ '--disable-observatory-publication' ,
623+ '--start-paused' ,
624+ '--dart-flags=--foo,--null_assertions' ,
625+ '--use-test-fonts' ,
626+ '--enable-checked-mode' ,
627+ '--verify-entry-points' ,
628+ '--enable-software-rendering' ,
629+ '--trace-systrace' ,
630+ '--skia-deterministic-rendering' ,
631+ '--trace-skia' ,
632+ '--trace-allowlist="foo"' ,
633+ '--trace-skia-allowlist="skia.a,skia.b"' ,
634+ '--endless-trace-buffer' ,
635+ '--dump-skp-on-shader-compilation' ,
636+ '--verbose-logging' ,
637+ '--cache-sksl' ,
638+ '--purge-persistent-cache' ,
639+ '--route=/test' ,
640+ '--trace-startup' ,
641+ '--enable-impeller' ,
642+ '--observatory-port=1' ,
643+ ].join (' ' ),
644+ );
645+ });
646+
647+ testWithoutContext ('Get launch arguments for simulator device with debugging enabled with no launch arguments' , () {
648+ final DebuggingOptions original = DebuggingOptions .enabled (
649+ BuildInfo .debug,
650+ );
651+
652+ final List <String > launchArguments = original.getIOSLaunchArguments (
653+ EnvironmentType .simulator,
654+ null ,
655+ < String , Object ? > {},
656+ );
657+
658+ expect (
659+ launchArguments.join (' ' ),
660+ < String > [
661+ '--enable-dart-profiling' ,
662+ '--enable-checked-mode' ,
663+ '--verify-entry-points' ,
664+ ].join (' ' ),
665+ );
666+ });
667+ });
469668}
470669
471670class TestDeviceManager extends DeviceManager {
0 commit comments