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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 class FacebookDesktopStory(_NewsBrowsingStory): | 100 class FacebookDesktopStory(_NewsBrowsingStory): |
101 NAME = 'browse:social:facebook' | 101 NAME = 'browse:social:facebook' |
102 URL = 'https://www.facebook.com/rihanna' | 102 URL = 'https://www.facebook.com/rihanna' |
103 ITEM_SELECTOR = '._4-eo' | 103 ITEM_SELECTOR = '._4-eo' |
104 IS_SINGLE_PAGE_APP = True | 104 IS_SINGLE_PAGE_APP = True |
105 # Web-page-replay does not work for this website: | 105 # Web-page-replay does not work for this website: |
106 # https://github.com/chromium/web-page-replay/issues/79. | 106 # https://github.com/chromium/web-page-replay/issues/79. |
107 SUPPORTED_PLATFORMS = platforms.NO_PLATFORMS | 107 SUPPORTED_PLATFORMS = platforms.NO_PLATFORMS |
108 | 108 |
109 | 109 |
| 110 class FlipboardMobileStory(_NewsBrowsingStory): |
| 111 NAME = 'browse:news:flipboard' |
| 112 URL = 'https://flipboard.com/explore' |
| 113 IS_SINGLE_PAGE_APP = True |
| 114 ITEM_SELECTOR = '.grad-top' |
| 115 ITEM_SCROLL_REPEAT = 4 |
| 116 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 117 |
| 118 |
| 119 class FlipboardDesktopStory(_NewsBrowsingStory): |
| 120 NAME = 'browse:news:flipboard' |
| 121 URL = 'https://flipboard.com/explore' |
| 122 IS_SINGLE_PAGE_APP = True |
| 123 ITEM_SELECTOR = '.cover-image' |
| 124 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 125 |
| 126 |
110 class HackerNewsStory(_NewsBrowsingStory): | 127 class HackerNewsStory(_NewsBrowsingStory): |
111 NAME = 'browse:news:hackernews' | 128 NAME = 'browse:news:hackernews' |
112 URL = 'https://news.ycombinator.com' | 129 URL = 'https://news.ycombinator.com' |
113 ITEM_SELECTOR = '.athing .title > a' | 130 ITEM_SELECTOR = '.athing .title > a' |
114 | 131 |
115 | 132 |
116 class NytimesMobileStory(_NewsBrowsingStory): | 133 class NytimesMobileStory(_NewsBrowsingStory): |
117 """The third top website in http://www.alexa.com/topsites/category/News""" | 134 """The third top website in http://www.alexa.com/topsites/category/News""" |
118 NAME = 'browse:news:nytimes' | 135 NAME = 'browse:news:nytimes' |
119 URL = 'http://mobile.nytimes.com' | 136 URL = 'http://mobile.nytimes.com' |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 NAME = 'browse:news:washingtonpost' | 195 NAME = 'browse:news:washingtonpost' |
179 URL = 'https://www.washingtonpost.com/pwa' | 196 URL = 'https://www.washingtonpost.com/pwa' |
180 IS_SINGLE_PAGE_APP = True | 197 IS_SINGLE_PAGE_APP = True |
181 ITEM_SELECTOR = '.hed > a' | 198 ITEM_SELECTOR = '.hed > a' |
182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 199 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
183 | 200 |
184 def _DidLoadDocument(self, action_runner): | 201 def _DidLoadDocument(self, action_runner): |
185 # Close the popup window. | 202 # Close the popup window. |
186 action_runner.ClickElement(selector='.close') | 203 action_runner.ClickElement(selector='.close') |
187 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) | 204 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) |
OLD | NEW |