Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py

Issue 471763003: Remove deprecated methods related to tracing in browser.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/timeline_controller.py ('k') | tools/telemetry/telemetry/core/browser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py
index 0f5027b188b83f66170b17f8ba119dedcdd27e5c..fffc978ca7458a979661179ac53e8c4758c21f8f 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py
@@ -8,6 +8,8 @@ import logging
import unittest
from telemetry.core import util
+from telemetry.core.platform import tracing_category_filter
+from telemetry.core.platform import tracing_options
from telemetry.timeline import model
from telemetry.timeline import tracing_timeline_data
from telemetry.unittest import tab_test_case
@@ -24,15 +26,18 @@ class TracingBackendTest(tab_test_case.TabTestCase):
util.WaitFor(_IsDone, 5)
def testGotTrace(self):
- if not self._browser.supports_tracing:
+ tracing_controller = self._browser.platform.tracing_controller
+ if not tracing_controller.IsChromeTracingSupported(self._browser):
logging.warning('Browser does not support tracing, skipping test.')
return
self._StartServer()
- self._browser.StartTracing()
- self._browser.StopTracing()
-
- # TODO(tengs): check model for correctness after trace_event_importer
- # is implemented (crbug.com/173327).
+ options = tracing_options.TracingOptions()
+ options.enable_chrome_trace = True
+ tracing_controller.Start(
+ options, tracing_category_filter.TracingCategoryFilter())
+ trace_data = tracing_controller.Stop()
+ # Test that trace data is parsable
+ model.TimelineModel(trace_data)
class ChromeTraceResultTest(unittest.TestCase):
« no previous file with comments | « tools/perf/measurements/timeline_controller.py ('k') | tools/telemetry/telemetry/core/browser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698