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.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry.page import shared_page_state | 5 from telemetry.page import shared_page_state |
6 | 6 |
7 | 7 |
8 class TopPages(page_module.Page): | 8 class TopPages(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set, shared_page_state_class, | 10 def __init__(self, url, page_set, shared_page_state_class, |
11 name='', credentials=None): | 11 name='', credentials=None): |
12 if name == '': | |
13 name = url | |
14 super(TopPages, self).__init__( | 12 super(TopPages, self).__init__( |
15 url=url, page_set=page_set, name=name, | 13 url=url, page_set=page_set, name=name, |
16 credentials_path='data/credentials.json', | 14 credentials_path='data/credentials.json', |
17 shared_page_state_class=shared_page_state_class) | 15 shared_page_state_class=shared_page_state_class) |
18 self.archive_data_file = 'data/top_25.json' | 16 self.archive_data_file = 'data/top_25.json' |
19 self.credentials = credentials | 17 self.credentials = credentials |
20 | 18 |
21 | 19 |
22 class GoogleWebSearchPage(TopPages): | 20 class GoogleWebSearchPage(TopPages): |
23 | 21 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 def __init__(self, page_set, | 286 def __init__(self, page_set, |
289 shared_page_state_class=shared_page_state.SharedPageState): | 287 shared_page_state_class=shared_page_state.SharedPageState): |
290 super(YahooGamesPage, self).__init__( | 288 super(YahooGamesPage, self).__init__( |
291 url='http://games.yahoo.com', | 289 url='http://games.yahoo.com', |
292 page_set=page_set, | 290 page_set=page_set, |
293 shared_page_state_class=shared_page_state_class) | 291 shared_page_state_class=shared_page_state_class) |
294 | 292 |
295 def RunNavigateSteps(self, action_runner): | 293 def RunNavigateSteps(self, action_runner): |
296 super(YahooGamesPage, self).RunNavigateSteps(action_runner) | 294 super(YahooGamesPage, self).RunNavigateSteps(action_runner) |
297 action_runner.Wait(2) | 295 action_runner.Wait(2) |
OLD | NEW |