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

Unified Diff: tools/telemetry/telemetry/browser_backend.py

Issue 11975022: [Telemetry] Clean separation between tab (public) and tab_backend (Chrome); second attempt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « no previous file | tools/telemetry/telemetry/inspector_console.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/browser_backend.py
diff --git a/tools/telemetry/telemetry/browser_backend.py b/tools/telemetry/telemetry/browser_backend.py
index 153c4d13dc14bc2b937c79f7150ec27762b786c6..6b32213a8d76236c71a78732e09f211279764890 100644
--- a/tools/telemetry/telemetry/browser_backend.py
+++ b/tools/telemetry/telemetry/browser_backend.py
@@ -13,6 +13,7 @@ import weakref
from telemetry import browser_gone_exception
from telemetry import options_for_unittests
from telemetry import tab
+from telemetry import tab_backend
from telemetry import tracing_backend
from telemetry import user_agent
from telemetry import util
@@ -38,6 +39,8 @@ class TabController(object):
self._UpdateTabList()
def New(self, timeout=None):
+ assert self._browser.supports_tab_control
+
self._browser_backend.Request('new', timeout=timeout)
return self[-1]
@@ -46,6 +49,8 @@ class TabController(object):
return url in self._tab_list
def CloseTab(self, debugger_url, timeout=None):
+ assert self._browser.supports_tab_control
+
# TODO(dtu): crbug.com/160946, allow closing the last tab on some platforms.
# For now, just create a new tab before closing the last tab.
if len(self) <= 1:
@@ -63,6 +68,8 @@ class TabController(object):
self._UpdateTabList()
def ActivateTab(self, debugger_url, timeout=None):
+ assert self._browser.supports_tab_control
+
assert debugger_url in self._tab_dict
tab_id = debugger_url.split('/')[-1]
try:
@@ -96,7 +103,9 @@ class TabController(object):
# Lazily get/create a Tab object.
tab_object = self._tab_dict.get(debugger_url)
if not tab_object:
- tab_object = tab.Tab(self._browser, self._browser_backend, debugger_url)
+ backend = tab_backend.TabBackend(
+ self._browser, self._browser_backend, debugger_url)
+ tab_object = tab.Tab(backend)
self._tab_dict[debugger_url] = tab_object
return tab_object
« no previous file with comments | « no previous file | tools/telemetry/telemetry/inspector_console.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698