Unverified Commit aecb7d96 authored by Keerti Parthasarathy's avatar Keerti Parthasarathy Committed by GitHub

Fixes for Dart 2 failures in tests (#18371)

parent b8b34def
...@@ -510,7 +510,7 @@ class AndroidDevice extends Device { ...@@ -510,7 +510,7 @@ class AndroidDevice extends Device {
bool get supportsScreenshot => true; bool get supportsScreenshot => true;
@override @override
Future<Null> takeScreenshot(File outputFile) async { Future<void> takeScreenshot(File outputFile) async {
const String remotePath = '/data/local/tmp/flutter_screenshot.png'; const String remotePath = '/data/local/tmp/flutter_screenshot.png';
await runCheckedAsync(adbCommandForDevice(<String>['shell', 'screencap', '-p', remotePath])); await runCheckedAsync(adbCommandForDevice(<String>['shell', 'screencap', '-p', remotePath]));
await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path])); await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path]));
......
...@@ -277,7 +277,7 @@ abstract class Device { ...@@ -277,7 +277,7 @@ abstract class Device {
bool get supportsScreenshot => false; 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. /// Find the apps that are currently running on this device.
Future<List<DiscoveredApp>> discoverApps() => Future<List<DiscoveredApp>> discoverApps() =>
......
...@@ -98,7 +98,7 @@ class IMobileDevice { ...@@ -98,7 +98,7 @@ class IMobileDevice {
Future<Process> startLogger() => runCommand(<String>['idevicesyslog']); Future<Process> startLogger() => runCommand(<String>['idevicesyslog']);
/// Captures a screenshot to the specified outputFile. /// Captures a screenshot to the specified outputFile.
Future<Null> takeScreenshot(File outputFile) { Future<void> takeScreenshot(File outputFile) {
return runCheckedAsync(<String>['idevicescreenshot', outputFile.path]); return runCheckedAsync(<String>['idevicescreenshot', outputFile.path]);
} }
} }
......
...@@ -137,7 +137,7 @@ class SimControl { ...@@ -137,7 +137,7 @@ class SimControl {
return runCheckedAsync(args); 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]); return runCheckedAsync(<String>[_xcrunPath, 'simctl', 'io', deviceId, 'screenshot', outputPath]);
} }
} }
...@@ -458,7 +458,7 @@ class IOSSimulator extends Device { ...@@ -458,7 +458,7 @@ class IOSSimulator extends Device {
bool get supportsScreenshot => _xcodeVersionSupportsScreenshot; bool get supportsScreenshot => _xcodeVersionSupportsScreenshot;
@override @override
Future<Null> takeScreenshot(File outputFile) { Future<void> takeScreenshot(File outputFile) {
return SimControl.instance.takeScreenshot(id, outputFile.path); return SimControl.instance.takeScreenshot(id, outputFile.path);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment