parent
5d93894264
commit
609b8f3219
@ -16,7 +16,7 @@ Future<void> main() async {
|
|||||||
await testWithNewIOSSimulator('TestHotReloadSim', (String deviceId) async {
|
await testWithNewIOSSimulator('TestHotReloadSim', (String deviceId) async {
|
||||||
simulatorDeviceId = deviceId;
|
simulatorDeviceId = deviceId;
|
||||||
// This isn't actually a benchmark test, so do not use the returned `benchmarkScoreKeys` result.
|
// This isn't actually a benchmark test, so do not use the returned `benchmarkScoreKeys` result.
|
||||||
await createHotModeTest(deviceIdOverride: deviceId, checkAppRunningOnLocalDevice: true)();
|
await createHotModeTest(deviceIdOverride: deviceId)();
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
await removeIOSimulator(simulatorDeviceId);
|
await removeIOSimulator(simulatorDeviceId);
|
||||||
|
@ -257,25 +257,6 @@ class SimControl {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<RunResult> stopApp(String deviceId, String appIdentifier) async {
|
|
||||||
RunResult result;
|
|
||||||
try {
|
|
||||||
result = await _processUtils.run(
|
|
||||||
<String>[
|
|
||||||
..._xcode.xcrunCommand(),
|
|
||||||
'simctl',
|
|
||||||
'terminate',
|
|
||||||
deviceId,
|
|
||||||
appIdentifier,
|
|
||||||
],
|
|
||||||
throwOnError: true,
|
|
||||||
);
|
|
||||||
} on ProcessException catch (exception) {
|
|
||||||
throwToolExit('Unable to terminate $appIdentifier on $deviceId:\n$exception');
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> takeScreenshot(String deviceId, String outputPath) async {
|
Future<void> takeScreenshot(String deviceId, String outputPath) async {
|
||||||
try {
|
try {
|
||||||
await _processUtils.run(
|
await _processUtils.run(
|
||||||
@ -555,7 +536,8 @@ class IOSSimulator extends Device {
|
|||||||
ApplicationPackage app, {
|
ApplicationPackage app, {
|
||||||
String? userIdentifier,
|
String? userIdentifier,
|
||||||
}) async {
|
}) async {
|
||||||
return (await _simControl.stopApp(id, app.id)).exitCode == 0;
|
// Currently we don't have a way to stop an app running on iOS.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String get logFilePath {
|
String get logFilePath {
|
||||||
|
@ -901,24 +901,6 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
|
|||||||
throwsToolExit(message: r'Unable to launch'),
|
throwsToolExit(message: r'Unable to launch'),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWithoutContext('.stopApp() handles exceptions', () async {
|
|
||||||
fakeProcessManager.addCommand(const FakeCommand(
|
|
||||||
command: <String>[
|
|
||||||
'xcrun',
|
|
||||||
'simctl',
|
|
||||||
'terminate',
|
|
||||||
deviceId,
|
|
||||||
appId,
|
|
||||||
],
|
|
||||||
exception: ProcessException('xcrun', <String>[]),
|
|
||||||
));
|
|
||||||
|
|
||||||
expect(
|
|
||||||
() async => simControl.stopApp(deviceId, appId),
|
|
||||||
throwsToolExit(message: r'Unable to terminate'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
group('startApp', () {
|
group('startApp', () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user