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 # 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 action_runner.NavigateToPage(self) | 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.ExecuteJavaScript(''' |
209 { | 209 (function() { |
210 'expression': ''' | 210 var elem = document.createElement('meta'); |
211 (function() { | 211 elem.name='viewport'; |
212 var elem = document.createElement('meta'); | 212 elem.content='initial-scale=1'; |
213 elem.name='viewport'; | 213 document.body.appendChild(elem); |
214 elem.content='initial-scale=1'; | 214 })();''') |
215 document.body.appendChild(elem); | |
216 })();''' | |
217 })) | |
218 action_runner.RunAction(WaitAction( | 215 action_runner.RunAction(WaitAction( |
219 { | 216 { |
220 'seconds': 1 | 217 'seconds': 1 |
221 })) | 218 })) |
222 | 219 |
223 def RunStressMemory(self, action_runner): | 220 def RunStressMemory(self, action_runner): |
224 action_runner.RunAction(ClickElementAction( | 221 action_runner.RunAction(ClickElementAction( |
225 { | 222 { |
226 'selector': 'div[class~="navForward"]' | 223 'selector': 'div[class~="navForward"]' |
227 })) | 224 })) |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 # Why: #1 Alexa reference | 818 # Why: #1 Alexa reference |
822 'http://answers.yahoo.com', | 819 'http://answers.yahoo.com', |
823 # Why: #1 Alexa sports | 820 # Why: #1 Alexa sports |
824 'http://sports.yahoo.com/', | 821 'http://sports.yahoo.com/', |
825 # Why: top tech blog | 822 # Why: top tech blog |
826 'http://techcrunch.com' | 823 'http://techcrunch.com' |
827 ] | 824 ] |
828 | 825 |
829 for url in other_urls: | 826 for url in other_urls: |
830 self.AddPage(Top25Page(url, self)) | 827 self.AddPage(Top25Page(url, self)) |
OLD | NEW |