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

Unified Diff: tools/telemetry/telemetry/page/actions/navigate_unittest.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
« no previous file with comments | « tools/telemetry/telemetry/page/actions/navigate.py ('k') | tools/telemetry/telemetry/page/page_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/navigate_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/navigate_unittest.py b/tools/telemetry/telemetry/page/actions/navigate_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..73db13d136a02e3968bdb7f30f4e1325c38852b0
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/navigate_unittest.py
@@ -0,0 +1,34 @@
+# 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.
+
+import os
+
+from telemetry.page import page as page_module
+from telemetry.page.actions import navigate
+from telemetry.unittest import tab_test_case
+
+
+class NavigateActionTest(tab_test_case.TabTestCase):
+ def CreatePageFromUnittestDataDir(self, filename):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
+ os.pardir, os.pardir, os.pardir,
+ 'unittest_data')
+ self._browser.SetHTTPServerDirectories(unittest_data_dir)
+ return page_module.Page(
+ self._browser.http_server.UrlOf(filename),
+ None # In this test, we don't need a page set.
+ )
+
+ def testNavigateAction(self):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
+ os.pardir, os.pardir, os.pardir,
+ 'unittest_data')
+ self._browser.SetHTTPServerDirectories(unittest_data_dir)
+
+ page = self.CreatePageFromUnittestDataDir('blank.html')
+ i = navigate.NavigateAction()
+ i.RunAction(page, self._tab, None)
+ self.assertEquals(
+ self._tab.EvaluateJavaScript('document.location.pathname;'),
+ '/blank.html')
« no previous file with comments | « tools/telemetry/telemetry/page/actions/navigate.py ('k') | tools/telemetry/telemetry/page/page_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698