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

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

Issue 724413003: Migrate device_utils.RestartServer to adb_wrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased against master 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 16699adba1b6e39a531ef4454e70f45ec8639676..6b8082dec782fe28186cde7f27bad8a3f632cfcc 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -84,6 +84,22 @@ class DeviceUtilsGetAVDsTest(mock_calls.TestCase):
device_utils.GetAVDs())
+class DeviceUtilsRestartServerTest(mock_calls.TestCase):
+
+ @mock.patch('time.sleep', mock.Mock())
+ def testRestartServer_succeeds(self):
+ with self.assertCalls(
+ mock.call.pylib.device.adb_wrapper.AdbWrapper.KillServer(),
+ (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
+ (1, '')),
+ mock.call.pylib.device.adb_wrapper.AdbWrapper.StartServer(),
+ (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
+ (1, '')),
+ (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
+ (0, '123\n'))):
+ device_utils.RestartServer()
+
+
class MockTempFile(object):
def __init__(self, name='/tmp/some/file'):
« 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