| 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 story_tags | 6 from page_sets.system_health import story_tags | 
| 7 from page_sets.system_health import system_health_story | 7 from page_sets.system_health import system_health_story | 
| 8 | 8 | 
| 9 from page_sets.login_helpers import dropbox_login | 9 from page_sets.login_helpers import dropbox_login | 
| 10 from page_sets.login_helpers import google_login | 10 from page_sets.login_helpers import google_login | 
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 191   NAME = 'load:news:washingtonpost' | 191   NAME = 'load:news:washingtonpost' | 
| 192   URL = 'https://www.washingtonpost.com/pwa' | 192   URL = 'https://www.washingtonpost.com/pwa' | 
| 193   SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 193   SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 
| 194   _CLOSE_BUTTON_SELECTOR = '.close' | 194   _CLOSE_BUTTON_SELECTOR = '.close' | 
| 195 | 195 | 
| 196   def _DidLoadDocument(self, action_runner): | 196   def _DidLoadDocument(self, action_runner): | 
| 197     # Close the popup window. On Nexus 9 (and probably other tables) the popup | 197     # Close the popup window. On Nexus 9 (and probably other tables) the popup | 
| 198     # window does not have a "Close" button, instead it has only a "Send link | 198     # window does not have a "Close" button, instead it has only a "Send link | 
| 199     # to phone" button. So on tablets we run with the popup window open. The | 199     # to phone" button. So on tablets we run with the popup window open. The | 
| 200     # popup is transparent, so this is mostly an aesthetical issue. | 200     # popup is transparent, so this is mostly an aesthetical issue. | 
| 201     has_button = action_runner.EvaluateJavaScript2( | 201     has_button = action_runner.EvaluateJavaScript( | 
| 202         '!!document.querySelector({{ selector }})', | 202         '!!document.querySelector({{ selector }})', | 
| 203         selector=self._CLOSE_BUTTON_SELECTOR) | 203         selector=self._CLOSE_BUTTON_SELECTOR) | 
| 204     if has_button: | 204     if has_button: | 
| 205       action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) | 205       action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) | 
| 206 | 206 | 
| 207 | 207 | 
| 208 class LoadWikipediaStory(_LoadingStory): | 208 class LoadWikipediaStory(_LoadingStory): | 
| 209   NAME = 'load:news:wikipedia' | 209   NAME = 'load:news:wikipedia' | 
| 210   URL = 'https://en.wikipedia.org/wiki/Science' | 210   URL = 'https://en.wikipedia.org/wiki/Science' | 
| 211 | 211 | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 246   NAME = 'load:media:9gag' | 246   NAME = 'load:media:9gag' | 
| 247   URL = 'https://www.9gag.com/' | 247   URL = 'https://www.9gag.com/' | 
| 248 | 248 | 
| 249 | 249 | 
| 250 class LoadFlickrStory(_LoadingStory): | 250 class LoadFlickrStory(_LoadingStory): | 
| 251   NAME = 'load:media:flickr' | 251   NAME = 'load:media:flickr' | 
| 252   URL = 'https://www.flickr.com/photos/tags/farm' | 252   URL = 'https://www.flickr.com/photos/tags/farm' | 
| 253 | 253 | 
| 254   def _DidLoadDocument(self, action_runner): | 254   def _DidLoadDocument(self, action_runner): | 
| 255     # Wait until the 'Recently tagged' view loads. | 255     # Wait until the 'Recently tagged' view loads. | 
| 256     action_runner.WaitForJavaScriptCondition2(''' | 256     action_runner.WaitForJavaScriptCondition(''' | 
| 257         document.querySelector( | 257         document.querySelector( | 
| 258             '.search-photos-everyone-trending-view .photo-list-view') | 258             '.search-photos-everyone-trending-view .photo-list-view') | 
| 259                 !== null''') | 259                 !== null''') | 
| 260 | 260 | 
| 261 | 261 | 
| 262 class LoadImgurStory(_LoadingStory): | 262 class LoadImgurStory(_LoadingStory): | 
| 263   NAME = 'load:media:imgur' | 263   NAME = 'load:media:imgur' | 
| 264   URL = 'http://imgur.com/gallery/5UlBN' | 264   URL = 'http://imgur.com/gallery/5UlBN' | 
| 265 | 265 | 
| 266 | 266 | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 310     action_runner.Navigate( | 310     action_runner.Navigate( | 
| 311         'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop') | 311         'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop') | 
| 312     action_runner.tab.WaitForDocumentReadyStateToBeComplete() | 312     action_runner.tab.WaitForDocumentReadyStateToBeComplete() | 
| 313 | 313 | 
| 314 | 314 | 
| 315 class LoadGmailDesktopStory(_LoadGmailBaseStory): | 315 class LoadGmailDesktopStory(_LoadGmailBaseStory): | 
| 316   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 316   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 
| 317 | 317 | 
| 318   def _DidLoadDocument(self, action_runner): | 318   def _DidLoadDocument(self, action_runner): | 
| 319     # Wait until the UI loads. | 319     # Wait until the UI loads. | 
| 320     action_runner.WaitForJavaScriptCondition2( | 320     action_runner.WaitForJavaScriptCondition( | 
| 321         'document.getElementById("loading").style.display === "none"') | 321         'document.getElementById("loading").style.display === "none"') | 
| 322 | 322 | 
| 323 | 323 | 
| 324 @decorators.Disabled('android')  # crbug.com/657433 | 324 @decorators.Disabled('android')  # crbug.com/657433 | 
| 325 class LoadGmailMobileStory(_LoadGmailBaseStory): | 325 class LoadGmailMobileStory(_LoadGmailBaseStory): | 
| 326   SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 326   SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 
| 327 | 327 | 
| 328   def _DidLoadDocument(self, action_runner): | 328   def _DidLoadDocument(self, action_runner): | 
| 329     # Wait until the UI loads. | 329     # Wait until the UI loads. | 
| 330     action_runner.WaitForElement('#apploadingdiv') | 330     action_runner.WaitForElement('#apploadingdiv') | 
| 331     action_runner.WaitForJavaScriptCondition2( | 331     action_runner.WaitForJavaScriptCondition( | 
| 332         'document.getElementById("apploadingdiv").style.height === "0px"') | 332         'document.getElementById("apploadingdiv").style.height === "0px"') | 
| 333 | 333 | 
| 334 class LoadMapsStory(_LoadingStory): | 334 class LoadMapsStory(_LoadingStory): | 
| 335   NAME = 'load:tools:maps' | 335   NAME = 'load:tools:maps' | 
| 336   URL = 'https://www.google.com/maps/place/London,+UK/' | 336   URL = 'https://www.google.com/maps/place/London,+UK/' | 
| 337 | 337 | 
| 338 | 338 | 
| 339 class LoadStackOverflowStory(_LoadingStory): | 339 class LoadStackOverflowStory(_LoadingStory): | 
| 340   NAME = 'load:tools:stackoverflow' | 340   NAME = 'load:tools:stackoverflow' | 
| 341   URL = ( | 341   URL = ( | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
| 371 ################################################################################ | 371 ################################################################################ | 
| 372 | 372 | 
| 373 | 373 | 
| 374 class LoadBubblesStory(_LoadingStory): | 374 class LoadBubblesStory(_LoadingStory): | 
| 375   NAME = 'load:games:bubbles' | 375   NAME = 'load:games:bubbles' | 
| 376   URL = ( | 376   URL = ( | 
| 377       'https://games.cdn.famobi.com/html5games/s/smarty-bubbles/v010/?fg_domain=
     play.famobi.com&fg_uid=d8f24956-dc91-4902-9096-a46cb1353b6f&fg_pid=4638e320-4444
     -4514-81c4-d80a8c662371&fg_beat=620') | 377       'https://games.cdn.famobi.com/html5games/s/smarty-bubbles/v010/?fg_domain=
     play.famobi.com&fg_uid=d8f24956-dc91-4902-9096-a46cb1353b6f&fg_pid=4638e320-4444
     -4514-81c4-d80a8c662371&fg_beat=620') | 
| 378 | 378 | 
| 379   def _DidLoadDocument(self, action_runner): | 379   def _DidLoadDocument(self, action_runner): | 
| 380     # The #logo element is removed right before the main menu is displayed. | 380     # The #logo element is removed right before the main menu is displayed. | 
| 381     action_runner.WaitForJavaScriptCondition2( | 381     action_runner.WaitForJavaScriptCondition( | 
| 382         'document.getElementById("logo") === null') | 382         'document.getElementById("logo") === null') | 
| 383 | 383 | 
| 384 | 384 | 
| 385 class LoadLazorsStory(_LoadingStory): | 385 class LoadLazorsStory(_LoadingStory): | 
| 386   NAME = 'load:games:lazors' | 386   NAME = 'load:games:lazors' | 
| 387   # Using "https://" hangs and shows "This site can't be reached". | 387   # Using "https://" hangs and shows "This site can't be reached". | 
| 388   URL = 'http://www8.games.mobi/games/html5/lazors/lazors.html' | 388   URL = 'http://www8.games.mobi/games/html5/lazors/lazors.html' | 
| 389 | 389 | 
| 390 | 390 | 
| 391 class LoadSpyChaseStory(_LoadingStory): | 391 class LoadSpyChaseStory(_LoadingStory): | 
| 392   NAME = 'load:games:spychase' | 392   NAME = 'load:games:spychase' | 
| 393   # Using "https://" shows "Your connection is not private". | 393   # Using "https://" shows "Your connection is not private". | 
| 394   URL = 'http://playstar.mobi/games/spychase/index.php' | 394   URL = 'http://playstar.mobi/games/spychase/index.php' | 
| 395 | 395 | 
| 396   def _DidLoadDocument(self, action_runner): | 396   def _DidLoadDocument(self, action_runner): | 
| 397     # The background of the game canvas is set when the "Tap screen to play" | 397     # The background of the game canvas is set when the "Tap screen to play" | 
| 398     # caption is displayed. | 398     # caption is displayed. | 
| 399     action_runner.WaitForJavaScriptCondition2( | 399     action_runner.WaitForJavaScriptCondition( | 
| 400         'document.querySelector("#game canvas").style.background !== ""') | 400         'document.querySelector("#game canvas").style.background !== ""') | 
| 401 | 401 | 
| 402 | 402 | 
| 403 @decorators.Disabled('mac') # crbug.com/664661 | 403 @decorators.Disabled('mac') # crbug.com/664661 | 
| 404 class LoadMiniclipStory(_LoadingStory): | 404 class LoadMiniclipStory(_LoadingStory): | 
| 405   NAME = 'load:games:miniclip' | 405   NAME = 'load:games:miniclip' | 
| 406   # Using "https://" causes "404 Not Found" during WPR recording. | 406   # Using "https://" causes "404 Not Found" during WPR recording. | 
| 407   URL = 'http://www.miniclip.com/games/en/' | 407   URL = 'http://www.miniclip.com/games/en/' | 
| 408   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash. | 408   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash. | 
| 409 | 409 | 
| 410 | 410 | 
| 411 class LoadAlphabettyStory(_LoadingStory): | 411 class LoadAlphabettyStory(_LoadingStory): | 
| 412   NAME = 'load:games:alphabetty' | 412   NAME = 'load:games:alphabetty' | 
| 413   URL = 'https://king.com/play/alphabetty' | 413   URL = 'https://king.com/play/alphabetty' | 
| 414   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash. | 414   SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash. | 
| OLD | NEW | 
|---|