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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 NAME = 'load:news:washingtonpost' | 180 NAME = 'load:news:washingtonpost' |
181 URL = 'https://www.washingtonpost.com/pwa' | 181 URL = 'https://www.washingtonpost.com/pwa' |
182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
183 _CLOSE_BUTTON_SELECTOR = '.close' | 183 _CLOSE_BUTTON_SELECTOR = '.close' |
184 | 184 |
185 def _DidLoadDocument(self, action_runner): | 185 def _DidLoadDocument(self, action_runner): |
186 # Close the popup window. On Nexus 9 (and probably other tables) the popup | 186 # Close the popup window. On Nexus 9 (and probably other tables) the popup |
187 # window does not have a "Close" button, instead it has only a "Send link | 187 # window does not have a "Close" button, instead it has only a "Send link |
188 # to phone" button. So on tablets we run with the popup window open. The | 188 # to phone" button. So on tablets we run with the popup window open. The |
189 # popup is transparent, so this is mostly an aesthetical issue. | 189 # popup is transparent, so this is mostly an aesthetical issue. |
190 # TODO(catapult:#3028): Fix interpolation of JavaScript values. | |
191 has_button = action_runner.EvaluateJavaScript( | 190 has_button = action_runner.EvaluateJavaScript( |
192 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) | 191 '!!document.querySelector({{ selector }})', |
| 192 selector=self._CLOSE_BUTTON_SELECTOR) |
193 if has_button: | 193 if has_button: |
194 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) | 194 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) |
195 | 195 |
196 | 196 |
197 class LoadWikipediaStory(_LoadingStory): | 197 class LoadWikipediaStory(_LoadingStory): |
198 NAME = 'load:news:wikipedia' | 198 NAME = 'load:news:wikipedia' |
199 URL = 'https://en.wikipedia.org/wiki/Science' | 199 URL = 'https://en.wikipedia.org/wiki/Science' |
200 | 200 |
201 | 201 |
202 ################################################################################ | 202 ################################################################################ |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 NAME = 'load:games:miniclip' | 391 NAME = 'load:games:miniclip' |
392 # Using "https://" causes "404 Not Found" during WPR recording. | 392 # Using "https://" causes "404 Not Found" during WPR recording. |
393 URL = 'http://www.miniclip.com/games/en/' | 393 URL = 'http://www.miniclip.com/games/en/' |
394 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. | 394 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. |
395 | 395 |
396 | 396 |
397 class LoadAlphabettyStory(_LoadingStory): | 397 class LoadAlphabettyStory(_LoadingStory): |
398 NAME = 'load:games:alphabetty' | 398 NAME = 'load:games:alphabetty' |
399 URL = 'https://king.com/play/alphabetty' | 399 URL = 'https://king.com/play/alphabetty' |
400 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. | 400 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. |
OLD | NEW |