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

Unified Diff: tools/telemetry/telemetry/tab.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 | « tools/telemetry/telemetry/browser_backend.py ('k') | tools/telemetry/telemetry/tab_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/tab.py
diff --git a/tools/telemetry/telemetry/tab.py b/tools/telemetry/telemetry/tab.py
index 7f3730fa8e8b246947126299582b2d5ca7a986a6..3fc0dacc6c1002fb7027d8c4c6d3b128e7548e11 100644
--- a/tools/telemetry/telemetry/tab.py
+++ b/tools/telemetry/telemetry/tab.py
@@ -1,6 +1,7 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
from telemetry import inspector_backend
from telemetry import inspector_console
from telemetry import inspector_page
@@ -68,6 +69,16 @@ class Tab(object):
self.Disconnect()
self._tab_controller.CloseTab(self._debugger_url)
+ def Activate(self):
+ """Brings this tab to the foreground asynchronously.
+
+ Please note: this is asynchronous. There is a delay between this call
+ and the page's documentVisibilityState becoming 'visible', and yet more
+ delay until the actual tab is visible to the user. None of these delays
+ are included in this call."""
+ self._Connect()
+ self._tab_controller.ActivateTab(self._debugger_url)
+
@property
def browser(self):
"""The browser in which this tab resides."""
@@ -112,3 +123,4 @@ class Tab(object):
rs = self._runtime.Evaluate('document.readyState')
return rs == 'complete' or rs == 'interactive'
util.WaitFor(IsReadyStateInteractiveOrBetter, timeout)
+
« no previous file with comments | « tools/telemetry/telemetry/browser_backend.py ('k') | tools/telemetry/telemetry/tab_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698