Unverified Commit 934e05f8 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Remove Try accepting the local network permissions popup warning (#66621)

parent 2ae09caa
......@@ -469,12 +469,6 @@ class IOSDevice extends Device {
packageName: FlutterProject.current().manifest.appName,
);
if (localUri == null) {
if (majorSdkVersion >= 14) {
_logger.printError('Failed to attach to the observatory.');
_logger.printError(
'Try accepting the local network permissions popup, or enable "Settings > Privacy > Local Network" for your app.');
_logger.printError('For more information, see https://flutter.dev/docs/development/ios-14#debugging-flutter');
}
return LaunchResult.failed();
}
return LaunchResult.succeeded(observatoryUri: localUri);
......
......@@ -338,106 +338,6 @@ void main() {
Usage: () => MockUsage(),
});
group('IOSDevice.startApp on discovery failure local network permissions', () {
// Still uses context for analytics and mDNS.
testUsingContext('is not prompted on < iOS 14', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
kDeployCommand,
kAttachDebuggerCommand,
]);
final BufferLogger logger = BufferLogger.test();
final IOSDevice device = setUpIOSDevice(
sdkVersion: '13.0',
processManager: processManager,
fileSystem: fileSystem,
logger: logger,
vmServiceConnector: (String string, {Log log}) async {
throw const io.SocketException(
'OS Error: Connection refused, errno = 61, address = localhost, port '
'= 58943',
);
},
);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();
device.portForwarder = const NoOpDevicePortForwarder();
device.setLogReader(iosApp, deviceLogReader);
when(MDnsObservatoryDiscovery.instance.getObservatoryUri(any, any, usesIpv6: anyNamed('usesIpv6')))
.thenAnswer((Invocation invocation) async => null);
final LaunchResult launchResult = await device.startApp(iosApp,
prebuiltApplication: true,
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
platformArgs: <String, dynamic>{},
fallbackPollingDelay: Duration.zero,
fallbackThrottleTimeout: const Duration(milliseconds: 10),
);
expect(launchResult.started, false);
expect(launchResult.hasObservatory, false);
expect(logger.errorText, isEmpty);
}, overrides: <Type, Generator>{
MDnsObservatoryDiscovery: () => MockMDnsObservatoryDiscovery(),
Usage: () => MockUsage(),
});
// Still uses context for analytics and mDNS.
testUsingContext('is prompted on >= iOS 14', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
kDeployCommand,
kAttachDebuggerCommand,
]);
final BufferLogger logger = BufferLogger.test();
final IOSDevice device = setUpIOSDevice(
sdkVersion: '14.0',
processManager: processManager,
fileSystem: fileSystem,
logger: logger,
vmServiceConnector: (String string, {Log log}) async {
throw const io.SocketException(
'OS Error: Connection refused, errno = 61, address = localhost, port '
'= 58943',
);
},
);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();
device.portForwarder = const NoOpDevicePortForwarder();
device.setLogReader(iosApp, deviceLogReader);
when(MDnsObservatoryDiscovery.instance.getObservatoryUri(any, any, usesIpv6: anyNamed('usesIpv6')))
.thenAnswer((Invocation invocation) async => null);
final LaunchResult launchResult = await device.startApp(iosApp,
prebuiltApplication: true,
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
platformArgs: <String, dynamic>{},
fallbackPollingDelay: Duration.zero,
fallbackThrottleTimeout: const Duration(milliseconds: 10),
);
expect(launchResult.started, false);
expect(launchResult.hasObservatory, false);
expect(logger.errorText, contains('Settings > Privacy > Local Network'));
}, overrides: <Type, Generator>{
MDnsObservatoryDiscovery: () => MockMDnsObservatoryDiscovery(),
Usage: () => MockUsage(),
});
});
// Still uses context for TimeoutConfiguration and usage
testUsingContext('IOSDevice.startApp succeeds in release mode', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment