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

Unified Diff: tools/telemetry/telemetry/unittest/navigate_test.py

Issue 151003003: Fix navigation to unittest files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert changes in memory_cache_http_unittest.py Created 6 years, 10 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/unittest/navigate_test.py
diff --git a/tools/telemetry/telemetry/unittest/navigate_test.py b/tools/telemetry/telemetry/unittest/navigate_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..2f8dcfd7c47c219606a8c6253f36449cf9da07bd
--- /dev/null
+++ b/tools/telemetry/telemetry/unittest/navigate_test.py
@@ -0,0 +1,20 @@
+# Copyright 2014 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.core import util
+
+def NavigateToTestFile(tab, filename, script_to_evaluate_on_commit=None):
+ """Navigates |tab| to |filename| in the unittest data directory.
+
+ Also sets up http server to point to the unittest data directory.
+ """
+ tab.browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
+ path = os.path.join(util.GetUnittestDataDir(), filename)
+ tab.Navigate(tab.browser.http_server.UrlOf(path),
+ script_to_evaluate_on_commit)
+ tab.WaitForDocumentReadyStateToBeComplete()
+ return path
+
« no previous file with comments | « tools/telemetry/telemetry/page/actions/wait_unittest.py ('k') | tools/telemetry/telemetry/unittest/tab_test_case.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698