forked from firka/flutter
Fixes for Dart 2 failures in tests (#18371)
This commit is contained in:
committed by
GitHub
parent
b8b34def39
commit
aecb7d9607
@@ -510,7 +510,7 @@ class AndroidDevice extends Device {
|
||||
bool get supportsScreenshot => true;
|
||||
|
||||
@override
|
||||
Future<Null> takeScreenshot(File outputFile) async {
|
||||
Future<void> takeScreenshot(File outputFile) async {
|
||||
const String remotePath = '/data/local/tmp/flutter_screenshot.png';
|
||||
await runCheckedAsync(adbCommandForDevice(<String>['shell', 'screencap', '-p', remotePath]));
|
||||
await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path]));
|
||||
|
||||
@@ -277,7 +277,7 @@ abstract class Device {
|
||||
|
||||
bool get supportsScreenshot => false;
|
||||
|
||||
Future<Null> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
|
||||
Future<void> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
|
||||
|
||||
/// Find the apps that are currently running on this device.
|
||||
Future<List<DiscoveredApp>> discoverApps() =>
|
||||
|
||||
@@ -98,7 +98,7 @@ class IMobileDevice {
|
||||
Future<Process> startLogger() => runCommand(<String>['idevicesyslog']);
|
||||
|
||||
/// Captures a screenshot to the specified outputFile.
|
||||
Future<Null> takeScreenshot(File outputFile) {
|
||||
Future<void> takeScreenshot(File outputFile) {
|
||||
return runCheckedAsync(<String>['idevicescreenshot', outputFile.path]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class SimControl {
|
||||
return runCheckedAsync(args);
|
||||
}
|
||||
|
||||
Future<Null> takeScreenshot(String deviceId, String outputPath) {
|
||||
Future<void> takeScreenshot(String deviceId, String outputPath) {
|
||||
return runCheckedAsync(<String>[_xcrunPath, 'simctl', 'io', deviceId, 'screenshot', outputPath]);
|
||||
}
|
||||
}
|
||||
@@ -458,7 +458,7 @@ class IOSSimulator extends Device {
|
||||
bool get supportsScreenshot => _xcodeVersionSupportsScreenshot;
|
||||
|
||||
@override
|
||||
Future<Null> takeScreenshot(File outputFile) {
|
||||
Future<void> takeScreenshot(File outputFile) {
|
||||
return SimControl.instance.takeScreenshot(id, outputFile.path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user