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

Side by Side 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: Creating explicit Javascript page action 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6
7 from telemetry.page import page as page_module
8 from telemetry.page.actions import navigate
9 from telemetry.unittest import tab_test_case
10
11
12 class NavigateActionTest(tab_test_case.TabTestCase):
13 def CreatePageFromUnittestDataDir(self, filename):
14 unittest_data_dir = os.path.join(os.path.dirname(__file__),
15 os.pardir, os.pardir, os.pardir,
16 'unittest_data')
17 self._browser.SetHTTPServerDirectories(unittest_data_dir)
18 return page_module.Page(
19 self._browser.http_server.UrlOf(filename),
20 None # In this test, we don't need a page set.
dennis_jeffrey 2013/08/14 22:21:04 indent the above 2 lines by 2 more spaces each, si
edmundyan 2013/08/14 23:37:59 Done.
21 )
22
23 def testNavigateAction(self):
24 unittest_data_dir = os.path.join(os.path.dirname(__file__),
25 os.pardir, os.pardir, os.pardir,
26 'unittest_data')
27 self._browser.SetHTTPServerDirectories(unittest_data_dir)
28
29 page = self.CreatePageFromUnittestDataDir('blank.html')
30 i = navigate.NavigateAction()
31 i.RunAction(page, self._tab, None)
32 self.assertEquals(
33 self._tab.EvaluateJavaScript('document.location.pathname;'),
34 '/blank.html')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698