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

Side by Side Diff: build/android/pylib/device/device_utils_device_test.py

Issue 1282563003: [Android] Convert RestartAdbd to DeviceUtils again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add device test Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Unit tests for the contents of device_utils.py (mostly DeviceUtils). 7 Unit tests for the contents of device_utils.py (mostly DeviceUtils).
8 The test will invoke real devices 8 The test will invoke real devices
9 """ 9 """
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 self.assertEqual(_OLD_CONTENTS, result) 200 self.assertEqual(_OLD_CONTENTS, result)
201 201
202 result = self.device.RunShellCommand(["ls", "%s/%s/%s" 202 result = self.device.RunShellCommand(["ls", "%s/%s/%s"
203 % (_DEVICE_DIR, _SUB_DIR, _SUB_DIR2)], 203 % (_DEVICE_DIR, _SUB_DIR, _SUB_DIR2)],
204 single_line=True) 204 single_line=True)
205 self.assertEqual('', result) 205 self.assertEqual('', result)
206 206
207 self.device.RunShellCommand(['rm', '-rf', _DEVICE_DIR]) 207 self.device.RunShellCommand(['rm', '-rf', _DEVICE_DIR])
208 cmd_helper.RunCmd(['rm', '-rf', host_tmp_dir]) 208 cmd_helper.RunCmd(['rm', '-rf', host_tmp_dir])
209 209
210 def testRestartAdbd(self):
211 old_adbd_pid = self.device.RunShellCommand(
212 ['ps', '|', 'grep', 'adbd'])[1].split()[1]
213 self.device.RestartAdbd()
214 new_adbd_pid = self.device.RunShellCommand(
215 ['ps', '|', 'grep', 'adbd'])[1].split()[1]
216 self.assertNotEqual(old_adbd_pid, new_adbd_pid)
217
218
210 if __name__ == '__main__': 219 if __name__ == '__main__':
211 unittest.main() 220 unittest.main()
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698