OLD | NEW |
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 import story | 5 from telemetry import story |
6 | 6 |
7 | 7 |
8 class KeyDesktopSitesPage(page_module.Page): | 8 class KeyDesktopSitesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
(...skipping 27 matching lines...) Expand all Loading... |
38 function(callback) { | 38 function(callback) { |
39 gmonkey.load('2.0', function(api) { | 39 gmonkey.load('2.0', function(api) { |
40 callback(api.getScrollableElement()); | 40 callback(api.getScrollableElement()); |
41 }); | 41 }); |
42 }''' | 42 }''' |
43 self.credentials = 'google' | 43 self.credentials = 'google' |
44 | 44 |
45 def RunPageInteractions(self, action_runner): | 45 def RunPageInteractions(self, action_runner): |
46 with action_runner.CreateGestureInteraction('ScrollAction'): | 46 with action_runner.CreateGestureInteraction('ScrollAction'): |
47 action_runner.ScrollPage() | 47 action_runner.ScrollPage() |
48 action_runner.WaitForJavaScriptCondition2( | 48 action_runner.WaitForJavaScriptCondition( |
49 'window.gmonkey !== undefined && ' | 49 'window.gmonkey !== undefined && ' |
50 'document.getElementById("gb") !== null') | 50 'document.getElementById("gb") !== null') |
51 | 51 |
52 | 52 |
53 class GoogleCalendarPage(KeyDesktopSitesPage): | 53 class GoogleCalendarPage(KeyDesktopSitesPage): |
54 | 54 |
55 def __init__(self, page_set): | 55 def __init__(self, page_set): |
56 super(GoogleCalendarPage, self).__init__( | 56 super(GoogleCalendarPage, self).__init__( |
57 url='https://www.google.com/calendar/', | 57 url='https://www.google.com/calendar/', |
58 page_set=page_set) | 58 page_set=page_set) |
(...skipping 14 matching lines...) Expand all Loading... |
73 | 73 |
74 self.scrollable_element_function = ''' | 74 self.scrollable_element_function = ''' |
75 function(callback) { | 75 function(callback) { |
76 callback(document.getElementsByClassName('doclistview-list')[0]); | 76 callback(document.getElementsByClassName('doclistview-list')[0]); |
77 }''' | 77 }''' |
78 self.credentials = 'google' | 78 self.credentials = 'google' |
79 | 79 |
80 def RunPageInteractions(self, action_runner): | 80 def RunPageInteractions(self, action_runner): |
81 with action_runner.CreateGestureInteraction('ScrollAction'): | 81 with action_runner.CreateGestureInteraction('ScrollAction'): |
82 action_runner.ScrollPage() | 82 action_runner.ScrollPage() |
83 action_runner.WaitForJavaScriptCondition2( | 83 action_runner.WaitForJavaScriptCondition( |
84 'document.getElementsByClassName("doclistview-list").length') | 84 'document.getElementsByClassName("doclistview-list").length') |
85 | 85 |
86 | 86 |
87 class GoogleDocPage(KeyDesktopSitesPage): | 87 class GoogleDocPage(KeyDesktopSitesPage): |
88 | 88 |
89 def __init__(self, page_set): | 89 def __init__(self, page_set): |
90 super(GoogleDocPage, self).__init__( | 90 super(GoogleDocPage, self).__init__( |
91 # pylint: disable=line-too-long | 91 # pylint: disable=line-too-long |
92 url='https://docs.google.com/a/google.com/document/d/1XMAtPiVFZfItsMUOYl39
v5YA8bcSPe4LDrVO25OdsCU/edit', | 92 url='https://docs.google.com/a/google.com/document/d/1XMAtPiVFZfItsMUOYl39
v5YA8bcSPe4LDrVO25OdsCU/edit', |
93 page_set=page_set) | 93 page_set=page_set) |
94 | 94 |
95 self.scrollable_element_function = ''' | 95 self.scrollable_element_function = ''' |
96 function(callback) { | 96 function(callback) { |
97 callback(document.getElementsByClassName('kix-appview-editor')[0]); | 97 callback(document.getElementsByClassName('kix-appview-editor')[0]); |
98 }''' | 98 }''' |
99 self.credentials = 'google' | 99 self.credentials = 'google' |
100 | 100 |
101 def RunPageInteractions(self, action_runner): | 101 def RunPageInteractions(self, action_runner): |
102 with action_runner.CreateGestureInteraction('ScrollAction'): | 102 with action_runner.CreateGestureInteraction('ScrollAction'): |
103 action_runner.ScrollPage() | 103 action_runner.ScrollPage() |
104 action_runner.WaitForJavaScriptCondition2( | 104 action_runner.WaitForJavaScriptCondition( |
105 'document.getElementsByClassName("kix-appview-editor").length') | 105 'document.getElementsByClassName("kix-appview-editor").length') |
106 | 106 |
107 | 107 |
108 class KeyDesktopSitesPageSet(story.StorySet): | 108 class KeyDesktopSitesPageSet(story.StorySet): |
109 | 109 |
110 """ Sites of Interest """ | 110 """ Sites of Interest """ |
111 | 111 |
112 def __init__(self): | 112 def __init__(self): |
113 super(KeyDesktopSitesPageSet, self).__init__( | 113 super(KeyDesktopSitesPageSet, self).__init__( |
114 archive_data_file='data/key_desktop_sites.json', | 114 archive_data_file='data/key_desktop_sites.json', |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 '&q=black%20screen%20amd&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS' | 836 '&q=black%20screen%20amd&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS' |
837 '%20Area%20Feature%20Status%20Owner%20Summary'), | 837 '%20Area%20Feature%20Status%20Owner%20Summary'), |
838 'http://mlb.mlb.com/index.jsp', | 838 'http://mlb.mlb.com/index.jsp', |
839 'http://www.nfl.com/', | 839 'http://www.nfl.com/', |
840 'http://airbnb.github.com/infinity/demo-on.html', | 840 'http://airbnb.github.com/infinity/demo-on.html', |
841 'http://habrahabr.ru/post/149892/#habracut' | 841 'http://habrahabr.ru/post/149892/#habracut' |
842 ] | 842 ] |
843 | 843 |
844 for url in urls_list: | 844 for url in urls_list: |
845 self.AddStory(KeyDesktopSitesPage(url, self)) | 845 self.AddStory(KeyDesktopSitesPage(url, self)) |
OLD | NEW |