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