| 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 from page_sets.login_helpers import dropbox_login | 8 from page_sets.login_helpers import dropbox_login |
| 9 from page_sets.login_helpers import google_login | 9 from page_sets.login_helpers import google_login |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 # The desktop page (http://news.sohu.com/20160503/n447433356.shtml) almost | 165 # The desktop page (http://news.sohu.com/20160503/n447433356.shtml) almost |
| 166 # always fails to completely load due to | 166 # always fails to completely load due to |
| 167 # https://github.com/chromium/web-page-replay/issues/74. | 167 # https://github.com/chromium/web-page-replay/issues/74. |
| 168 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 168 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 169 | 169 |
| 170 | 170 |
| 171 class LoadWashingtonPostMobileStory(_LoadingStory): | 171 class LoadWashingtonPostMobileStory(_LoadingStory): |
| 172 NAME = 'load:news:washingtonpost' | 172 NAME = 'load:news:washingtonpost' |
| 173 URL = 'https://www.washingtonpost.com/pwa' | 173 URL = 'https://www.washingtonpost.com/pwa' |
| 174 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 174 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 175 _CLOSE_BUTTON_SELECTOR = '.close' |
| 175 | 176 |
| 176 def _DidLoadDocument(self, action_runner): | 177 def _DidLoadDocument(self, action_runner): |
| 177 # Close the popup window. | 178 # Close the popup window. On Nexus 9 (and probably other tables) the popup |
| 178 action_runner.ClickElement(selector='.close') | 179 # window does not have a "Close" button, instead it has only a "Send link |
| 180 # to phone" button. So on tablets we run with the popup window open. The |
| 181 # popup is transparent, so this is mostly an aesthetical issue. |
| 182 has_button = action_runner.EvaluateJavaScript( |
| 183 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) |
| 184 if has_button: |
| 185 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) |
| 179 | 186 |
| 180 | 187 |
| 181 class LoadWikipediaStory(_LoadingStory): | 188 class LoadWikipediaStory(_LoadingStory): |
| 182 NAME = 'load:news:wikipedia' | 189 NAME = 'load:news:wikipedia' |
| 183 URL = 'https://en.wikipedia.org/wiki/Science' | 190 URL = 'https://en.wikipedia.org/wiki/Science' |
| 184 | 191 |
| 185 | 192 |
| 186 ################################################################################ | 193 ################################################################################ |
| 187 # Audio and video. | 194 # Audio and video. |
| 188 ################################################################################ | 195 ################################################################################ |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 URL = 'http://www.miniclip.com/games/en/' | 364 URL = 'http://www.miniclip.com/games/en/' |
| 358 # Desktop only (requires Flash). | 365 # Desktop only (requires Flash). |
| 359 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 366 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 360 | 367 |
| 361 | 368 |
| 362 class LoadAlphabettyStory(_LoadingStory): | 369 class LoadAlphabettyStory(_LoadingStory): |
| 363 NAME = 'load:games:alphabetty' | 370 NAME = 'load:games:alphabetty' |
| 364 URL = 'https://king.com/play/alphabetty' | 371 URL = 'https://king.com/play/alphabetty' |
| 365 # Desktop only (requires Flash). | 372 # Desktop only (requires Flash). |
| 366 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 373 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| OLD | NEW |