Chromium Code Reviews| 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. | |
|
ulan
2016/07/18 11:07:26
The comment was not entirely correct: photo posts
| |
| 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 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | |
| 106 | |
| 107 | |
| 102 class HackerNewsStory(_NewsBrowsingStory): | 108 class HackerNewsStory(_NewsBrowsingStory): |
| 103 NAME = 'browse:news:hackernews' | 109 NAME = 'browse:news:hackernews' |
| 104 URL = 'https://news.ycombinator.com' | 110 URL = 'https://news.ycombinator.com' |
| 105 ITEM_SELECTOR = '.athing .title > a' | 111 ITEM_SELECTOR = '.athing .title > a' |
| 106 | 112 |
| 107 | 113 |
| 108 class NytimesMobileStory(_NewsBrowsingStory): | 114 class NytimesMobileStory(_NewsBrowsingStory): |
| 109 """The third top website in http://www.alexa.com/topsites/category/News""" | 115 """The third top website in http://www.alexa.com/topsites/category/News""" |
| 110 NAME = 'browse:news:nytimes' | 116 NAME = 'browse:news:nytimes' |
| 111 URL = 'http://mobile.nytimes.com' | 117 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""" | 151 """The top website in http://www.alexa.com/topsites/category/News""" |
| 146 NAME = 'browse:news:reddit' | 152 NAME = 'browse:news:reddit' |
| 147 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' | 153 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' |
| 148 IS_SINGLE_PAGE_APP = True | 154 IS_SINGLE_PAGE_APP = True |
| 149 ITEM_SELECTOR = '.PostHeader__post-title-line' | 155 ITEM_SELECTOR = '.PostHeader__post-title-line' |
| 150 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 156 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 151 | 157 |
| 152 | 158 |
| 153 class TwitterMobileStory(_NewsBrowsingStory): | 159 class TwitterMobileStory(_NewsBrowsingStory): |
| 154 NAME = 'browse:social:twitter' | 160 NAME = 'browse:social:twitter' |
| 155 URL = 'https://www.twitter.com/justinbieber?skip_interstitial=true' | 161 URL = 'https://www.twitter.com/nasa' |
|
ulan
2016/07/18 11:07:26
It is difficult to get work appropriate twitter co
| |
| 156 ITEM_SELECTOR = '.Tweet-text' | 162 ITEM_SELECTOR = '.Tweet-text' |
| 157 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 163 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 158 | 164 |
| 159 | 165 |
| 160 class TwitterDesktopStory(_NewsBrowsingStory): | 166 class TwitterDesktopStory(_NewsBrowsingStory): |
| 161 NAME = 'browse:social:twitter' | 167 NAME = 'browse:social:twitter' |
| 162 URL = 'https://www.twitter.com/justinbieber?skip_interstitial=true' | 168 URL = 'https://www.twitter.com/nasa' |
| 163 IS_SINGLE_PAGE_APP = True | 169 IS_SINGLE_PAGE_APP = True |
| 164 ITEM_SELECTOR = '.tweet-text' | 170 ITEM_SELECTOR = '.tweet-text' |
| 165 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 171 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 166 | 172 |
| 167 | 173 |
| 168 class WashingtonPostMobileStory(_NewsBrowsingStory): | 174 class WashingtonPostMobileStory(_NewsBrowsingStory): |
| 169 """Progressive website""" | 175 """Progressive website""" |
| 170 NAME = 'browse:news:washingtonpost' | 176 NAME = 'browse:news:washingtonpost' |
| 171 URL = 'https://www.washingtonpost.com/pwa' | 177 URL = 'https://www.washingtonpost.com/pwa' |
| 172 IS_SINGLE_PAGE_APP = True | 178 IS_SINGLE_PAGE_APP = True |
| 173 ITEM_SELECTOR = '.hed > a' | 179 ITEM_SELECTOR = '.hed > a' |
| 174 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 180 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 175 | 181 |
| 176 def _DidLoadDocument(self, action_runner): | 182 def _DidLoadDocument(self, action_runner): |
| 177 # Close the popup window. | 183 # Close the popup window. |
| 178 action_runner.ClickElement(selector='.close') | 184 action_runner.ClickElement(selector='.close') |
| 179 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) | 185 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) |
| OLD | NEW |