| 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'):
|
|
|