Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: tools/perf/page_sets/system_health/loading_stories.py

Issue 2386083003: Add background stories to MobileSystemHealth (Closed)
Patch Set: tweak stories some more Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/perf/page_sets/system_health/background_stories.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 def _Login(self, action_runner): 284 def _Login(self, action_runner):
285 google_login.LoginGoogleAccount(action_runner, 'googletest', 285 google_login.LoginGoogleAccount(action_runner, 'googletest',
286 self.credentials_path) 286 self.credentials_path)
287 287
288 # Navigating to https://mail.google.com immediately leads to an infinite 288 # Navigating to https://mail.google.com immediately leads to an infinite
289 # redirection loop due to a bug in WPR (see 289 # redirection loop due to a bug in WPR (see
290 # https://github.com/chromium/web-page-replay/issues/70). We therefore first 290 # https://github.com/chromium/web-page-replay/issues/70). We therefore first
291 # navigate to a sub-URL to set up the session and hit the resulting 291 # navigate to a sub-URL to set up the session and hit the resulting
292 # redirection loop. Afterwards, we can safely navigate to 292 # redirection loop. Afterwards, we can safely navigate to
293 # https://mail.google.com. 293 # https://mail.google.com.
294 action_runner.tab.WaitForDocumentReadyStateToBeComplete()
294 action_runner.Navigate( 295 action_runner.Navigate(
295 'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop') 296 'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop')
296 action_runner.tab.WaitForDocumentReadyStateToBeComplete() 297 action_runner.tab.WaitForDocumentReadyStateToBeComplete()
297 298
298 299
299 class LoadGmailDesktopStory(_LoadGmailBaseStory): 300 class LoadGmailDesktopStory(_LoadGmailBaseStory):
300 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY 301 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
301 302
302 def _DidLoadDocument(self, action_runner): 303 def _DidLoadDocument(self, action_runner):
303 # Wait until the UI loads. 304 # Wait until the UI loads.
304 action_runner.WaitForJavaScriptCondition( 305 action_runner.WaitForJavaScriptCondition(
305 'document.getElementById("loading").style.display === "none"') 306 'document.getElementById("loading").style.display === "none"')
306 307
307 class LoadGmailMobileStory(_LoadGmailBaseStory): 308 class LoadGmailMobileStory(_LoadGmailBaseStory):
308 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY 309 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
309 310
310 def _DidLoadDocument(self, action_runner): 311 def _DidLoadDocument(self, action_runner):
311 # Close the "Get Inbox by Gmail" interstitial.
312 action_runner.WaitForJavaScriptCondition(
313 'document.querySelector("#isppromo a") !== null')
314 action_runner.ExecuteJavaScript(
315 'document.querySelector("#isppromo a").click()')
316 # Wait until the UI loads. 312 # Wait until the UI loads.
313 action_runner.WaitForElement('#apploadingdiv')
317 action_runner.WaitForJavaScriptCondition( 314 action_runner.WaitForJavaScriptCondition(
318 'document.getElementById("apploadingdiv").style.height === "0px"') 315 'document.getElementById("apploadingdiv").style.height === "0px"')
319 316
320
321 class LoadMapsStory(_LoadingStory): 317 class LoadMapsStory(_LoadingStory):
322 NAME = 'load:tools:maps' 318 NAME = 'load:tools:maps'
323 URL = 'https://www.google.com/maps/place/London,+UK/' 319 URL = 'https://www.google.com/maps/place/London,+UK/'
324 320
325 321
326 class LoadStackOverflowStory(_LoadingStory): 322 class LoadStackOverflowStory(_LoadingStory):
327 NAME = 'load:tools:stackoverflow' 323 NAME = 'load:tools:stackoverflow'
328 URL = ( 324 URL = (
329 'https://stackoverflow.com/questions/36827659/compiling-an-application-for -use-in-highly-radioactive-environments') 325 'https://stackoverflow.com/questions/36827659/compiling-an-application-for -use-in-highly-radioactive-environments')
330 326
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 NAME = 'load:games:miniclip' 385 NAME = 'load:games:miniclip'
390 # Using "https://" causes "404 Not Found" during WPR recording. 386 # Using "https://" causes "404 Not Found" during WPR recording.
391 URL = 'http://www.miniclip.com/games/en/' 387 URL = 'http://www.miniclip.com/games/en/'
392 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. 388 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash.
393 389
394 390
395 class LoadAlphabettyStory(_LoadingStory): 391 class LoadAlphabettyStory(_LoadingStory):
396 NAME = 'load:games:alphabetty' 392 NAME = 'load:games:alphabetty'
397 URL = 'https://king.com/play/alphabetty' 393 URL = 'https://king.com/play/alphabetty'
398 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash. 394 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # Requires Flash.
OLDNEW
« no previous file with comments | « tools/perf/page_sets/system_health/background_stories.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698