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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/tab.py

Issue 11361165: [chrome_remote_control] Rename chrome_remote_control to telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/chrome_remote_control/chrome_remote_control/tab.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/tab.py b/tools/chrome_remote_control/chrome_remote_control/tab.py
deleted file mode 100644
index da6061fa0a708ecae246290e01b43631ebe56e2d..0000000000000000000000000000000000000000
--- a/tools/chrome_remote_control/chrome_remote_control/tab.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# 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 chrome_remote_control import inspector_console
-from chrome_remote_control import inspector_page
-from chrome_remote_control import inspector_runtime
-from chrome_remote_control import util
-
-DEFAULT_TAB_TIMEOUT = 60
-
-class Tab(object):
- """Represents a tab in the browser
-
- The important parts of the Tab object are in the runtime and page objects.
- E.g.:
- # Navigates the tab to a given url.
- tab.page.Navigate('http://www.google.com/')
-
- # Evaluates 1+1 in the tab's javascript context.
- tab.runtime.Evaluate('1+1')
- """
- def __init__(self, browser, inspector_backend):
- self._browser = browser
- self._inspector_backend = inspector_backend
- self._page = inspector_page.InspectorPage(self._inspector_backend)
- self._runtime = inspector_runtime.InspectorRuntime(self._inspector_backend)
- self._console = inspector_console.InspectorConsole(self._inspector_backend)
-
- def __del__(self):
- self.Close()
-
- def Close(self):
- self._console = None
- self._runtime = None
- self._page = None
- if self._inspector_backend:
- self._inspector_backend.Close()
- self._inspector_backend = None
- self._browser = None
-
- def __enter__(self):
- return self
-
- def __exit__(self, *args):
- self.Close()
-
- @property
- def browser(self):
- """The browser in which this tab resides."""
- return self._browser
-
- @property
- def page(self):
- """Methods for interacting with the current page."""
- return self._page
-
- @property
- def runtime(self):
- """Methods for interacting with the page's javascript runtime."""
- return self._runtime
-
- @property
- def console(self):
- """Methods for interacting with the page's console objec."""
- return self._console
-
- def WaitForDocumentReadyStateToBeComplete(self, timeout=DEFAULT_TAB_TIMEOUT):
- util.WaitFor(
- lambda: self._runtime.Evaluate('document.readyState') == 'complete',
- timeout)
-
- def WaitForDocumentReadyStateToBeInteractiveOrBetter(
- self, timeout=DEFAULT_TAB_TIMEOUT):
- def IsReadyStateInteractiveOrBetter():
- rs = self._runtime.Evaluate('document.readyState')
- return rs == 'complete' or rs == 'interactive'
- util.WaitFor(IsReadyStateInteractiveOrBetter, timeout)

Powered by Google App Engine
This is Rietveld 408576698