| 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 time | 5 import time |
| 6 | 6 |
| 7 from battor import battor_wrapper | 7 from battor import battor_wrapper |
| 8 from telemetry import decorators | 8 from telemetry import decorators |
| 9 from telemetry.core import platform as platform_module | 9 from telemetry.core import platform as platform_module |
| 10 from telemetry.testing import browser_test_case | 10 from telemetry.testing import browser_test_case |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 tracing_controller = self._browser.platform.tracing_controller | 198 tracing_controller = self._browser.platform.tracing_controller |
| 199 config = tracing_config.TracingConfig() | 199 config = tracing_config.TracingConfig() |
| 200 config.enable_battor_trace = True | 200 config.enable_battor_trace = True |
| 201 tracing_controller.StartTracing(config) | 201 tracing_controller.StartTracing(config) |
| 202 # We wait 1s before starting and stopping tracing to avoid crbug.com/602266, | 202 # We wait 1s before starting and stopping tracing to avoid crbug.com/602266, |
| 203 # which would cause a crash otherwise. | 203 # which would cause a crash otherwise. |
| 204 time.sleep(1) | 204 time.sleep(1) |
| 205 trace_data = tracing_controller.StopTracing() | 205 trace_data = tracing_controller.StopTracing() |
| 206 self.assertTrue( | 206 self.assertTrue( |
| 207 trace_data.HasEventsFor(trace_data_module.BATTOR_TRACE_PART)) | 207 trace_data.HasTraceFor(trace_data_module.BATTOR_TRACE_PART)) |
| OLD | NEW |