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 SimplePage(page_module.Page): | 9 class SimplePage(page_module.Page): |
10 def __init__(self, url, page_set, credentials='', name=''): | 10 def __init__(self, url, page_set, credentials='', name=''): |
11 super(SimplePage, self).__init__( | 11 super(SimplePage, self).__init__( |
12 url, page_set=page_set, name=name, | 12 url, page_set=page_set, name=name, |
13 credentials_path='data/credentials.json', | 13 credentials_path='data/credentials.json', |
14 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 14 shared_page_state_class=shared_page_state.SharedDesktopPageState) |
15 self.credentials = credentials | 15 self.credentials = credentials |
16 | 16 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 url='http://www.facebook.com/barackobama', | 79 url='http://www.facebook.com/barackobama', |
80 page_set=page_set, | 80 page_set=page_set, |
81 credentials='facebook', | 81 credentials='facebook', |
82 name='Facebook') | 82 name='Facebook') |
83 | 83 |
84 def RunNavigateSteps(self, action_runner): | 84 def RunNavigateSteps(self, action_runner): |
85 super(Facebook, self).RunNavigateSteps(action_runner) | 85 super(Facebook, self).RunNavigateSteps(action_runner) |
86 action_runner.WaitForElement(text='About') | 86 action_runner.WaitForElement(text='About') |
87 | 87 |
88 | 88 |
89 class Top10PageSet(page_set_module.PageSet): | 89 class Top10PageSet(story.StorySet): |
90 """10 Pages chosen from Alexa top sites""" | 90 """10 Pages chosen from Alexa top sites""" |
91 | 91 |
92 def __init__(self): | 92 def __init__(self): |
93 super(Top10PageSet, self).__init__( | 93 super(Top10PageSet, self).__init__( |
94 archive_data_file='data/top_10.json', | 94 archive_data_file='data/top_10.json', |
95 bucket=page_set_module.PARTNER_BUCKET) | 95 cloud_storage_bucket=story.PARTNER_BUCKET) |
96 | 96 |
97 # top google property; a google tab is often open | 97 # top google property; a google tab is often open |
98 self.AddUserStory(Google(self)) | 98 self.AddUserStory(Google(self)) |
99 | 99 |
100 # productivity, top google properties | 100 # productivity, top google properties |
101 # TODO(dominikg): fix crbug.com/386152 | 101 # TODO(dominikg): fix crbug.com/386152 |
102 #self.AddUserStory(Gmail(self)) | 102 #self.AddUserStory(Gmail(self)) |
103 | 103 |
104 # productivity, top google properties | 104 # productivity, top google properties |
105 self.AddUserStory(GoogleCalendar(self)) | 105 self.AddUserStory(GoogleCalendar(self)) |
(...skipping 12 matching lines...) Expand all Loading... |
118 self.AddUserStory(SimplePage('http://www.amazon.com', self)) | 118 self.AddUserStory(SimplePage('http://www.amazon.com', self)) |
119 | 119 |
120 # #4 Alexa | 120 # #4 Alexa |
121 self.AddUserStory(SimplePage('http://www.yahoo.com/', self)) | 121 self.AddUserStory(SimplePage('http://www.yahoo.com/', self)) |
122 | 122 |
123 # #16 Alexa | 123 # #16 Alexa |
124 self.AddUserStory(SimplePage('http://www.bing.com/', self)) | 124 self.AddUserStory(SimplePage('http://www.bing.com/', self)) |
125 | 125 |
126 # #20 Alexa | 126 # #20 Alexa |
127 self.AddUserStory(SimplePage('http://www.ask.com/', self)) | 127 self.AddUserStory(SimplePage('http://www.ask.com/', self)) |
OLD | NEW |