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

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: Updated per Dave's comments. Created 7 years, 12 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/browser_backend.py
diff --git a/tools/telemetry/telemetry/browser_backend.py b/tools/telemetry/telemetry/browser_backend.py
index 702f249d95d9cd2b202b6ecd36c566a2af3b495a..0057432ac939813213974af13df479181bd428ae 100644
--- a/tools/telemetry/telemetry/browser_backend.py
+++ b/tools/telemetry/telemetry/browser_backend.py
@@ -60,6 +60,15 @@ class TabController(object):
util.WaitFor(lambda: not self._FindTabInfo(debugger_url), timeout=5)
self._UpdateTabList()
+ def ActivateTab(self, debugger_url, timeout=None):
+ tab_id = debugger_url.split('/')[-1]
+ try:
+ response = self._browser_backend.Request('activate/%s' % tab_id,
+ timeout=timeout)
dtu 2013/01/03 21:30:33 If it's not synchronous then do we need to wait fo
Danh Nguyen 2013/01/04 20:44:04 Done. Added the wait for webkitVisibilityState to
+ 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

Powered by Google App Engine
This is Rietveld 408576698