This reverts commit 32000db52e.
This commit is contained in:
committed by
GitHub
parent
32000db52e
commit
09cca73aee
@@ -510,7 +510,7 @@ class IOSDevice extends Device {
|
||||
|
||||
@override
|
||||
Future<void> takeScreenshot(File outputFile) async {
|
||||
await _iMobileDevice.takeScreenshot(outputFile, id);
|
||||
await _iMobileDevice.takeScreenshot(outputFile);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -832,8 +832,8 @@ class IOSDevicePortForwarder extends DevicePortForwarder {
|
||||
process = await _processUtils.start(
|
||||
<String>[
|
||||
_iproxyPath,
|
||||
'$hostPort:$devicePort',
|
||||
'--udid',
|
||||
hostPort.toString(),
|
||||
devicePort.toString(),
|
||||
_id,
|
||||
],
|
||||
environment: Map<String, String>.fromEntries(
|
||||
|
||||
@@ -66,13 +66,11 @@ class IMobileDevice {
|
||||
}
|
||||
|
||||
/// Captures a screenshot to the specified outputFile.
|
||||
Future<void> takeScreenshot(File outputFile, String deviceID) {
|
||||
Future<void> takeScreenshot(File outputFile) {
|
||||
return _processUtils.run(
|
||||
<String>[
|
||||
_idevicescreenshotPath,
|
||||
outputFile.path,
|
||||
'--udid',
|
||||
deviceID,
|
||||
],
|
||||
throwOnError: true,
|
||||
environment: Map<String, String>.fromEntries(
|
||||
|
||||
@@ -22,14 +22,14 @@ void main() {
|
||||
const int devicePort = 456;
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>['iproxy', '49154:456', '--udid', '1234'],
|
||||
command: <String>['iproxy', '49154', '456', '1234'],
|
||||
// iproxy does not exit with 0 when it cannot forward.
|
||||
exitCode: 0,
|
||||
stdout: null, // no stdout indicates failure.
|
||||
environment: kDyLdLibEntry,
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>['iproxy', '49155:456', '--udid', '1234'],
|
||||
command: <String>['iproxy', '49155', '456', '1234'],
|
||||
exitCode: 0,
|
||||
stdout: 'not empty',
|
||||
environment: kDyLdLibEntry,
|
||||
|
||||
@@ -85,7 +85,7 @@ void main() {
|
||||
logger: logger,
|
||||
);
|
||||
|
||||
expect(() async => await iMobileDevice.takeScreenshot(mockOutputFile, '1234'), throwsA(anything));
|
||||
expect(() async => await iMobileDevice.takeScreenshot(mockOutputFile), throwsA(anything));
|
||||
});
|
||||
|
||||
testWithoutContext('idevicescreenshot captures and returns screenshot', () async {
|
||||
@@ -100,8 +100,8 @@ void main() {
|
||||
logger: logger,
|
||||
);
|
||||
|
||||
await iMobileDevice.takeScreenshot(mockOutputFile, '1234');
|
||||
verify(mockProcessManager.run(<String>[idevicescreenshotPath, outputPath, '--udid', '1234'],
|
||||
await iMobileDevice.takeScreenshot(mockOutputFile);
|
||||
verify(mockProcessManager.run(<String>[idevicescreenshotPath, outputPath],
|
||||
environment: <String, String>{'DYLD_LIBRARY_PATH': libimobiledevicePath},
|
||||
workingDirectory: null,
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user