| 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 page_sets.system_health import platforms | 5 from page_sets.system_health import platforms |
| 6 from page_sets.system_health import story_tags |
| 6 from page_sets.system_health import system_health_story | 7 from page_sets.system_health import system_health_story |
| 7 from page_sets.system_health.loading_stories import LoadGmailMobileStory | 8 from page_sets.system_health.loading_stories import LoadGmailMobileStory |
| 8 | 9 |
| 9 from telemetry import decorators | 10 from telemetry import decorators |
| 10 | 11 |
| 11 _WAIT_FOR_VIDEO_SECONDS = 5 | 12 _WAIT_FOR_VIDEO_SECONDS = 5 |
| 12 | 13 |
| 13 class _BackgroundStory(system_health_story.SystemHealthStory): | 14 class _BackgroundStory(system_health_story.SystemHealthStory): |
| 14 """Abstract base class for background stories | 15 """Abstract base class for background stories |
| 15 | 16 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 39 NAME = 'background:social:facebook' | 40 NAME = 'background:social:facebook' |
| 40 URL = 'https://www.facebook.com/rihanna' | 41 URL = 'https://www.facebook.com/rihanna' |
| 41 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 42 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 42 | 43 |
| 43 | 44 |
| 44 class BackgroundNytimesMobileStory(_BackgroundStory): | 45 class BackgroundNytimesMobileStory(_BackgroundStory): |
| 45 """The third top website in http://www.alexa.com/topsites/category/News""" | 46 """The third top website in http://www.alexa.com/topsites/category/News""" |
| 46 NAME = 'background:news:nytimes' | 47 NAME = 'background:news:nytimes' |
| 47 URL = 'http://www.nytimes.com/2016/10/04/us/politics/vice-presidential-debate.
html?_r=0' | 48 URL = 'http://www.nytimes.com/2016/10/04/us/politics/vice-presidential-debate.
html?_r=0' |
| 48 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 49 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 50 TAGS = [story_tags.JAVASCRIPT_HEAVY] |
| 49 | 51 |
| 50 def _DidLoadDocument(self, action_runner): | 52 def _DidLoadDocument(self, action_runner): |
| 51 # Dismiss the 'You have n free articles' message. | 53 # Dismiss the 'You have n free articles' message. |
| 52 action_runner.WaitForElement(selector='.growl-dismiss') | 54 action_runner.WaitForElement(selector='.growl-dismiss') |
| 53 action_runner.TapElement(selector='.growl-dismiss') | 55 action_runner.TapElement(selector='.growl-dismiss') |
| 54 | 56 |
| 55 # Tap the 'Show Full Article' button. | 57 # Tap the 'Show Full Article' button. |
| 56 action_runner.WaitForElement(selector='#additional-content button') | 58 action_runner.WaitForElement(selector='#additional-content button') |
| 57 action_runner.ScrollPageToElement(selector='#additional-content button') | 59 action_runner.ScrollPageToElement(selector='#additional-content button') |
| 58 # TapElement seems flaky here so use JavaScript instead. | 60 # TapElement seems flaky here so use JavaScript instead. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 | 81 |
| 80 | 82 |
| 81 @decorators.Disabled('android') # crbug.com/676336 | 83 @decorators.Disabled('android') # crbug.com/676336 |
| 82 class BackgroundGmailMobileStory(LoadGmailMobileStory): | 84 class BackgroundGmailMobileStory(LoadGmailMobileStory): |
| 83 NAME = 'background:tools:gmail' | 85 NAME = 'background:tools:gmail' |
| 84 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 86 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 85 | 87 |
| 86 def _Measure(self, action_runner): | 88 def _Measure(self, action_runner): |
| 87 action_runner.tab.browser.Background() | 89 action_runner.tab.browser.Background() |
| 88 super(BackgroundGmailMobileStory, self)._Measure(action_runner) | 90 super(BackgroundGmailMobileStory, self)._Measure(action_runner) |
| OLD | NEW |