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

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

Issue 277143003: Add NavigateToPage API for action_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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/actions/navigate.py
diff --git a/tools/telemetry/telemetry/page/actions/navigate.py b/tools/telemetry/telemetry/page/actions/navigate.py
index 0762c7e9080447fa0ca768d97b7917b9716bb189..ef68e2e659282f9ea7d3ba0f0f00a91eed766c90 100644
--- a/tools/telemetry/telemetry/page/actions/navigate.py
+++ b/tools/telemetry/telemetry/page/actions/navigate.py
@@ -1,23 +1,23 @@
# Copyright 2013 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.page.actions import page_action
+
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction, self).__init__(attributes)
+ assert hasattr(self, 'url'), 'Must specify url for navigate action'
- def RunAction(self, page, tab):
- if page.is_file:
- target_side_url = tab.browser.http_server.UrlOf(page.file_path_url)
- else:
- target_side_url = page.url
-
+ def RunAction(self, tab):
+ script_to_evaluate_on_commit = None
+ if hasattr(self, 'script_to_evaluate_on_commit'):
+ script_to_evaluate_on_commit = getattr(self,
+ 'script_to_evaluate_on_commit')
if hasattr(self, 'timeout_seconds') and self.timeout_seconds:
- tab.Navigate(target_side_url,
- page.script_to_evaluate_on_commit,
+ tab.Navigate(self.url,
+ script_to_evaluate_on_commit,
self.timeout_seconds)
else:
- tab.Navigate(target_side_url, page.script_to_evaluate_on_commit)
+ tab.Navigate(self.url, script_to_evaluate_on_commit)
tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()
« no previous file with comments | « tools/telemetry/telemetry/page/actions/media_action.py ('k') | tools/telemetry/telemetry/page/actions/navigate_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698