| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 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 import os | 5 import os |
| 6 import re | 6 import re |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from devil.android.perf import cache_control |
| 10 from devil.android.sdk import intent |
| 9 from pylib import flag_changer | 11 from pylib import flag_changer |
| 10 from pylib.device import intent | |
| 11 from pylib.perf import cache_control | |
| 12 | 12 |
| 13 from profile_chrome import controllers | 13 from profile_chrome import controllers |
| 14 | 14 |
| 15 class ChromeStartupTracingController(controllers.BaseController): | 15 class ChromeStartupTracingController(controllers.BaseController): |
| 16 def __init__(self, device, package_info, cold, url): | 16 def __init__(self, device, package_info, cold, url): |
| 17 self._device = device | 17 self._device = device |
| 18 self._package_info = package_info | 18 self._package_info = package_info |
| 19 self._cold = cold | 19 self._cold = cold |
| 20 self._logcat_monitor = self._device.GetLogcatMonitor() | 20 self._logcat_monitor = self._device.GetLogcatMonitor() |
| 21 self._url = url | 21 self._url = url |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 finally: | 65 finally: |
| 66 self._TearDownTracing() | 66 self._TearDownTracing() |
| 67 | 67 |
| 68 def PullTrace(self): | 68 def PullTrace(self): |
| 69 # Wait a bit for the browser to finish writing the trace file. | 69 # Wait a bit for the browser to finish writing the trace file. |
| 70 time.sleep(3) | 70 time.sleep(3) |
| 71 trace_file = self._trace_file.replace('/storage/emulated/0/', '/sdcard/') | 71 trace_file = self._trace_file.replace('/storage/emulated/0/', '/sdcard/') |
| 72 host_file = os.path.join(os.path.curdir, os.path.basename(trace_file)) | 72 host_file = os.path.join(os.path.curdir, os.path.basename(trace_file)) |
| 73 self._device.PullFile(trace_file, host_file) | 73 self._device.PullFile(trace_file, host_file) |
| 74 return host_file | 74 return host_file |
| OLD | NEW |