From 27186c784f593af47c43efe89cd01c50af37d540 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 3 Jun 2020 09:33:02 -0700 Subject: [PATCH] Don't elapse real time during IOSDevice.startApp tests (#58538) --- packages/flutter_tools/lib/src/ios/devices.dart | 2 ++ .../general.shard/ios/ios_device_start_prebuilt_test.dart | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 2d052cd34a7..a381c5cf62b 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -300,6 +300,7 @@ class IOSDevice extends Device { Map platformArgs, bool prebuiltApplication = false, bool ipv6 = false, + @visibleForTesting Duration fallbackPollingDelay, }) async { String packageId; @@ -416,6 +417,7 @@ class IOSDevice extends Device { portForwarder: portForwarder, protocolDiscovery: observatoryDiscovery, flutterUsage: globals.flutterUsage, + pollingDelay: fallbackPollingDelay, ); final Uri localUri = await fallbackDiscovery.discover( assumedDevicePort: assumedObservatoryPort, diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart index 71c859afaac..5ab6343ca00 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart @@ -129,6 +129,7 @@ void main() { prebuiltApplication: true, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), platformArgs: {}, + fallbackPollingDelay: Duration.zero, ); verify(globals.flutterUsage.sendEvent('ios-handshake', 'mdns-success')).called(1); @@ -173,6 +174,7 @@ void main() { prebuiltApplication: true, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), platformArgs: {}, + fallbackPollingDelay: Duration.zero, ); expect(launchResult.started, true); @@ -219,6 +221,7 @@ void main() { prebuiltApplication: true, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), platformArgs: {}, + fallbackPollingDelay: Duration.zero, ); expect(launchResult.started, false); @@ -257,6 +260,7 @@ void main() { prebuiltApplication: true, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), platformArgs: {}, + fallbackPollingDelay: Duration.zero, ); expect(launchResult.started, true); @@ -347,6 +351,7 @@ void main() { verboseSystemLogs: true, ), platformArgs: {}, + fallbackPollingDelay: Duration.zero, ); expect(launchResult.started, true);