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 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 # always fails to completely load due to | 171 # always fails to completely load due to |
| 172 # https://github.com/chromium/web-page-replay/issues/74. | 172 # https://github.com/chromium/web-page-replay/issues/74. |
| 173 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 173 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 174 | 174 |
| 175 | 175 |
| 176 class LoadWashingtonPostMobileStory(_LoadingStory): | 176 class LoadWashingtonPostMobileStory(_LoadingStory): |
| 177 NAME = 'load:news:washingtonpost' | 177 NAME = 'load:news:washingtonpost' |
| 178 URL = 'https://www.washingtonpost.com/pwa' | 178 URL = 'https://www.washingtonpost.com/pwa' |
| 179 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 179 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 180 _CLOSE_BUTTON_SELECTOR = '.close' | 180 _CLOSE_BUTTON_SELECTOR = '.close' |
| 181 _MAIL_BUTTON_SELECTOR = '.mailBlock' | |
| 181 | 182 |
| 182 def _DidLoadDocument(self, action_runner): | 183 def _DidLoadDocument(self, action_runner): |
| 183 # Close the popup window. On Nexus 9 (and probably other tables) the popup | 184 # Close the popup window. On Nexus 9 (and probably other tables) the popup |
| 184 # window does not have a "Close" button, instead it has only a "Send link | 185 # window does not have a "Close" button, instead it has only a "Send link |
| 185 # to phone" button. So on tablets we run with the popup window open. The | 186 # to phone" button. So on tablets we run with the popup window open. The |
| 186 # popup is transparent, so this is mostly an aesthetical issue. | 187 # popup is transparent, so this is mostly an aesthetical issue. |
| 187 has_button = action_runner.EvaluateJavaScript( | 188 action_runner.WaitForElement(selector="%s, %s" % |
| 189 (self._CLOSE_BUTTON_SELECTOR, self._MAIL_BUTTON_SELECTOR)) | |
| 190 has_close_button = action_runner.EvaluateJavaScript( | |
| 188 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) | 191 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) |
| 189 if has_button: | 192 if has_close_button: |
| 190 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) | 193 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) |
| 194 else: | |
|
petrcermak
2016/07/21 09:49:13
ditto
ulan
2016/07/21 09:53:25
Done.
| |
| 195 assert action_runner.EvaluateJavaScript( | |
| 196 '!!document.querySelector("%s")' % self._MAIL_BUTTON_SELECTOR) | |
| 191 | 197 |
| 192 | 198 |
| 193 class LoadWikipediaStory(_LoadingStory): | 199 class LoadWikipediaStory(_LoadingStory): |
| 194 NAME = 'load:news:wikipedia' | 200 NAME = 'load:news:wikipedia' |
| 195 URL = 'https://en.wikipedia.org/wiki/Science' | 201 URL = 'https://en.wikipedia.org/wiki/Science' |
| 196 | 202 |
| 197 | 203 |
| 198 ################################################################################ | 204 ################################################################################ |
| 199 # Audio and video. | 205 # Audio and video. |
| 200 ################################################################################ | 206 ################################################################################ |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 URL = 'http://www.miniclip.com/games/en/' | 375 URL = 'http://www.miniclip.com/games/en/' |
| 370 # Desktop only (requires Flash). | 376 # Desktop only (requires Flash). |
| 371 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 377 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 372 | 378 |
| 373 | 379 |
| 374 class LoadAlphabettyStory(_LoadingStory): | 380 class LoadAlphabettyStory(_LoadingStory): |
| 375 NAME = 'load:games:alphabetty' | 381 NAME = 'load:games:alphabetty' |
| 376 URL = 'https://king.com/play/alphabetty' | 382 URL = 'https://king.com/play/alphabetty' |
| 377 # Desktop only (requires Flash). | 383 # Desktop only (requires Flash). |
| 378 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 384 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| OLD | NEW |