| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from telemetry.core import util | 5 from telemetry.core import util |
| 6 from telemetry.page import page | 6 from telemetry.page import page |
| 7 from telemetry.page import cache_temperature as cache_temperature_module | 7 from telemetry.page import cache_temperature as cache_temperature_module |
| 8 from telemetry.page import shared_page_state | 8 from telemetry.page import shared_page_state |
| 9 | 9 |
| 10 | 10 |
| 11 _NAVIGATION_TIMEOUT = 180 | 11 _NAVIGATION_TIMEOUT = 180 |
| 12 _WEB_CONTENTS_TIMEOUT = 180 | 12 _WEB_CONTENTS_TIMEOUT = 180 |
| 13 | 13 |
| 14 class PageCyclerStory(page.Page): | 14 class PageCyclerStory(page.Page): |
| 15 | 15 |
| 16 def __init__(self, url, page_set, | 16 def __init__(self, url, page_set, |
| 17 shared_page_state_class=shared_page_state.SharedDesktopPageState, | 17 shared_page_state_class=shared_page_state.SharedDesktopPageState, |
| 18 cache_temperature=cache_temperature_module.ANY, **kwargs): | 18 cache_temperature=cache_temperature_module.ANY, name='', **kwargs): |
| 19 super(PageCyclerStory, self).__init__( | 19 super(PageCyclerStory, self).__init__( |
| 20 url=url, page_set=page_set, | 20 url=url, page_set=page_set, |
| 21 shared_page_state_class=shared_page_state_class, | 21 shared_page_state_class=shared_page_state_class, |
| 22 cache_temperature=cache_temperature, | 22 cache_temperature=cache_temperature, name=name, |
| 23 **kwargs) | 23 **kwargs) |
| 24 | 24 |
| 25 def RunNavigateSteps(self, action_runner): | 25 def RunNavigateSteps(self, action_runner): |
| 26 url = self.file_path_url_with_scheme if self.is_file else self.url | 26 url = self.file_path_url_with_scheme if self.is_file else self.url |
| 27 action_runner.Navigate(url, | 27 action_runner.Navigate(url, |
| 28 self.script_to_evaluate_on_commit, | 28 self.script_to_evaluate_on_commit, |
| 29 timeout_in_seconds=_NAVIGATION_TIMEOUT) | 29 timeout_in_seconds=_NAVIGATION_TIMEOUT) |
| 30 | 30 |
| 31 def RunPageInteractions(self, action_runner): | 31 def RunPageInteractions(self, action_runner): |
| 32 util.WaitFor(action_runner.tab.HasReachedQuiescence, | 32 util.WaitFor(action_runner.tab.HasReachedQuiescence, |
| 33 _WEB_CONTENTS_TIMEOUT) | 33 _WEB_CONTENTS_TIMEOUT) |
| OLD | NEW |