mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
This reverts commit 09cca73aee
.
This commit is contained in:
parent
59aed97647
commit
b15798fa98
@ -1 +0,0 @@
|
|||||||
73b9c81e02f83060aa44bece963a62827908de68
|
|
@ -1 +1 @@
|
|||||||
6150fcd888a0ee8a69dd47328509ee608c2e02dc
|
569016da35ccea9d9b7c81954342fabb98149fb5
|
||||||
|
@ -1 +1 @@
|
|||||||
28812e5bed8621bd637b4129ab15a9c1abb9f57d
|
20a2f8dbddcf1a96ad4c720b9afd1d0876d17ffc
|
||||||
|
@ -1 +1 @@
|
|||||||
2ef3f4c83bce209247479e707eebd5a84f606e28
|
e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72
|
||||||
|
@ -1 +1 @@
|
|||||||
eb45fd21469fa35e9bbc3b0a15a962460b8d23a2
|
ce98c346b7c1dc2a21faea4fd3f32c88e27ca2af
|
||||||
|
@ -513,7 +513,7 @@ class IOSDevice extends Device {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> takeScreenshot(File outputFile) async {
|
Future<void> takeScreenshot(File outputFile) async {
|
||||||
await _iMobileDevice.takeScreenshot(outputFile);
|
await _iMobileDevice.takeScreenshot(outputFile, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -835,8 +835,8 @@ class IOSDevicePortForwarder extends DevicePortForwarder {
|
|||||||
process = await _processUtils.start(
|
process = await _processUtils.start(
|
||||||
<String>[
|
<String>[
|
||||||
_iproxyPath,
|
_iproxyPath,
|
||||||
hostPort.toString(),
|
'$hostPort:$devicePort',
|
||||||
devicePort.toString(),
|
'--udid',
|
||||||
_id,
|
_id,
|
||||||
],
|
],
|
||||||
environment: Map<String, String>.fromEntries(
|
environment: Map<String, String>.fromEntries(
|
||||||
|
@ -66,11 +66,13 @@ class IMobileDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Captures a screenshot to the specified outputFile.
|
/// Captures a screenshot to the specified outputFile.
|
||||||
Future<void> takeScreenshot(File outputFile) {
|
Future<void> takeScreenshot(File outputFile, String deviceID) {
|
||||||
return _processUtils.run(
|
return _processUtils.run(
|
||||||
<String>[
|
<String>[
|
||||||
_idevicescreenshotPath,
|
_idevicescreenshotPath,
|
||||||
outputFile.path,
|
outputFile.path,
|
||||||
|
'--udid',
|
||||||
|
deviceID,
|
||||||
],
|
],
|
||||||
throwOnError: true,
|
throwOnError: true,
|
||||||
environment: Map<String, String>.fromEntries(
|
environment: Map<String, String>.fromEntries(
|
||||||
|
@ -22,14 +22,14 @@ void main() {
|
|||||||
const int devicePort = 456;
|
const int devicePort = 456;
|
||||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['iproxy', '49154', '456', '1234'],
|
command: <String>['iproxy', '49154:456', '--udid', '1234'],
|
||||||
// iproxy does not exit with 0 when it cannot forward.
|
// iproxy does not exit with 0 when it cannot forward.
|
||||||
exitCode: 0,
|
exitCode: 0,
|
||||||
stdout: null, // no stdout indicates failure.
|
stdout: null, // no stdout indicates failure.
|
||||||
environment: kDyLdLibEntry,
|
environment: kDyLdLibEntry,
|
||||||
),
|
),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['iproxy', '49155', '456', '1234'],
|
command: <String>['iproxy', '49155:456', '--udid', '1234'],
|
||||||
exitCode: 0,
|
exitCode: 0,
|
||||||
stdout: 'not empty',
|
stdout: 'not empty',
|
||||||
environment: kDyLdLibEntry,
|
environment: kDyLdLibEntry,
|
||||||
|
@ -85,7 +85,7 @@ void main() {
|
|||||||
logger: logger,
|
logger: logger,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(() async => await iMobileDevice.takeScreenshot(mockOutputFile), throwsA(anything));
|
expect(() async => await iMobileDevice.takeScreenshot(mockOutputFile, '1234'), throwsA(anything));
|
||||||
});
|
});
|
||||||
|
|
||||||
testWithoutContext('idevicescreenshot captures and returns screenshot', () async {
|
testWithoutContext('idevicescreenshot captures and returns screenshot', () async {
|
||||||
@ -100,8 +100,8 @@ void main() {
|
|||||||
logger: logger,
|
logger: logger,
|
||||||
);
|
);
|
||||||
|
|
||||||
await iMobileDevice.takeScreenshot(mockOutputFile);
|
await iMobileDevice.takeScreenshot(mockOutputFile, '1234');
|
||||||
verify(mockProcessManager.run(<String>[idevicescreenshotPath, outputPath],
|
verify(mockProcessManager.run(<String>[idevicescreenshotPath, outputPath, '--udid', '1234'],
|
||||||
environment: <String, String>{'DYLD_LIBRARY_PATH': libimobiledevicePath},
|
environment: <String, String>{'DYLD_LIBRARY_PATH': libimobiledevicePath},
|
||||||
workingDirectory: null,
|
workingDirectory: null,
|
||||||
));
|
));
|
||||||
|
Loading…
Reference in New Issue
Block a user