OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2015 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 """Utility library for running a startup profile on an Android device. | 5 """Utility library for running a startup profile on an Android device. |
6 | 6 |
7 Sets up a device for cygprofile, disables sandboxing permissions, and sets up | 7 Sets up a device for cygprofile, disables sandboxing permissions, and sets up |
8 support for web page replay, device forwarding, and fake certificate authority | 8 support for web page replay, device forwarding, and fake certificate authority |
9 to make runs repeatable. | 9 to make runs repeatable. |
10 """ | 10 """ |
11 | 11 |
12 import logging | 12 import logging |
13 import os | 13 import os |
14 import shutil | 14 import shutil |
15 import subprocess | 15 import subprocess |
16 import sys | 16 import sys |
17 import tempfile | 17 import tempfile |
18 import time | 18 import time |
19 | 19 |
20 sys.path.append(os.path.join(sys.path[0], '..', '..', 'build', 'android')) | 20 sys.path.append(os.path.join(sys.path[0], '..', '..', 'build', 'android')) |
21 from devil.android import device_errors | 21 from devil.android import device_errors |
22 from devil.android import device_utils | 22 from devil.android import device_utils |
23 from devil.android import forwarder | 23 from devil.android import forwarder |
24 from devil.android.sdk import intent | 24 from devil.android.sdk import intent |
25 from pylib import constants | 25 from pylib import constants |
26 from pylib import flag_changer | 26 from pylib import flag_changer |
27 | 27 |
28 sys.path.append(os.path.join(sys.path[0], '..', '..', 'tools', 'telemetry')) | 28 sys.path.append(os.path.join(sys.path[0], '..', '..', 'tools', 'perf')) |
| 29 from chrome_telemetry_build import chromium_config |
| 30 sys.path.append(chromium_config.GetTelemetryDir()) |
29 from telemetry.internal.util import webpagereplay | 31 from telemetry.internal.util import webpagereplay |
30 | 32 |
31 sys.path.append(os.path.join(sys.path[0], '..', '..', | 33 sys.path.append(os.path.join(sys.path[0], '..', '..', |
32 'third_party', 'webpagereplay')) | 34 'third_party', 'webpagereplay')) |
33 import adb_install_cert | 35 import adb_install_cert |
34 import certutils | 36 import certutils |
35 | 37 |
36 | 38 |
37 class NoCyglogDataError(Exception): | 39 class NoCyglogDataError(Exception): |
38 """An error used to indicate that no cyglog data was collected.""" | 40 """An error used to indicate that no cyglog data was collected.""" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 print 'Pulling cyglog data...' | 354 print 'Pulling cyglog data...' |
353 self._SetUpHostFolders() | 355 self._SetUpHostFolders() |
354 self._device.PullFile( | 356 self._device.PullFile( |
355 self._DEVICE_CYGLOG_DIR, self._host_cyglog_dir) | 357 self._DEVICE_CYGLOG_DIR, self._host_cyglog_dir) |
356 files = os.listdir(self._host_cyglog_dir) | 358 files = os.listdir(self._host_cyglog_dir) |
357 | 359 |
358 if len(files) == 0: | 360 if len(files) == 0: |
359 raise NoCyglogDataError('No cyglog data was collected') | 361 raise NoCyglogDataError('No cyglog data was collected') |
360 | 362 |
361 return [os.path.join(self._host_cyglog_dir, x) for x in files] | 363 return [os.path.join(self._host_cyglog_dir, x) for x in files] |
OLD | NEW |