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

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

Issue 839893004: Refactor test scripts for android to improve performance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip checking package on JBMR2 or above Created 5 years, 11 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
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58dd56ac9ee8a01abcde63f65744733a8f7d046b..72ab99ca03cb981f410ffd276990682c6a3b7650 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -930,19 +930,35 @@ class DeviceUtilsForceStopTest(DeviceUtilsNewImplTest):
class DeviceUtilsClearApplicationStateTest(DeviceUtilsNewImplTest):
def testClearApplicationState_packageDoesntExist(self):
- with self.assertCall(
- self.call.device.GetApplicationPath('this.package.does.not.exist'),
- None):
+ with self.assertCalls(
+ (self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
+ (self.call.device.GetApplicationPath('this.package.does.not.exist'),
+ None)):
+ self.device.ClearApplicationState('this.package.does.not.exist')
+
+ def testClearApplicationState_packageDoesntExistOnAndroidJBMR2OrAbove(self):
+ with self.assertCalls(
+ (self.call.adb.Shell('getprop ro.build.version.sdk'), '18\n'),
+ (self.call.adb.Shell('pm clear this.package.does.not.exist'),
+ 'Failed\r\n')):
self.device.ClearApplicationState('this.package.does.not.exist')
def testClearApplicationState_packageExists(self):
with self.assertCalls(
+ (self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
(self.call.device.GetApplicationPath('this.package.exists'),
'/data/app/this.package.exists.apk'),
(self.call.adb.Shell('pm clear this.package.exists'),
'Success\r\n')):
self.device.ClearApplicationState('this.package.exists')
+ def testClearApplicationState_packageExistsOnAndroidJBMR2OrAbove(self):
+ with self.assertCalls(
+ (self.call.adb.Shell('getprop ro.build.version.sdk'), '18\n'),
+ (self.call.adb.Shell('pm clear this.package.exists'),
+ 'Success\r\n')):
+ self.device.ClearApplicationState('this.package.exists')
+
class DeviceUtilsSendKeyEventTest(DeviceUtilsNewImplTest):
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698