Index: tools/testing/dart/android.dart |
diff --git a/tools/testing/dart/android.dart b/tools/testing/dart/android.dart |
index 985f6bc99a7ba67b6313d82698b5f6a753ed5474..96ac6030ab16f79c05dee5588312028992d90ab3 100644 |
--- a/tools/testing/dart/android.dart |
+++ b/tools/testing/dart/android.dart |
@@ -193,6 +193,7 @@ class AndroidHelper { |
class AdbDevice { |
static const _adbServerStartupTime = const Duration(seconds: 3); |
String _deviceId; |
+ List<String> _cachedData = new List<String>(); |
String get deviceId => _deviceId; |
@@ -248,6 +249,18 @@ class AdbDevice { |
} |
/** |
+ * Upload data to the device only on first use of [remote]. |
+ */ |
+ Future pushCachedData(String local, String remote) { |
+ if (_cachedData.contains(remote)) { |
+ return new Future.value(new AdbCommandResult( |
+ "Skipped cached push", "", "", 0, false)); |
+ } |
+ _cachedData.add(remote); |
+ return _adbCommand(['push', local, remote]); |
kustermann
2017/03/19 17:11:05
This is not quite safe I think: It's possible to r
|
+ } |
+ |
+ /** |
* Change permission of directory recursively. |
*/ |
Future chmod(String mode, Path directory) { |
@@ -416,6 +429,7 @@ class AdbDevicePool { |
'No android devices found. ' |
'Please make sure "adb devices" shows your device!'); |
} |
+ print("Found ${devices.length} Android devices."); |
return new AdbDevicePool(devices); |
} |