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 KeySearchMobilePage(page_module.Page): | 10 class KeySearchMobilePage(page_module.Page): |
11 | 11 |
12 def __init__(self, url, page_set): | 12 def __init__(self, url, page_set): |
13 super(KeySearchMobilePage, self).__init__(url=url, page_set=page_set) | 13 super(KeySearchMobilePage, self).__init__(url=url, page_set=page_set) |
14 self.credentials_path = 'data/credentials.json' | 14 self.credentials_path = 'data/credentials.json' |
15 self.user_agent_type = 'mobile' | 15 self.user_agent_type = 'mobile' |
16 self.archive_data_file = 'data/key_search_mobile.json' | 16 self.archive_data_file = 'data/key_search_mobile.json' |
17 | 17 |
18 def RunSmoothness(self, action_runner): | 18 def RunSmoothness(self, action_runner): |
19 action_runner.RunAction(ScrollAction()) | 19 action_runner.RunAction(ScrollAction()) |
20 | 20 |
21 | 21 |
22 class KeySearchMobilePageSet(page_set_module.PageSet): | 22 class KeySearchMobilePageSet(page_set_module.PageSet): |
23 | 23 |
24 """ Key mobile search queries on google """ | 24 """ Key mobile search queries on google """ |
25 | 25 |
26 def __init__(self): | 26 def __init__(self): |
27 super(KeySearchMobilePageSet, self).__init__( | 27 super(KeySearchMobilePageSet, self).__init__( |
28 credentials_path='data/credentials.json', | 28 credentials_path='data/credentials.json', |
29 user_agent_type='mobile', | 29 user_agent_type='mobile', |
30 archive_data_file='data/key_search_mobile.json') | 30 archive_data_file='data/key_search_mobile.json', |
| 31 bucket=page_set_module.PUBLIC_BUCKET) |
31 | 32 |
32 urls_list = [ | 33 urls_list = [ |
33 # Why: An empty page should be as snappy as possible | 34 # Why: An empty page should be as snappy as possible |
34 'http://www.google.com/', | 35 'http://www.google.com/', |
35 # Why: A reasonable search term with no images or ads usually | 36 # Why: A reasonable search term with no images or ads usually |
36 'https://www.google.com/search?q=science', | 37 'https://www.google.com/search?q=science', |
37 # Why: A reasonable search term with images but no ads usually | 38 # Why: A reasonable search term with images but no ads usually |
38 'http://www.google.com/search?q=orange', | 39 'http://www.google.com/search?q=orange', |
39 # Why: An address search | 40 # Why: An address search |
40 # pylint: disable=C0301 | 41 # pylint: disable=C0301 |
(...skipping 17 matching lines...) Expand all Loading... |
58 # Why: Definitions | 59 # Why: Definitions |
59 'http://www.google.com/search?q=define+define', | 60 'http://www.google.com/search?q=define+define', |
60 # Why: Local results | 61 # Why: Local results |
61 'https://www.google.com/search?q=burritos+94110', | 62 'https://www.google.com/search?q=burritos+94110', |
62 # Why: Graph | 63 # Why: Graph |
63 'http://www.google.com/search?q=x^3' | 64 'http://www.google.com/search?q=x^3' |
64 ] | 65 ] |
65 | 66 |
66 for url in urls_list: | 67 for url in urls_list: |
67 self.AddPage(KeySearchMobilePage(url, self)) | 68 self.AddPage(KeySearchMobilePage(url, self)) |
OLD | NEW |