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 |
4 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
5 from telemetry.page import page_set as page_set_module | |
6 | 6 |
7 | 7 |
8 class StartedPage(page_module.Page): | 8 class StartedPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, startup_url, page_set): | 10 def __init__(self, url, startup_url, page_set): |
11 super(StartedPage, self).__init__( | 11 super(StartedPage, self).__init__( |
12 url=url, page_set=page_set, startup_url=startup_url) | 12 url=url, page_set=page_set, startup_url=startup_url) |
13 self.archive_data_file = 'data/startup_pages.json' | 13 self.archive_data_file = 'data/startup_pages.json' |
14 | 14 |
15 def RunNavigateSteps(self, action_runner): | 15 def RunNavigateSteps(self, action_runner): |
16 action_runner.Wait(10) | 16 action_runner.Wait(10) |
17 | 17 |
18 def RunPageInteractions(self, action_runner): | 18 def RunPageInteractions(self, action_runner): |
19 self.RunNavigateSteps(action_runner) | 19 self.RunNavigateSteps(action_runner) |
20 | 20 |
21 | 21 |
22 class StartupPagesPageSet(page_set_module.PageSet): | 22 class StartupPagesPageSet(story.StorySet): |
23 | 23 |
24 """ Pages for testing starting Chrome with a URL. | 24 """ Pages for testing starting Chrome with a URL. |
25 Note that this file can't be used with record_wpr, since record_wpr requires | 25 Note that this file can't be used with record_wpr, since record_wpr requires |
26 a true navigate step, which we do not want for startup testing. Instead use | 26 a true navigate step, which we do not want for startup testing. Instead use |
27 record_wpr startup_pages_record to record data for this test. | 27 record_wpr startup_pages_record to record data for this test. |
28 """ | 28 """ |
29 | 29 |
30 def __init__(self): | 30 def __init__(self): |
31 super(StartupPagesPageSet, self).__init__( | 31 super(StartupPagesPageSet, self).__init__( |
32 archive_data_file='data/startup_pages.json', | 32 archive_data_file='data/startup_pages.json', |
33 bucket=page_set_module.PARTNER_BUCKET) | 33 cloud_storage_bucket=story.PARTNER_BUCKET) |
34 | 34 |
35 # Typical page. | 35 # Typical page. |
36 self.AddUserStory(StartedPage('about:blank', 'about:blank', self)) | 36 self.AddUserStory(StartedPage('about:blank', 'about:blank', self)) |
37 # Typical page. | 37 # Typical page. |
38 self.AddUserStory(StartedPage('http://bbc.co.uk', 'http://bbc.co.uk', self)) | 38 self.AddUserStory(StartedPage('http://bbc.co.uk', 'http://bbc.co.uk', self)) |
39 # Horribly complex page - stress test! | 39 # Horribly complex page - stress test! |
40 self.AddUserStory(StartedPage( | 40 self.AddUserStory(StartedPage( |
41 'http://kapook.com', 'http://kapook.com', self)) | 41 'http://kapook.com', 'http://kapook.com', self)) |
OLD | NEW |