Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcc007 committed Jul 17, 2019
1 parent a74d8d3 commit 1e153fa
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions lib/src/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,48 +206,48 @@ Future runTestsOnAll(DaemonClient daemonClient, List devices, List emulators,
}
}

// Change orientation if required
final deviceOrientation = configInfo['devices']
[utils.getStringFromEnum(deviceType)][configDeviceName]
['orientation'];
if (deviceOrientation.isNotEmpty) {
final orientation = orient.getOrientationEnum(deviceOrientation);
switch (deviceType) {
case DeviceType.android:
final currentDevice =
utils.getDeviceFromId(await daemonClient.devices, deviceId);
currentDevice == null
? throw 'Error: device \'$configDeviceName\' not found in flutter daemon.'
: null;
if (currentDevice['emulator']) {
// Change orientation if required
final deviceOrientation = configInfo['devices']
[utils.getStringFromEnum(deviceType)][configDeviceName]
['orientation'];
if (deviceOrientation.isNotEmpty) {
final orientation = orient.getOrientationEnum(deviceOrientation);
switch (deviceType) {
case DeviceType.android:
final currentDevice =
utils.getDeviceFromId(await daemonClient.devices, deviceId);
currentDevice == null
? throw 'Error: device \'$configDeviceName\' not found in flutter daemon.'
: null;
if (currentDevice['emulator']) {
orient.changeDeviceOrientation(deviceType, orientation,
deviceId: deviceId);
} else {
print(
'Warning: cannot change orientation of a real android device.');
}
break;
case DeviceType.ios:
orient.changeDeviceOrientation(deviceType, orientation,
deviceId: deviceId);
} else {
print(
'Warning: cannot change orientation of a real android device.');
}
break;
case DeviceType.ios:
orient.changeDeviceOrientation(deviceType, orientation,
scriptDir: '$stagingDir/resources/script');
break;
scriptDir: '$stagingDir/resources/script');
break;
}
}
}

// run tests and process images
await runProcessTests(config, screens, configDeviceName, locale,
deviceType, testPaths, deviceId, imageProcessor, runMode, archive);

}
// run tests and process images
await runProcessTests(config, screens, configDeviceName, locale,
deviceType, testPaths, deviceId, imageProcessor, runMode, archive);
}

// if an emulator was started, revert locale if necessary and shut it down
if (emulator != null) {
await setEmulatorLocale(deviceId, origAndroidLocale, configDeviceName);
await shutdownAndroidEmulator(daemonClient, deviceId);
}
if (simulator != null) {
// todo: revert locale
shutdownSimulator(deviceId);
// if an emulator was started, revert locale if necessary and shut it down
if (emulator != null) {
await setEmulatorLocale(deviceId, origAndroidLocale, configDeviceName);
await shutdownAndroidEmulator(daemonClient, deviceId);
}
if (simulator != null) {
// todo: revert locale
shutdownSimulator(deviceId);
}
}
}
}
Expand Down

0 comments on commit 1e153fa

Please sign in to comment.