| 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_set | 4 from telemetry.page import page_set |
| 5 from telemetry.page import page | 5 from telemetry.page import page |
| 6 | 6 |
| 7 | 7 |
| 8 class Top2012Q3Page(page.Page): | 8 class Top2012Q3Page(page.Page): |
| 9 | 9 |
| 10 def __init__(self, url, ps): | 10 def __init__(self, url, ps): |
| 11 super(Top2012Q3Page, self).__init__(url=url, page_set=ps) | 11 super(Top2012Q3Page, self).__init__( |
| 12 url=url, page_set=ps, credentials_path = 'data/credentials.json') |
| 12 self.make_javascript_deterministic = True | 13 self.make_javascript_deterministic = True |
| 13 self.credentials_path = 'data/credentials.json' | |
| 14 self.archive_data_file = 'data/2012Q3.json' | 14 self.archive_data_file = 'data/2012Q3.json' |
| 15 | 15 |
| 16 def ReloadAndGc(self, action_runner): | 16 def ReloadAndGc(self, action_runner): |
| 17 action_runner.ReloadPage() | 17 action_runner.ReloadPage() |
| 18 action_runner.Wait(1) | 18 action_runner.Wait(1) |
| 19 action_runner.ForceGarbageCollection() | 19 action_runner.ForceGarbageCollection() |
| 20 | 20 |
| 21 def RunSmoothness(self, action_runner): | 21 def RunSmoothness(self, action_runner): |
| 22 interaction = action_runner.BeginGestureInteraction( | 22 interaction = action_runner.BeginGestureInteraction( |
| 23 'ScrollAction', is_smooth=True) | 23 'ScrollAction', is_smooth=True) |
| 24 action_runner.ScrollPage() | 24 action_runner.ScrollPage() |
| 25 interaction.End() | 25 interaction.End() |
| 26 | 26 |
| 27 def RunStressMemory(self, action_runner): | 27 def RunStressMemory(self, action_runner): |
| 28 for _ in xrange(3): | 28 for _ in xrange(3): |
| 29 self.ReloadAndGc(action_runner) | 29 self.ReloadAndGc(action_runner) |
| 30 | 30 |
| 31 | 31 |
| 32 class Top2012Q3PageSet(page_set.PageSet): | 32 class Top2012Q3PageSet(page_set.PageSet): |
| 33 """ Pages hand-picked from top-lists in Q32012. """ | 33 """ Pages hand-picked from top-lists in Q32012. """ |
| 34 | 34 |
| 35 def __init__(self): | 35 def __init__(self): |
| 36 super(Top2012Q3PageSet, self).__init__( | 36 super(Top2012Q3PageSet, self).__init__( |
| 37 make_javascript_deterministic=True, | 37 make_javascript_deterministic=True, |
| 38 credentials_path='data/credentials.json', | |
| 39 archive_data_file='data/2012Q3.json', | 38 archive_data_file='data/2012Q3.json', |
| 40 bucket=page_set.PARTNER_BUCKET) | 39 bucket=page_set.PARTNER_BUCKET) |
| 41 | 40 |
| 42 urls_list = [ | 41 urls_list = [ |
| 43 'http://www.facebook.com/barackobama', | 42 'http://www.facebook.com/barackobama', |
| 44 'https://www.google.com/search?q=barack%20obama', | 43 'https://www.google.com/search?q=barack%20obama', |
| 45 'http://youtube.com', | 44 'http://youtube.com', |
| 46 'http://yahoo.com', | 45 'http://yahoo.com', |
| 47 'http://www.baidu.com/s?wd=barack+obama', | 46 'http://www.baidu.com/s?wd=barack+obama', |
| 48 'http://en.wikipedia.org/wiki/Wikipedia', | 47 'http://en.wikipedia.org/wiki/Wikipedia', |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 'http://www.target.com/c/women/-/N-5xtd3#?lnk=nav_t_spc_1_0', | 269 'http://www.target.com/c/women/-/N-5xtd3#?lnk=nav_t_spc_1_0', |
| 271 'http://dianxin.cn', | 270 'http://dianxin.cn', |
| 272 'http://www.aizhan.com/siteall/www.youboy.com/', | 271 'http://www.aizhan.com/siteall/www.youboy.com/', |
| 273 'http://veiculos-home.mercadolivre.com.br/', | 272 'http://veiculos-home.mercadolivre.com.br/', |
| 274 'http://kakaku.com', | 273 'http://kakaku.com', |
| 275 'http://flipkart.com', | 274 'http://flipkart.com', |
| 276 'http://paipai.com'] | 275 'http://paipai.com'] |
| 277 | 276 |
| 278 for url in urls_list: | 277 for url in urls_list: |
| 279 self.AddPage(Top2012Q3Page(url, self)) | 278 self.AddPage(Top2012Q3Page(url, self)) |
| OLD | NEW |