Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / page / actions / navigate.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 from telemetry.page.actions import page_action
5
6
7 class NavigateAction(page_action.PageAction):
8   def __init__(self, url, script_to_evaluate_on_commit=None,
9                timeout_in_seconds=60):
10     super(NavigateAction, self).__init__()
11     assert url, 'Must specify url for navigate action'
12     self._url = url
13     self._script_to_evaluate_on_commit = script_to_evaluate_on_commit
14     self._timeout_in_seconds = timeout_in_seconds
15
16   def RunAction(self, tab):
17     tab.Navigate(self._url,
18                  self._script_to_evaluate_on_commit,
19                  self._timeout_in_seconds)
20     tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()