| 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 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry import story | 5 from telemetry import story |
| 6 | 6 |
| 7 | 7 |
| 8 # TODO(rnephew): Move to seperate file and merge with mac_gpu_sites BasePage. |
| 9 class _BasePage(page_module.Page): |
| 10 def __init__(self, page_set, url, wait_in_seconds): |
| 11 super(_BasePage, self).__init__(url=url, page_set=page_set) |
| 12 self._wait_in_seconds = wait_in_seconds |
| 13 |
| 14 def RunPageInteractions(self, action_runner): |
| 15 action_runner.Wait(self._wait_in_seconds) |
| 16 |
| 17 |
| 8 class IdleAfterLoadingStories(story.StorySet): | 18 class IdleAfterLoadingStories(story.StorySet): |
| 9 """Historically, Chrome has high CPU usage on these sites after the page has | 19 """Historically, Chrome has high CPU usage on these sites after the page has |
| 10 loaded. These user stories let Chrome idle on the page.""" | 20 loaded. These user stories let Chrome idle on the page.""" |
| 11 | 21 |
| 12 def __init__(self): | 22 def __init__(self, wait_in_seconds=0): |
| 13 super(IdleAfterLoadingStories, self).__init__( | 23 super(IdleAfterLoadingStories, self).__init__( |
| 14 archive_data_file='data/idle_after_loading_stories.json', | 24 archive_data_file='data/idle_after_loading_stories.json', |
| 15 cloud_storage_bucket=story.PARTNER_BUCKET) | 25 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 16 | 26 |
| 17 # Chrome has high idle CPU usage on this site, even after its quiesced. | 27 # Chrome has high idle CPU usage on this site, even after its quiesced. |
| 18 # https://crbug.com/638365. | 28 # https://crbug.com/638365. |
| 19 self.AddStory(page_module.Page( | 29 urls = [ |
| 20 'http://www.labradortraininghq.com/labrador-training/how-to-crate-train' | 30 'http://www.labradortraininghq.com/labrador-training/how-to-crate-train' |
| 21 '-a-puppy/#How_Long_DoesIt_Take_To_Crate_Train_A_Puppy', page_set=self)) | 31 '-a-puppy/#How_Long_DoesIt_Take_To_Crate_Train_A_Puppy' |
| 32 ] |
| 33 for url in urls: |
| 34 self.AddStory(_BasePage(self, url, wait_in_seconds)) |
| OLD | NEW |