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

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

Issue 22883011: Removing Page.WaitToLoad and update all pagesets to use explicit wait actions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/page/page.py
diff --git a/tools/telemetry/telemetry/page/page.py b/tools/telemetry/telemetry/page/page.py
index 5d06076a53824fe89a10693b5938ce7b608282f6..90eef0f0c1a879df0df7709d5ac93544002a251a 100644
--- a/tools/telemetry/telemetry/page/page.py
+++ b/tools/telemetry/telemetry/page/page.py
@@ -3,10 +3,9 @@
# found in the LICENSE file.
import os
import re
-import time
import urlparse
-from telemetry.core import util
+from telemetry.page.actions import navigate
def _UrlPathJoin(*args):
"""Joins each path in |args| for insertion into a URL path.
@@ -55,6 +54,7 @@ class Page(object):
self.credentials = None
self.disabled = False
self.script_to_evaluate_on_commit = None
+ self.navigate_actions = [navigate.NavigateAction()]
edmundyan 2013/08/20 23:02:40 This is to address the TODO in page_test to make a
if attributes:
for k, v in attributes.iteritems():
@@ -111,30 +111,3 @@ class Page(object):
def __str__(self):
return self.url
-
- def WaitToLoad(self, tab, timeout, poll_interval=0.1):
- Page.WaitForPageToLoad(self, tab, timeout, poll_interval)
-
- # TODO(dtu): Remove this method when no page sets use a click interaction
- # with a wait condition. crbug.com/168431
- @staticmethod
- def WaitForPageToLoad(obj, tab, timeout, poll_interval=0.1):
- """Waits for various wait conditions present in obj."""
- if hasattr(obj, 'wait_seconds'):
- time.sleep(obj.wait_seconds)
- if hasattr(obj, 'wait_for_element_with_text'):
- callback_code = 'function(element) { return element != null; }'
- util.WaitFor(
- lambda: util.FindElementAndPerformAction(
- tab, obj.wait_for_element_with_text, callback_code),
- timeout, poll_interval)
- if hasattr(obj, 'wait_for_element_with_selector'):
- util.WaitFor(lambda: tab.EvaluateJavaScript(
- 'document.querySelector(\'' + obj.wait_for_element_with_selector +
- '\') != null'), timeout, poll_interval)
- if hasattr(obj, 'post_navigate_javascript_to_execute'):
- tab.EvaluateJavaScript(obj.post_navigate_javascript_to_execute)
- if hasattr(obj, 'wait_for_javascript_expression'):
- util.WaitFor(
- lambda: tab.EvaluateJavaScript(obj.wait_for_javascript_expression),
- timeout, poll_interval)
« no previous file with comments | « tools/telemetry/telemetry/page/actions/tap_element.py ('k') | tools/telemetry/telemetry/page/page_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698