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 import story |
| 5 from telemetry.page import page as page_module |
4 from telemetry.page import shared_page_state | 6 from telemetry.page import shared_page_state |
5 from telemetry.page import page as page_module | |
6 from telemetry.page import page_set as page_set_module | |
7 | 7 |
8 | 8 |
9 class KeySearchMobilePage(page_module.Page): | 9 class KeySearchMobilePage(page_module.Page): |
10 | 10 |
11 def __init__(self, url, page_set): | 11 def __init__(self, url, page_set): |
12 super(KeySearchMobilePage, self).__init__( | 12 super(KeySearchMobilePage, self).__init__( |
13 url=url, page_set=page_set, credentials_path = 'data/credentials.json', | 13 url=url, page_set=page_set, credentials_path = 'data/credentials.json', |
14 shared_page_state_class=shared_page_state.SharedMobilePageState) | 14 shared_page_state_class=shared_page_state.SharedMobilePageState) |
15 self.archive_data_file = 'data/key_search_mobile.json' | 15 self.archive_data_file = 'data/key_search_mobile.json' |
16 | 16 |
17 def RunPageInteractions(self, action_runner): | 17 def RunPageInteractions(self, action_runner): |
18 with action_runner.CreateGestureInteraction('ScrollAction'): | 18 with action_runner.CreateGestureInteraction('ScrollAction'): |
19 action_runner.ScrollPage() | 19 action_runner.ScrollPage() |
20 | 20 |
21 | 21 |
22 class KeySearchMobilePageSet(page_set_module.PageSet): | 22 class KeySearchMobilePageSet(story.StorySet): |
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 archive_data_file='data/key_search_mobile.json', | 28 archive_data_file='data/key_search_mobile.json', |
29 bucket=page_set_module.PUBLIC_BUCKET) | 29 cloud_storage_bucket=story.PUBLIC_BUCKET) |
30 | 30 |
31 urls_list = [ | 31 urls_list = [ |
32 # Why: An empty page should be as snappy as possible | 32 # Why: An empty page should be as snappy as possible |
33 'http://www.google.com/', | 33 'http://www.google.com/', |
34 # Why: A reasonable search term with no images or ads usually | 34 # Why: A reasonable search term with no images or ads usually |
35 'https://www.google.com/search?q=science', | 35 'https://www.google.com/search?q=science', |
36 # Why: A reasonable search term with images but no ads usually | 36 # Why: A reasonable search term with images but no ads usually |
37 'http://www.google.com/search?q=orange', | 37 'http://www.google.com/search?q=orange', |
38 # Why: An address search | 38 # Why: An address search |
39 # pylint: disable=C0301 | 39 # pylint: disable=C0301 |
(...skipping 17 matching lines...) Expand all Loading... |
57 # Why: Definitions | 57 # Why: Definitions |
58 'http://www.google.com/search?q=define+define', | 58 'http://www.google.com/search?q=define+define', |
59 # Why: Local results | 59 # Why: Local results |
60 'https://www.google.com/search?q=burritos+94110', | 60 'https://www.google.com/search?q=burritos+94110', |
61 # Why: Graph | 61 # Why: Graph |
62 'http://www.google.com/search?q=x^3' | 62 'http://www.google.com/search?q=x^3' |
63 ] | 63 ] |
64 | 64 |
65 for url in urls_list: | 65 for url in urls_list: |
66 self.AddUserStory(KeySearchMobilePage(url, self)) | 66 self.AddUserStory(KeySearchMobilePage(url, self)) |
OLD | NEW |