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

Side by Side Diff: tools/perf/page_sets/top_25.py

Issue 277143003: Add NavigateToPage API for action_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 months 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/polymer.py ('k') | tools/perf/page_sets/tough_animation_cases.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 # pylint: disable=W0401,W0614 4 # pylint: disable=W0401,W0614
5 from telemetry.page.actions.all_page_actions import * 5 from telemetry.page.actions.all_page_actions import *
6 from telemetry.page import page as page_module 6 from telemetry.page import page as page_module
7 from telemetry.page import page_set as page_set_module 7 from telemetry.page import page_set as page_set_module
8 8
9 9
10 class Top25Page(page_module.Page): 10 class Top25Page(page_module.Page):
(...skipping 17 matching lines...) Expand all
28 class GoogleWebSearchPage(Top25Page): 28 class GoogleWebSearchPage(Top25Page):
29 29
30 """ Why: top google property; a google tab is often open """ 30 """ Why: top google property; a google tab is often open """
31 31
32 def __init__(self, page_set): 32 def __init__(self, page_set):
33 super(GoogleWebSearchPage, self).__init__( 33 super(GoogleWebSearchPage, self).__init__(
34 url='https://www.google.com/#hl=en&q=barack+obama', 34 url='https://www.google.com/#hl=en&q=barack+obama',
35 page_set=page_set) 35 page_set=page_set)
36 36
37 def RunNavigateSteps(self, action_runner): 37 def RunNavigateSteps(self, action_runner):
38 action_runner.RunAction(NavigateAction()) 38 action_runner.NavigateToPage(self)
39 action_runner.RunAction(WaitAction( 39 action_runner.RunAction(WaitAction(
40 { 40 {
41 'text' : 'Next', 41 'text' : 'Next',
42 'condition': 'element' 42 'condition': 'element'
43 })) 43 }))
44 44
45 def RunStressMemory(self, action_runner): 45 def RunStressMemory(self, action_runner):
46 action_runner.RunAction(ScrollAction()) 46 action_runner.RunAction(ScrollAction())
47 action_runner.RunAction(ClickElementAction( 47 action_runner.RunAction(ClickElementAction(
48 { 48 {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 """ Why: productivity, top google properties """ 141 """ Why: productivity, top google properties """
142 142
143 def __init__(self, page_set): 143 def __init__(self, page_set):
144 super(GmailPage, self).__init__( 144 super(GmailPage, self).__init__(
145 url='https://mail.google.com/mail/', 145 url='https://mail.google.com/mail/',
146 page_set=page_set) 146 page_set=page_set)
147 147
148 self.credentials = 'google' 148 self.credentials = 'google'
149 149
150 def RunNavigateSteps(self, action_runner): 150 def RunNavigateSteps(self, action_runner):
151 action_runner.RunAction(NavigateAction()) 151 action_runner.NavigateToPage(self)
152 action_runner.RunAction(WaitAction( 152 action_runner.RunAction(WaitAction(
153 { 153 {
154 'javascript': ('window.gmonkey !== undefined &&' 154 'javascript': ('window.gmonkey !== undefined &&'
155 'document.getElementById("gb") !== null') 155 'document.getElementById("gb") !== null')
156 })) 156 }))
157 157
158 def RunStressMemory(self, action_runner): 158 def RunStressMemory(self, action_runner):
159 action_runner.RunAction(ClickElementAction( 159 action_runner.RunAction(ClickElementAction(
160 { 160 {
161 'wait_until': { 161 'wait_until': {
(...skipping 26 matching lines...) Expand all
188 """ Why: productivity, top google properties """ 188 """ Why: productivity, top google properties """
189 189
190 def __init__(self, page_set): 190 def __init__(self, page_set):
191 super(GoogleCalendarPage, self).__init__( 191 super(GoogleCalendarPage, self).__init__(
192 url='https://www.google.com/calendar/', 192 url='https://www.google.com/calendar/',
193 page_set=page_set) 193 page_set=page_set)
194 194
195 self.credentials = 'google' 195 self.credentials = 'google'
196 196
197 def RunNavigateSteps(self, action_runner): 197 def RunNavigateSteps(self, action_runner):
198 action_runner.RunAction(NavigateAction()) 198 action_runner.NavigateToPage(self)
199 action_runner.RunAction(WaitAction( 199 action_runner.RunAction(WaitAction(
200 { 200 {
201 'seconds': 2 201 'seconds': 2
202 })) 202 }))
203 action_runner.RunAction(WaitAction( 203 action_runner.RunAction(WaitAction(
204 { 204 {
205 'condition': 'element', 205 'condition': 'element',
206 'selector': 'div[class~="navForward"]' 206 'selector': 'div[class~="navForward"]'
207 })) 207 }))
208 action_runner.RunAction(JavascriptAction( 208 action_runner.RunAction(JavascriptAction(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 def __init__(self, page_set): 355 def __init__(self, page_set):
356 super(GoogleDocPage, self).__init__( 356 super(GoogleDocPage, self).__init__(
357 # pylint: disable=C0301 357 # pylint: disable=C0301
358 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfT pAPUSX3_s4/view', 358 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfT pAPUSX3_s4/view',
359 page_set=page_set, 359 page_set=page_set,
360 name='Docs (1 open document tab)') 360 name='Docs (1 open document tab)')
361 361
362 self.credentials = 'google' 362 self.credentials = 'google'
363 363
364 def RunNavigateSteps(self, action_runner): 364 def RunNavigateSteps(self, action_runner):
365 action_runner.RunAction(NavigateAction()) 365 action_runner.NavigateToPage(self)
366 action_runner.RunAction(WaitAction( 366 action_runner.RunAction(WaitAction(
367 { 367 {
368 'seconds': 2 368 'seconds': 2
369 })) 369 }))
370 action_runner.RunAction(WaitAction( 370 action_runner.RunAction(WaitAction(
371 { 371 {
372 'javascript': 372 'javascript':
373 'document.getElementsByClassName("kix-appview-editor").length' 373 'document.getElementsByClassName("kix-appview-editor").length'
374 })) 374 }))
375 375
(...skipping 12 matching lines...) Expand all
388 """ Why: social; top google property; Public profile; infinite scrolls """ 388 """ Why: social; top google property; Public profile; infinite scrolls """
389 389
390 def __init__(self, page_set): 390 def __init__(self, page_set):
391 super(GooglePlusPage, self).__init__( 391 super(GooglePlusPage, self).__init__(
392 url='https://plus.google.com/110031535020051778989/posts', 392 url='https://plus.google.com/110031535020051778989/posts',
393 page_set=page_set) 393 page_set=page_set)
394 394
395 self.credentials = 'google' 395 self.credentials = 'google'
396 396
397 def RunNavigateSteps(self, action_runner): 397 def RunNavigateSteps(self, action_runner):
398 action_runner.RunAction(NavigateAction()) 398 action_runner.NavigateToPage(self)
399 action_runner.RunAction(WaitAction( 399 action_runner.RunAction(WaitAction(
400 { 400 {
401 'text' : 'Home', 401 'text' : 'Home',
402 'condition': 'element' 402 'condition': 'element'
403 })) 403 }))
404 404
405 def RunStressMemory(self, action_runner): 405 def RunStressMemory(self, action_runner):
406 action_runner.RunAction(ClickElementAction( 406 action_runner.RunAction(ClickElementAction(
407 { 407 {
408 'text' : 'Home' 408 'text' : 'Home'
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 """ Why: #3 (Alexa global) """ 481 """ Why: #3 (Alexa global) """
482 482
483 def __init__(self, page_set): 483 def __init__(self, page_set):
484 super(YoutubePage, self).__init__( 484 super(YoutubePage, self).__init__(
485 url='http://www.youtube.com', 485 url='http://www.youtube.com',
486 page_set=page_set) 486 page_set=page_set)
487 487
488 self.credentials = 'google' 488 self.credentials = 'google'
489 489
490 def RunNavigateSteps(self, action_runner): 490 def RunNavigateSteps(self, action_runner):
491 action_runner.RunAction(NavigateAction()) 491 action_runner.NavigateToPage(self)
492 action_runner.RunAction(WaitAction( 492 action_runner.RunAction(WaitAction(
493 { 493 {
494 'seconds': 2 494 'seconds': 2
495 })) 495 }))
496 496
497 497
498 class BlogspotPage(Top25Page): 498 class BlogspotPage(Top25Page):
499 499
500 """ Why: #11 (Alexa global), google property; some blogger layouts have 500 """ Why: #11 (Alexa global), google property; some blogger layouts have
501 infinite scroll but more interesting """ 501 infinite scroll but more interesting """
502 502
503 def __init__(self, page_set): 503 def __init__(self, page_set):
504 super(BlogspotPage, self).__init__( 504 super(BlogspotPage, self).__init__(
505 url='http://googlewebmastercentral.blogspot.com/', 505 url='http://googlewebmastercentral.blogspot.com/',
506 page_set=page_set, 506 page_set=page_set,
507 name='Blogger') 507 name='Blogger')
508 508
509 def RunNavigateSteps(self, action_runner): 509 def RunNavigateSteps(self, action_runner):
510 action_runner.RunAction(NavigateAction()) 510 action_runner.NavigateToPage(self)
511 action_runner.RunAction(WaitAction( 511 action_runner.RunAction(WaitAction(
512 { 512 {
513 'text' : 'accessibility', 513 'text' : 'accessibility',
514 'condition': 'element' 514 'condition': 'element'
515 })) 515 }))
516 516
517 def RunStressMemory(self, action_runner): 517 def RunStressMemory(self, action_runner):
518 action_runner.RunAction(ClickElementAction( 518 action_runner.RunAction(ClickElementAction(
519 { 519 {
520 'text' : 'accessibility', 520 'text' : 'accessibility',
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 """ Why: #18 (Alexa global), Picked an interesting post """ 553 """ Why: #18 (Alexa global), Picked an interesting post """
554 554
555 def __init__(self, page_set): 555 def __init__(self, page_set):
556 super(WordpressPage, self).__init__( 556 super(WordpressPage, self).__init__(
557 # pylint: disable=C0301 557 # pylint: disable=C0301
558 url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks -for-august-2012/', 558 url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks -for-august-2012/',
559 page_set=page_set, 559 page_set=page_set,
560 name='Wordpress') 560 name='Wordpress')
561 561
562 def RunNavigateSteps(self, action_runner): 562 def RunNavigateSteps(self, action_runner):
563 action_runner.RunAction(NavigateAction()) 563 action_runner.NavigateToPage(self)
564 action_runner.RunAction(WaitAction( 564 action_runner.RunAction(WaitAction(
565 { 565 {
566 'condition': 'element', 566 'condition': 'element',
567 'selector': 567 'selector':
568 # pylint: disable=C0301 568 # pylint: disable=C0301
569 'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-s ight/"]' 569 'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-s ight/"]'
570 })) 570 }))
571 571
572 def RunStressMemory(self, action_runner): 572 def RunStressMemory(self, action_runner):
573 action_runner.RunAction(ScrollAction()) 573 action_runner.RunAction(ScrollAction())
(...skipping 30 matching lines...) Expand all
604 """ Why: top social,Public profile """ 604 """ Why: top social,Public profile """
605 605
606 def __init__(self, page_set): 606 def __init__(self, page_set):
607 super(FacebookPage, self).__init__( 607 super(FacebookPage, self).__init__(
608 url='http://www.facebook.com/barackobama', 608 url='http://www.facebook.com/barackobama',
609 page_set=page_set, 609 page_set=page_set,
610 name='Facebook') 610 name='Facebook')
611 self.credentials = 'facebook' 611 self.credentials = 'facebook'
612 612
613 def RunNavigateSteps(self, action_runner): 613 def RunNavigateSteps(self, action_runner):
614 action_runner.RunAction(NavigateAction()) 614 action_runner.NavigateToPage(self)
615 action_runner.RunAction(WaitAction( 615 action_runner.RunAction(WaitAction(
616 { 616 {
617 'text' : 'About', 617 'text' : 'About',
618 'condition': 'element' 618 'condition': 'element'
619 })) 619 }))
620 620
621 def RunStressMemory(self, action_runner): 621 def RunStressMemory(self, action_runner):
622 action_runner.RunAction(ClickElementAction( 622 action_runner.RunAction(ClickElementAction(
623 { 623 {
624 'text' : 'About', 624 'text' : 'About',
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 695
696 """ Why: #8 (Alexa global),Picked an interesting page """ 696 """ Why: #8 (Alexa global),Picked an interesting page """
697 697
698 def __init__(self, page_set): 698 def __init__(self, page_set):
699 super(TwitterPage, self).__init__( 699 super(TwitterPage, self).__init__(
700 url='https://twitter.com/katyperry', 700 url='https://twitter.com/katyperry',
701 page_set=page_set, 701 page_set=page_set,
702 name='Twitter') 702 name='Twitter')
703 703
704 def RunNavigateSteps(self, action_runner): 704 def RunNavigateSteps(self, action_runner):
705 action_runner.RunAction(NavigateAction()) 705 action_runner.NavigateToPage(self)
706 action_runner.RunAction(WaitAction( 706 action_runner.RunAction(WaitAction(
707 { 707 {
708 'seconds': 2 708 'seconds': 2
709 })) 709 }))
710 710
711 def RunSmoothness(self, action_runner): 711 def RunSmoothness(self, action_runner):
712 action_runner.RunAction(ScrollAction( 712 action_runner.RunAction(ScrollAction(
713 { 713 {
714 'scroll_is_infinite': True 714 'scroll_is_infinite': True
715 })) 715 }))
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 class YahooGamesPage(Top25Page): 764 class YahooGamesPage(Top25Page):
765 765
766 """ Why: #1 games according to Alexa (with actual games in it) """ 766 """ Why: #1 games according to Alexa (with actual games in it) """
767 767
768 def __init__(self, page_set): 768 def __init__(self, page_set):
769 super(YahooGamesPage, self).__init__( 769 super(YahooGamesPage, self).__init__(
770 url='http://games.yahoo.com', 770 url='http://games.yahoo.com',
771 page_set=page_set) 771 page_set=page_set)
772 772
773 def RunNavigateSteps(self, action_runner): 773 def RunNavigateSteps(self, action_runner):
774 action_runner.RunAction(NavigateAction()) 774 action_runner.NavigateToPage(self)
775 action_runner.RunAction(WaitAction( 775 action_runner.RunAction(WaitAction(
776 { 776 {
777 'seconds': 2 777 'seconds': 2
778 })) 778 }))
779 779
780 780
781 class Top25PageSet(page_set_module.PageSet): 781 class Top25PageSet(page_set_module.PageSet):
782 782
783 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ 783 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """
784 784
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 # Why: #1 Alexa reference 821 # Why: #1 Alexa reference
822 'http://answers.yahoo.com', 822 'http://answers.yahoo.com',
823 # Why: #1 Alexa sports 823 # Why: #1 Alexa sports
824 'http://sports.yahoo.com/', 824 'http://sports.yahoo.com/',
825 # Why: top tech blog 825 # Why: top tech blog
826 'http://techcrunch.com' 826 'http://techcrunch.com'
827 ] 827 ]
828 828
829 for url in other_urls: 829 for url in other_urls:
830 self.AddPage(Top25Page(url, self)) 830 self.AddPage(Top25Page(url, self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/polymer.py ('k') | tools/perf/page_sets/tough_animation_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698