Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2602)

Unified Diff: build/android/pylib/device/device_utils_test.py

Issue 1167693002: remove stale test data on the device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/device/device_utils_test.py
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index e395c8f33d36081a9b1c20a7182fa73a159ea4ca..76e10e42416771f34ddfc2c1624e7b07f17188f0 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -1144,6 +1144,25 @@ class DeviceUtilsPushChangedFilesZippedTest(DeviceUtilsTest):
[('/test/host/path/file1', '/test/device/path/file1'),
('/test/host/path/file2', '/test/device/path/file2')])
+class DeviceUtilsDeleteStaleFilesTest(DeviceUtilsTest):
+
+ def testDeleteStaleFiles_emtpy(self):
+ files = []
+ with self.assertCalls():
+ self.device._DeleteStaleFiles(files)
+
+ def testDeleteStaleFiles_single(self):
+ files = ['/test/device/path/file1']
+ with self.assertCalls((self.call.adb.Shell(
+ 'rm /test/device/path/file1'), '')):
+ self.device._DeleteStaleFiles(files)
+
+ def testDeleteStaleFiles_multiple(self):
+ files = ['/test/device/path/file1', '/test/device/path/file2']
+ with self.assertCalls(
+ (self.call.adb.Shell('rm /test/device/path/file1'), ''),
+ (self.call.adb.Shell('rm /test/device/path/file2'), '')):
+ self.device._DeleteStaleFiles(files)
class DeviceUtilsFileExistsTest(DeviceUtilsTest):

Powered by Google App Engine
This is Rietveld 408576698