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

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

Issue 21174002: Allow defining custom navigation on a per-page basis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed changes. Updating tab_switching measurement 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/actions/navigate.py
diff --git a/tools/telemetry/telemetry/page/actions/navigate.py b/tools/telemetry/telemetry/page/actions/navigate.py
new file mode 100644
index 0000000000000000000000000000000000000000..0eb85705fb2376469d260c733f8d6d5745f02365
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/navigate.py
@@ -0,0 +1,20 @@
+# Copyright (c) 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)
+
+ def RunAction(self, page, tab, previous_action):
+ if page.is_file:
+ filename = page.serving_dirs_and_file[1]
+ target_side_url = tab.browser.http_server.UrlOf(filename)
+ else:
+ target_side_url = page.url
+
+ tab.Navigate(target_side_url, page.script_to_evaluate_on_commit)
+ tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()
« no previous file with comments | « tools/telemetry/telemetry/page/actions/javascript.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