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

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

Issue 998693002: Add Polymer-Topeka to Key Silk Cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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/data/key_silk_cases_018.wpr.sha1 ('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 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 from telemetry.page import page as page_module 4 from telemetry.page import page as page_module
5 from telemetry.page import page_set as page_set_module 5 from telemetry.page import page_set as page_set_module
6 6
7 7
8 class KeySilkCasesPage(page_module.Page): 8 class KeySilkCasesPage(page_module.Page):
9 9
10 def __init__(self, url, page_set, run_no_page_interactions): 10 def __init__(self, url, page_set, run_no_page_interactions):
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 url='file://key_silk_cases/silk_finance.html', 642 url='file://key_silk_cases/silk_finance.html',
643 page_set=page_set, run_no_page_interactions=run_no_page_interactions) 643 page_set=page_set, run_no_page_interactions=run_no_page_interactions)
644 644
645 def PerformPageInteractions(self, action_runner): 645 def PerformPageInteractions(self, action_runner):
646 interaction = action_runner.BeginInteraction('animation_interaction', 646 interaction = action_runner.BeginInteraction('animation_interaction',
647 is_smooth=True) 647 is_smooth=True)
648 action_runner.Wait(10) # animation runs automatically 648 action_runner.Wait(10) # animation runs automatically
649 interaction.End() 649 interaction.End()
650 650
651 651
652 class PolymerTopeka(KeySilkCasesPage):
653
654 """ Why: Sample Polymer app. """
655
656 def __init__(self, page_set, run_no_page_interactions):
657 super(PolymerTopeka, self).__init__(
658 url='https://polymer-topeka.appspot.com/',
659 page_set=page_set, run_no_page_interactions=run_no_page_interactions)
660
661 def PerformPageInteractions(self, action_runner):
662 profile = 'html /deep/ topeka-profile /deep/ '
663 first_name = profile + 'paper-input#first /deep/ input'
664 action_runner.WaitForElement(selector=first_name)
665 # Input First Name:
666 action_runner.ExecuteJavaScript('''
667 var fn = document.querySelector('%s');
668 fn.value = 'Chrome';
669 fn.fire('input');''' % first_name)
670 # Input Last Initial:
671 action_runner.ExecuteJavaScript('''
672 var li = document.querySelector('%s paper-input#last /deep/ input');
673 li.value = 'E';
674 li.fire('input');''' % profile)
675 interaction = action_runner.BeginInteraction('animation_interaction')
676 # Click the check-mark to login:
677 action_runner.ExecuteJavaScript('''
678 window.topeka_page_transitions = 0;
679 [].forEach.call(document.querySelectorAll(
680 'html /deep/ core-animated-pages'), function(p){
681 p.addEventListener(
682 'core-animated-pages-transition-end', function(e) {
683 window.topeka_page_transitions++;
684 });
685 });
686 document.querySelector('%s paper-fab').fire('tap')''' % profile)
687 # Wait for category list to animate in:
688 action_runner.WaitForJavaScriptCondition('''
689 window.topeka_page_transitions === 1''')
690 # Click a category to start a quiz:
691 action_runner.ExecuteJavaScript('''
692 document.querySelector('html /deep/ core-selector.category-list').fire(
693 'tap',1,document.querySelector('html /deep/ \
694 div.category-item.red-theme'));''')
695 # Wait for the category splash to animate in:
696 action_runner.WaitForJavaScriptCondition('''
697 window.topeka_page_transitions === 2''')
698 # Click to start the quiz:
699 action_runner.ExecuteJavaScript('''
700 document.querySelector('html /deep/ topeka-category-front-page /deep/\
701 paper-fab').fire('tap');''')
702 action_runner.WaitForJavaScriptCondition('''
703 window.topeka_page_transitions === 4''')
704 # Input a mostly correct answer:
705 action_runner.ExecuteJavaScript('''
706 document.querySelector('html /deep/ topeka-quiz-fill-blank /deep/\
707 input').value = 'arkinsaw';
708 document.querySelector('html /deep/ topeka-quiz-fill-blank /deep/\
709 input').fire('input');
710 document.querySelector('html /deep/ topeka-quizzes /deep/ \
711 paper-fab').fire('tap');''')
712 action_runner.WaitForJavaScriptCondition('''
713 window.topeka_page_transitions === 6''')
714 interaction.End()
715
716
652 class KeySilkCasesPageSet(page_set_module.PageSet): 717 class KeySilkCasesPageSet(page_set_module.PageSet):
653 718
654 """ Pages hand-picked for project Silk. """ 719 """ Pages hand-picked for project Silk. """
655 720
656 def __init__(self, run_no_page_interactions=False): 721 def __init__(self, run_no_page_interactions=False):
657 super(KeySilkCasesPageSet, self).__init__( 722 super(KeySilkCasesPageSet, self).__init__(
658 user_agent_type='mobile', 723 user_agent_type='mobile',
659 archive_data_file='data/key_silk_cases.json', 724 archive_data_file='data/key_silk_cases.json',
660 bucket=page_set_module.PARTNER_BUCKET) 725 bucket=page_set_module.PARTNER_BUCKET)
661 726
(...skipping 22 matching lines...) Expand all
684 self.AddUserStory(GwsBoogieExpansion(self, run_no_page_interactions)) 749 self.AddUserStory(GwsBoogieExpansion(self, run_no_page_interactions))
685 # Times out on Windows; crbug.com/338838 750 # Times out on Windows; crbug.com/338838
686 # self.AddUserStory(Page22(self, run_no_page_interactions)) 751 # self.AddUserStory(Page22(self, run_no_page_interactions))
687 self.AddUserStory(Page23(self, run_no_page_interactions)) 752 self.AddUserStory(Page23(self, run_no_page_interactions))
688 self.AddUserStory(Page24(self, run_no_page_interactions)) 753 self.AddUserStory(Page24(self, run_no_page_interactions))
689 self.AddUserStory(Page25(self, run_no_page_interactions)) 754 self.AddUserStory(Page25(self, run_no_page_interactions))
690 self.AddUserStory(Page26(self, run_no_page_interactions)) 755 self.AddUserStory(Page26(self, run_no_page_interactions))
691 self.AddUserStory(SVGIconRaster(self, run_no_page_interactions)) 756 self.AddUserStory(SVGIconRaster(self, run_no_page_interactions))
692 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions)) 757 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions))
693 self.AddUserStory(SilkFinance(self, run_no_page_interactions)) 758 self.AddUserStory(SilkFinance(self, run_no_page_interactions))
759 self.AddUserStory(PolymerTopeka(self, run_no_page_interactions))
694 760
695 for page in self: 761 for page in self:
696 assert (page.__class__.RunPageInteractions == 762 assert (page.__class__.RunPageInteractions ==
697 KeySilkCasesPage.RunPageInteractions), ( 763 KeySilkCasesPage.RunPageInteractions), (
698 'Pages in this page set must not override KeySilkCasesPage\' ' 764 'Pages in this page set must not override KeySilkCasesPage\' '
699 'RunPageInteractions method.') 765 'RunPageInteractions method.')
OLDNEW
« no previous file with comments | « tools/perf/page_sets/data/key_silk_cases_018.wpr.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698