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