OLD | NEW |
---|---|
(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') | |
OLD | NEW |