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

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

Issue 772003002: Migrate DeviceUtils.EnableRoot to adb_wrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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') | no next file » | 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 2afaedf336de7d2dc940637b00b0c5dbd34e0311..a2bbe0d2662ff53a03d7bbc5c28b3a7feee62265 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -295,29 +295,25 @@ class DeviceUtilsHasRootTest(DeviceUtilsNewImplTest):
self.assertFalse(self.device.HasRoot())
-class DeviceUtilsEnableRootTest(DeviceUtilsOldImplTest):
+class DeviceUtilsEnableRootTest(DeviceUtilsNewImplTest):
def testEnableRoot_succeeds(self):
- with self.assertCallsSequence([
- ('adb -s 0123456789abcdef shell getprop ro.build.type',
- 'userdebug\r\n'),
- ('adb -s 0123456789abcdef root', 'restarting adbd as root\r\n'),
- ('adb -s 0123456789abcdef wait-for-device', ''),
- ('adb -s 0123456789abcdef wait-for-device', '')]):
+ with self.assertCalls(
+ (self.call.device.IsUserBuild(), False),
+ self.call.adb.Root(),
+ self.call.adb.WaitForDevice()):
self.device.EnableRoot()
def testEnableRoot_userBuild(self):
- with self.assertCallsSequence([
- ('adb -s 0123456789abcdef shell getprop ro.build.type', 'user\r\n')]):
+ with self.assertCalls(
+ (self.call.device.IsUserBuild(), True)):
with self.assertRaises(device_errors.CommandFailedError):
self.device.EnableRoot()
def testEnableRoot_rootFails(self):
- with self.assertCallsSequence([
- ('adb -s 0123456789abcdef shell getprop ro.build.type',
- 'userdebug\r\n'),
- ('adb -s 0123456789abcdef root', 'no\r\n'),
- ('adb -s 0123456789abcdef wait-for-device', '')]):
+ with self.assertCalls(
+ (self.call.device.IsUserBuild(), False),
+ (self.call.adb.Root(), self.CommandError())):
with self.assertRaises(device_errors.CommandFailedError):
self.device.EnableRoot()
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698