OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
11 import datetime | 11 import datetime |
12 import logging | 12 import logging |
13 import os | 13 import os |
14 import re | 14 import re |
15 import shlex | 15 import shlex |
16 import subprocess | 16 import subprocess |
17 import sys | 17 import sys |
18 import tempfile | 18 import tempfile |
19 import time | 19 import time |
20 | 20 |
21 import io_stats_parser | 21 import io_stats_parser |
22 from pylib import pexpect | 22 # pexpect is not available on all platforms. We allow this file to be imported |
23 # on platforms without pexpect and only fail when pexpect is actually used. | |
bulach
2012/10/23 10:41:25
nit: nduca added our own wrapper in build/android/
| |
24 try: | |
25 from pylib import pexpect | |
26 except: | |
27 pexpect = None | |
23 | 28 |
24 CHROME_SRC = os.path.join( | 29 CHROME_SRC = os.path.join( |
25 os.path.abspath(os.path.dirname(__file__)), '..', '..', '..') | 30 os.path.abspath(os.path.dirname(__file__)), '..', '..', '..') |
26 | 31 |
27 sys.path.append(os.path.join(CHROME_SRC, 'third_party', 'android_testrunner')) | 32 sys.path.append(os.path.join(CHROME_SRC, 'third_party', 'android_testrunner')) |
28 import adb_interface | 33 import adb_interface |
29 | 34 |
30 import cmd_helper | 35 import cmd_helper |
31 import errors # is under ../../../third_party/android_testrunner/errors.py | 36 import errors # is under ../../../third_party/android_testrunner/errors.py |
32 | 37 |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1062 def __init__(self, output): | 1067 def __init__(self, output): |
1063 self._output = output | 1068 self._output = output |
1064 | 1069 |
1065 def write(self, data): | 1070 def write(self, data): |
1066 data = data.replace('\r\r\n', '\n') | 1071 data = data.replace('\r\r\n', '\n') |
1067 self._output.write(data) | 1072 self._output.write(data) |
1068 | 1073 |
1069 def flush(self): | 1074 def flush(self): |
1070 self._output.flush() | 1075 self._output.flush() |
1071 | 1076 |
OLD | NEW |