- add sources.
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / page / actions / navigate_unittest.py
1 # Copyright 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 from telemetry.core import util
6 from telemetry.page import page as page_module
7 from telemetry.page.actions import navigate
8 from telemetry.unittest import tab_test_case
9
10
11 class NavigateActionTest(tab_test_case.TabTestCase):
12   def CreatePageFromUnittestDataDir(self, filename):
13     self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
14     return page_module.Page(
15         self._browser.http_server.UrlOf(filename),
16         None  # In this test, we don't need a page set.
17     )
18
19   def testNavigateAction(self):
20     self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
21
22     page = self.CreatePageFromUnittestDataDir('blank.html')
23     i = navigate.NavigateAction()
24     i.RunAction(page, self._tab, None)
25     self.assertEquals(
26         self._tab.EvaluateJavaScript('document.location.pathname;'),
27         '/blank.html')