| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from telemetry import story |
| 5 from telemetry.page import page as page_module |
| 4 from telemetry.page import shared_page_state | 6 from telemetry.page import shared_page_state |
| 5 from telemetry.page import page as page_module | |
| 6 from telemetry.page import page_set as page_set_module | |
| 7 | 7 |
| 8 | 8 |
| 9 def _GetCurrentLocation(action_runner): | 9 def _GetCurrentLocation(action_runner): |
| 10 return action_runner.EvaluateJavaScript('document.location.href') | 10 return action_runner.EvaluateJavaScript('document.location.href') |
| 11 | 11 |
| 12 | 12 |
| 13 def _WaitForLocationChange(action_runner, old_href): | 13 def _WaitForLocationChange(action_runner, old_href): |
| 14 action_runner.WaitForJavaScriptCondition( | 14 action_runner.WaitForJavaScriptCondition( |
| 15 'document.location.href != "%s"' % old_href) | 15 'document.location.href != "%s"' % old_href) |
| 16 | 16 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 'document.documentElement.scrollHeight - window.innerHeight - ' | 299 'document.documentElement.scrollHeight - window.innerHeight - ' |
| 300 'window.pageYOffset > 0') | 300 'window.pageYOffset > 0') |
| 301 | 301 |
| 302 # Scroll and wait again. | 302 # Scroll and wait again. |
| 303 with action_runner.CreateGestureInteraction('ScrollAction'): | 303 with action_runner.CreateGestureInteraction('ScrollAction'): |
| 304 action_runner.ScrollPage() | 304 action_runner.ScrollPage() |
| 305 action_runner.WaitForJavaScriptCondition( | 305 action_runner.WaitForJavaScriptCondition( |
| 306 'document.documentElement.scrollHeight - window.innerHeight - ' | 306 'document.documentElement.scrollHeight - window.innerHeight - ' |
| 307 'window.pageYOffset > 0') | 307 'window.pageYOffset > 0') |
| 308 | 308 |
| 309 class Top7StressPageSet(page_set_module.PageSet): | 309 class Top7StressPageSet(story.StorySet): |
| 310 | 310 |
| 311 """ Pages hand-picked for stress testing. """ | 311 """ Pages hand-picked for stress testing. """ |
| 312 | 312 |
| 313 def __init__(self): | 313 def __init__(self): |
| 314 super(Top7StressPageSet, self).__init__( | 314 super(Top7StressPageSet, self).__init__( |
| 315 archive_data_file='data/top_7_stress.json', | 315 archive_data_file='data/top_7_stress.json', |
| 316 bucket=page_set_module.PARTNER_BUCKET) | 316 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 317 | 317 |
| 318 self.AddUserStory(GoogleWebSearchPage(self)) | 318 self.AddUserStory(GoogleWebSearchPage(self)) |
| 319 self.AddUserStory(GmailPage(self)) | 319 self.AddUserStory(GmailPage(self)) |
| 320 self.AddUserStory(GoogleCalendarPage(self)) | 320 self.AddUserStory(GoogleCalendarPage(self)) |
| 321 self.AddUserStory(GooglePlusPage(self)) | 321 self.AddUserStory(GooglePlusPage(self)) |
| 322 self.AddUserStory(BlogspotPage(self)) | 322 self.AddUserStory(BlogspotPage(self)) |
| 323 self.AddUserStory(WordpressPage(self)) | 323 self.AddUserStory(WordpressPage(self)) |
| 324 self.AddUserStory(FacebookPage(self)) | 324 self.AddUserStory(FacebookPage(self)) |
| OLD | NEW |