OLD | NEW |
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 Loading... |
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() |
OLD | NEW |