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

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

Issue 11663011: Adds function for activating a tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved _IsDocumentVisible to module level. 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/tab.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 a20c06aa7075d2d5f0e4568ac11f6ae029bd8db0..358cf6358c5dfdd6e6b60d4a34eb779d10a7ad70 100644
--- a/tools/telemetry/telemetry/browser_backend.py
+++ b/tools/telemetry/telemetry/browser_backend.py
@@ -60,6 +60,16 @@ class TabController(object):
util.WaitFor(lambda: not self._FindTabInfo(debugger_url), timeout=5)
self._UpdateTabList()
+ def ActivateTab(self, debugger_url, timeout=None):
+ assert debugger_url in self._tab_dict
+ tab_id = debugger_url.split('/')[-1]
+ try:
+ response = self._browser_backend.Request('activate/%s' % tab_id,
+ timeout=timeout)
+ except urllib2.HTTPError:
+ raise Exception('Unable to activate tab, tab id not found: %s' % tab_id)
+ assert response == 'Target activated'
+
def GetTabUrl(self, debugger_url):
tab_info = self._FindTabInfo(debugger_url)
# TODO(hartmanng): crbug.com/166886 (uncomment the following assert and
« no previous file with comments | « no previous file | tools/telemetry/telemetry/tab.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698