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

Unified Diff: tools/telemetry/telemetry/core/tab_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
Index: tools/telemetry/telemetry/core/tab_unittest.py
diff --git a/tools/telemetry/telemetry/core/tab_unittest.py b/tools/telemetry/telemetry/core/tab_unittest.py
index 2f5cb694fd2dce479096443caac086777ffffc39..0c02780125c199109eb932789593ff0dc8c23c6c 100644
--- a/tools/telemetry/telemetry/core/tab_unittest.py
+++ b/tools/telemetry/telemetry/core/tab_unittest.py
@@ -11,6 +11,7 @@ from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core import video
from telemetry.core.platform import tracing_category_filter
+from telemetry.core.platform import tracing_options
from telemetry.timeline import model
from telemetry.unittest import tab_test_case
@@ -103,10 +104,13 @@ class TabTest(tab_test_case.TabTestCase):
def testHighlight(self):
self.assertEquals(self._tab.url, 'about:blank')
- self._browser.StartTracing()
+ options = tracing_options.TracingOptions()
+ options.enable_chrome_trace = True
+ self._browser.platform.tracing_controller.Start(
+ options, tracing_category_filter.CreateNoOverheadFilter())
self._tab.Highlight(bitmap.WEB_PAGE_TEST_ORANGE)
self._tab.ClearHighlight(bitmap.WEB_PAGE_TEST_ORANGE)
- trace_data = self._browser.StopTracing()
+ trace_data = self._browser.platform.tracing_controller.Stop()
timeline_model = model.TimelineModel(trace_data)
renderer_thread = timeline_model.GetRendererThreadFromTabId(
self._tab.id)
@@ -120,7 +124,8 @@ class TabTest(tab_test_case.TabTestCase):
@benchmark.Enabled('has tabs')
def testGetRendererThreadFromTabId(self):
self.assertEquals(self._tab.url, 'about:blank')
- # Create 3 tabs. The third tab is closed before we call StartTracing.
+ # Create 3 tabs. The third tab is closed before we call
+ # tracing_controller.Start.
first_tab = self._tab
second_tab = self._browser.tabs.New()
second_tab.Navigate('about:blank')
@@ -129,14 +134,15 @@ class TabTest(tab_test_case.TabTestCase):
third_tab.Navigate('about:blank')
third_tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()
third_tab.Close()
-
- self._browser.StartTracing(
- tracing_category_filter.CreateNoOverheadFilter())
+ options = tracing_options.TracingOptions()
+ options.enable_chrome_trace = True
+ self._browser.platform.tracing_controller.Start(
+ options, tracing_category_filter.CreateNoOverheadFilter())
first_tab.ExecuteJavaScript('console.time("first-tab-marker");')
first_tab.ExecuteJavaScript('console.timeEnd("first-tab-marker");')
second_tab.ExecuteJavaScript('console.time("second-tab-marker");')
second_tab.ExecuteJavaScript('console.timeEnd("second-tab-marker");')
- trace_data = self._browser.StopTracing()
+ trace_data = self._browser.platform.tracing_controller.Stop()
timeline_model = model.TimelineModel(trace_data)
# Assert that the renderer_thread of the first tab contains
« no previous file with comments | « tools/telemetry/telemetry/core/browser_unittest.py ('k') | tools/telemetry/telemetry/page/actions/action_runner_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698