| 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 system_health_story | 6 from page_sets.system_health import system_health_story |
| 7 | 7 |
| 8 | 8 |
| 9 class _BrowsingStory(system_health_story.SystemHealthStory): | 9 class _BrowsingStory(system_health_story.SystemHealthStory): |
| 10 """Abstract base class for browsing stories. | 10 """Abstract base class for browsing stories. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 ITEMS_TO_VISIT = 2 | 87 ITEMS_TO_VISIT = 2 |
| 88 # TODO(ulan): Enable this story on mobile once it uses less memory and | 88 # TODO(ulan): Enable this story on mobile once it uses less memory and |
| 89 # does not crash with OOM. | 89 # does not crash with OOM. |
| 90 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 90 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 91 | 91 |
| 92 | 92 |
| 93 class FacebookMobileStory(_NewsBrowsingStory): | 93 class FacebookMobileStory(_NewsBrowsingStory): |
| 94 NAME = 'browse:social:facebook' | 94 NAME = 'browse:social:facebook' |
| 95 URL = 'https://www.facebook.com/rihanna' | 95 URL = 'https://www.facebook.com/rihanna' |
| 96 ITEM_SELECTOR = 'article ._5msj' | 96 ITEM_SELECTOR = 'article ._5msj' |
| 97 # Facebook on desktop is not interesting because it embeds post comments | |
| 98 # directly in the main timeline. | |
| 99 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 97 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 100 | 98 |
| 101 | 99 |
| 100 class FacebookDesktopStory(_NewsBrowsingStory): |
| 101 NAME = 'browse:social:facebook' |
| 102 URL = 'https://www.facebook.com/rihanna' |
| 103 ITEM_SELECTOR = '._4-eo' |
| 104 IS_SINGLE_PAGE_APP = True |
| 105 # Web-page-replay does not work for this website: |
| 106 # https://github.com/chromium/web-page-replay/issues/79. |
| 107 SUPPORTED_PLATFORMS = platforms.NO_PLATFORMS |
| 108 |
| 109 |
| 102 class HackerNewsStory(_NewsBrowsingStory): | 110 class HackerNewsStory(_NewsBrowsingStory): |
| 103 NAME = 'browse:news:hackernews' | 111 NAME = 'browse:news:hackernews' |
| 104 URL = 'https://news.ycombinator.com' | 112 URL = 'https://news.ycombinator.com' |
| 105 ITEM_SELECTOR = '.athing .title > a' | 113 ITEM_SELECTOR = '.athing .title > a' |
| 106 | 114 |
| 107 | 115 |
| 108 class NytimesMobileStory(_NewsBrowsingStory): | 116 class NytimesMobileStory(_NewsBrowsingStory): |
| 109 """The third top website in http://www.alexa.com/topsites/category/News""" | 117 """The third top website in http://www.alexa.com/topsites/category/News""" |
| 110 NAME = 'browse:news:nytimes' | 118 NAME = 'browse:news:nytimes' |
| 111 URL = 'http://mobile.nytimes.com' | 119 URL = 'http://mobile.nytimes.com' |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 """The top website in http://www.alexa.com/topsites/category/News""" | 153 """The top website in http://www.alexa.com/topsites/category/News""" |
| 146 NAME = 'browse:news:reddit' | 154 NAME = 'browse:news:reddit' |
| 147 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' | 155 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' |
| 148 IS_SINGLE_PAGE_APP = True | 156 IS_SINGLE_PAGE_APP = True |
| 149 ITEM_SELECTOR = '.PostHeader__post-title-line' | 157 ITEM_SELECTOR = '.PostHeader__post-title-line' |
| 150 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 158 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 151 | 159 |
| 152 | 160 |
| 153 class TwitterMobileStory(_NewsBrowsingStory): | 161 class TwitterMobileStory(_NewsBrowsingStory): |
| 154 NAME = 'browse:social:twitter' | 162 NAME = 'browse:social:twitter' |
| 155 URL = 'https://www.twitter.com/justinbieber?skip_interstitial=true' | 163 URL = 'https://www.twitter.com/nasa' |
| 156 ITEM_SELECTOR = '.Tweet-text' | 164 ITEM_SELECTOR = '.Tweet-text' |
| 157 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 165 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 158 | 166 |
| 159 | 167 |
| 160 class TwitterDesktopStory(_NewsBrowsingStory): | 168 class TwitterDesktopStory(_NewsBrowsingStory): |
| 161 NAME = 'browse:social:twitter' | 169 NAME = 'browse:social:twitter' |
| 162 URL = 'https://www.twitter.com/justinbieber?skip_interstitial=true' | 170 URL = 'https://www.twitter.com/nasa' |
| 163 IS_SINGLE_PAGE_APP = True | 171 IS_SINGLE_PAGE_APP = True |
| 164 ITEM_SELECTOR = '.tweet-text' | 172 ITEM_SELECTOR = '.tweet-text' |
| 165 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 173 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 166 | 174 |
| 167 | 175 |
| 168 class WashingtonPostMobileStory(_NewsBrowsingStory): | 176 class WashingtonPostMobileStory(_NewsBrowsingStory): |
| 169 """Progressive website""" | 177 """Progressive website""" |
| 170 NAME = 'browse:news:washingtonpost' | 178 NAME = 'browse:news:washingtonpost' |
| 171 URL = 'https://www.washingtonpost.com/pwa' | 179 URL = 'https://www.washingtonpost.com/pwa' |
| 172 IS_SINGLE_PAGE_APP = True | 180 IS_SINGLE_PAGE_APP = True |
| 173 ITEM_SELECTOR = '.hed > a' | 181 ITEM_SELECTOR = '.hed > a' |
| 174 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 175 | 183 |
| 176 def _DidLoadDocument(self, action_runner): | 184 def _DidLoadDocument(self, action_runner): |
| 177 # Close the popup window. | 185 # Close the popup window. |
| 178 action_runner.ClickElement(selector='.close') | 186 action_runner.ClickElement(selector='.close') |
| 179 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) | 187 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) |
| OLD | NEW |