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

Side by Side Diff: telemetry/telemetry/internal/actions/navigate.py

Issue 2978643002: Removing bad-continuation param and fixing resulting errors. Fixed indentation errors, in telemetry… (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « telemetry/telemetry/internal/actions/key_event_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import time 5 import time
6 6
7 from telemetry.internal.actions import page_action 7 from telemetry.internal.actions import page_action
8 8
9 9
10 class NavigateAction(page_action.PageAction): 10 class NavigateAction(page_action.PageAction):
11 def __init__(self, url, script_to_evaluate_on_commit=None, 11 def __init__(self, url, script_to_evaluate_on_commit=None,
12 timeout_in_seconds=60): 12 timeout_in_seconds=60):
13 super(NavigateAction, self).__init__() 13 super(NavigateAction, self).__init__()
14 assert url, 'Must specify url for navigate action' 14 assert url, 'Must specify url for navigate action'
15 self._url = url 15 self._url = url
16 self._script_to_evaluate_on_commit = script_to_evaluate_on_commit 16 self._script_to_evaluate_on_commit = script_to_evaluate_on_commit
17 self._timeout_in_seconds = timeout_in_seconds 17 self._timeout_in_seconds = timeout_in_seconds
18 18
19 def RunAction(self, tab): 19 def RunAction(self, tab):
20 start_time = time.time() 20 start_time = time.time()
21 tab.Navigate(self._url, 21 tab.Navigate(self._url,
22 self._script_to_evaluate_on_commit, 22 self._script_to_evaluate_on_commit,
23 self._timeout_in_seconds) 23 self._timeout_in_seconds)
24 24
25 time_left_in_seconds = (start_time + self._timeout_in_seconds 25 time_left_in_seconds = (start_time + self._timeout_in_seconds \
26 - time.time()) 26 - time.time())
27 time_left_in_seconds = max(0, time_left_in_seconds) 27 time_left_in_seconds = max(0, time_left_in_seconds)
28 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter( 28 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter(
29 time_left_in_seconds) 29 time_left_in_seconds)
30 tab.WaitForFrameToBeDisplayed() 30 tab.WaitForFrameToBeDisplayed()
OLDNEW
« no previous file with comments | « telemetry/telemetry/internal/actions/key_event_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698