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.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
6 | 6 |
7 from page_sets import top_pages | 7 from page_sets import top_pages |
8 | 8 |
9 | 9 |
10 def _IssueMarkerAndScroll(action_runner): | 10 def _IssueMarkerAndScroll(action_runner): |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 """ Why: productivity, top google properties; Sample doc in the link """ | 69 """ Why: productivity, top google properties; Sample doc in the link """ |
70 | 70 |
71 def RunPageInteractions(self, action_runner): | 71 def RunPageInteractions(self, action_runner): |
72 interaction = action_runner.BeginGestureInteraction( | 72 interaction = action_runner.BeginGestureInteraction( |
73 'ScrollAction', is_smooth=True) | 73 'ScrollAction', is_smooth=True) |
74 action_runner.ScrollElement(selector='.kix-appview-editor') | 74 action_runner.ScrollElement(selector='.kix-appview-editor') |
75 interaction.End() | 75 interaction.End() |
76 | 76 |
77 | 77 |
78 class GoogleMapsPage(top_pages.GoogleMapsPage): | |
79 | |
80 """ Why: productivity, top google properties; drag and drop anywhere """ | |
81 | |
82 def RunPageInteractions(self, action_runner): | |
83 action_runner.WaitForElement(text='Getting around') | |
84 interaction = action_runner.BeginGestureInteraction( | |
85 'DragAction', is_smooth=True) | |
86 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.5, | |
87 left_end_ratio=0.75, top_end_ratio=0.75) | |
88 interaction.End() | |
89 while not action_runner._tab.HasReachedQuiescence() : | |
90 pass | |
91 interaction = action_runner.BeginGestureInteraction( | |
92 'DragAction', is_smooth=True) | |
93 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, | |
94 left_end_ratio=0.75, top_end_ratio=0.5) | |
95 interaction.End() | |
96 action_runner.Wait(5) | |
ssid
2015/02/25 10:44:54
I had to include wait here because the HasReachedQ
| |
97 interaction = action_runner.BeginGestureInteraction( | |
98 'PinchAction', is_smooth=True) | |
99 action_runner.PinchPage(left_anchor_ratio=0.3, top_anchor_ratio=0.2) | |
100 interaction.End() | |
101 | |
102 | |
78 class ESPNSmoothPage(top_pages.ESPNPage): | 103 class ESPNSmoothPage(top_pages.ESPNPage): |
79 | 104 |
80 """ Why: #1 sports """ | 105 """ Why: #1 sports """ |
81 | 106 |
82 def RunPageInteractions(self, action_runner): | 107 def RunPageInteractions(self, action_runner): |
83 interaction = action_runner.BeginGestureInteraction( | 108 interaction = action_runner.BeginGestureInteraction( |
84 'ScrollAction', is_smooth=True) | 109 'ScrollAction', is_smooth=True) |
85 action_runner.ScrollPage(left_start_ratio=0.1) | 110 action_runner.ScrollPage(left_start_ratio=0.1) |
86 interaction.End() | 111 interaction.End() |
87 | 112 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 top_pages.WikipediaPage)(self)) | 144 top_pages.WikipediaPage)(self)) |
120 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 145 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
121 top_pages.TwitterPage)(self)) | 146 top_pages.TwitterPage)(self)) |
122 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 147 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
123 top_pages.PinterestPage)(self)) | 148 top_pages.PinterestPage)(self)) |
124 self.AddUserStory(ESPNSmoothPage(self)) | 149 self.AddUserStory(ESPNSmoothPage(self)) |
125 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 150 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
126 top_pages.WeatherPage)(self)) | 151 top_pages.WeatherPage)(self)) |
127 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 152 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
128 top_pages.YahooGamesPage)(self)) | 153 top_pages.YahooGamesPage)(self)) |
154 self.AddUserStory(GoogleMapsPage(self)) | |
129 | 155 |
130 other_urls = [ | 156 other_urls = [ |
131 # Why: #1 news worldwide (Alexa global) | 157 # Why: #1 news worldwide (Alexa global) |
132 'http://news.yahoo.com', | 158 'http://news.yahoo.com', |
133 # Why: #2 news worldwide | 159 # Why: #2 news worldwide |
134 'http://www.cnn.com', | 160 'http://www.cnn.com', |
135 # Why: #1 world commerce website by visits; #3 commerce in the US by | 161 # Why: #1 world commerce website by visits; #3 commerce in the US by |
136 # time spent | 162 # time spent |
137 'http://www.amazon.com', | 163 'http://www.amazon.com', |
138 # Why: #1 commerce website by time spent by users in US | 164 # Why: #1 commerce website by time spent by users in US |
139 'http://www.ebay.com', | 165 'http://www.ebay.com', |
140 # Why: #1 Alexa recreation | 166 # Why: #1 Alexa recreation |
141 'http://booking.com', | 167 'http://booking.com', |
142 # Why: #1 Alexa reference | 168 # Why: #1 Alexa reference |
143 'http://answers.yahoo.com', | 169 'http://answers.yahoo.com', |
144 # Why: #1 Alexa sports | 170 # Why: #1 Alexa sports |
145 'http://sports.yahoo.com/', | 171 'http://sports.yahoo.com/', |
146 # Why: top tech blog | 172 # Why: top tech blog |
147 'http://techcrunch.com' | 173 'http://techcrunch.com' |
148 ] | 174 ] |
149 | 175 |
150 for url in other_urls: | 176 for url in other_urls: |
151 self.AddUserStory(TopSmoothPage(url, self)) | 177 self.AddUserStory(TopSmoothPage(url, self)) |
OLD | NEW |