From fbbf3ec4712baf43d8117c98b65080cce0c10226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20S=20Guerrero?= Date: Mon, 7 Mar 2022 11:31:21 -0800 Subject: [PATCH] Support route on ios (#99078) --- .ci.yaml | 11 +++++++ TESTOWNERS | 4 ++- .../flutter_tools/lib/src/ios/devices.dart | 1 + .../flutter_tools/lib/src/ios/simulators.dart | 3 +- .../general.shard/ios/simulators_test.dart | 29 +++++++++++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 21c805c9bb..3aaf0ef8f0 100755 --- a/.ci.yaml +++ b/.ci.yaml @@ -3450,6 +3450,17 @@ targets: task_name: external_ui_integration_test_ios scheduler: luci + - name: Mac_ios routing_test + bringup: true + recipe: devicelab/devicelab_drone + presubmit: false + timeout: 60 + properties: + tags: > + ["devicelab","ios","mac"] + task_name: routing_test + scheduler: luci + - name: Mac_ios flavors_test_ios recipe: devicelab/devicelab_drone presubmit: false diff --git a/TESTOWNERS b/TESTOWNERS index 3ddbd20d86..afd2235867 100644 --- a/TESTOWNERS +++ b/TESTOWNERS @@ -63,7 +63,6 @@ /dev/devicelab/bin/tasks/platform_channels_benchmarks.dart @gaaclarke @flutter/engine /dev/devicelab/bin/tasks/platform_views_scroll_perf__timeline_summary.dart @zanderso @flutter/engine /dev/devicelab/bin/tasks/plugin_dependencies_test.dart @jmagman @flutter/tool -/dev/devicelab/bin/tasks/routing_test.dart @zanderso @flutter/tool /dev/devicelab/bin/tasks/textfield_perf__e2e_summary.dart @zanderso @flutter/engine /dev/devicelab/bin/tasks/web_size__compile_test.dart @yjbanov @flutter/web /dev/devicelab/bin/tasks/opacity_peephole_col_of_rows_perf__e2e_summary.dart @flar @flutter/engine @@ -172,6 +171,9 @@ /dev/devicelab/bin/tasks/simple_animation_perf_ios.dart @zanderso @flutter/engine /dev/devicelab/bin/tasks/tiles_scroll_perf_ios__timeline_summary.dart @zanderso @flutter/engine +## Linux android and Mac iOS Devicelab tests +/dev/devicelab/bin/tasks/routing_test.dart @zanderso @flutter/tool + ## Host only DeviceLab tests /dev/devicelab/bin/tasks/build_aar_module_test.dart @zanderso @flutter/tool /dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart @zanderso @flutter/tool diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index fc6e13bcaf..069d17b258 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -371,6 +371,7 @@ class IOSDevice extends Device { if (debuggingOptions.verboseSystemLogs) '--verbose-logging', if (debuggingOptions.cacheSkSL) '--cache-sksl', if (debuggingOptions.purgePersistentCache) '--purge-persistent-cache', + if (route != null) '--route=$route', if (platformArgs['trace-startup'] as bool? ?? false) '--trace-startup', ]; diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index fede1f6d47..5f190707ed 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -473,7 +473,8 @@ class IOSSimulator extends Device { if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"', if (debuggingOptions.traceSkiaAllowlist != null) '--trace-skia-allowlist="${debuggingOptions.traceSkiaAllowlist}"', if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags', - '--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}' + '--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}', + if (route != null) '--route=$route' ], ]; diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart index 4152ad8dab..5f389bc9c6 100644 --- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart @@ -995,6 +995,35 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ProcessManager: () => FakeProcessManager.any(), Xcode: () => xcode, }); + + testUsingContext('startApp using route', () async { + final IOSSimulator device = IOSSimulator( + 'x', + name: 'iPhone SE', + simulatorCategory: 'iOS 11.2', + simControl: simControl, + ); + testPlistParser.setProperty('CFBundleIdentifier', 'correct'); + + final Directory mockDir = globals.fs.currentDirectory; + final IOSApp package = PrebuiltIOSApp( + projectBundleId: 'correct', + bundleName: 'name', + uncompressedBundle: mockDir, + applicationPackage: mockDir, + ); + + const BuildInfo mockInfo = BuildInfo(BuildMode.debug, 'flavor', treeShakeIcons: false); + final DebuggingOptions mockOptions = DebuggingOptions.enabled(mockInfo, enableSoftwareRendering: true); + await device.startApp(package, prebuiltApplication: true, debuggingOptions: mockOptions, route: '/animation'); + + expect(simControl.requests.single.launchArgs, contains('--route=/animation')); + }, overrides: { + PlistParser: () => testPlistParser, + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), + Xcode: () => xcode, + }); }); group('IOSDevice.isSupportedForProject', () {