| 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 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from telemetry.core import platform as platform_module | 9 from telemetry.core import platform as platform_module |
| 10 from telemetry.core import util | 10 from telemetry.core import util |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 wpr_mode = wpr_modes.WPR_RECORD | 80 wpr_mode = wpr_modes.WPR_RECORD |
| 81 else: | 81 else: |
| 82 wpr_mode = wpr_modes.WPR_REPLAY | 82 wpr_mode = wpr_modes.WPR_REPLAY |
| 83 | 83 |
| 84 use_live_traffic = wpr_mode == wpr_modes.WPR_OFF | 84 use_live_traffic = wpr_mode == wpr_modes.WPR_OFF |
| 85 | 85 |
| 86 if self.platform.network_controller.is_open: | 86 if self.platform.network_controller.is_open: |
| 87 self.platform.network_controller.Close() | 87 self.platform.network_controller.Close() |
| 88 self.platform.network_controller.InitializeIfNeeded( | 88 self.platform.network_controller.InitializeIfNeeded( |
| 89 use_live_traffic=use_live_traffic) | 89 use_live_traffic=use_live_traffic) |
| 90 use_wpr_go = False | |
| 91 # Always uses wpr go for recording mode. | |
| 92 if wpr_mode == wpr_modes.WPR_RECORD: | |
| 93 use_wpr_go = True | |
| 94 elif wpr_mode == wpr_modes.WPR_REPLAY: | |
| 95 use_wpr_go = (story_set.wpr_archive_info and | |
| 96 story_set.wpr_archive_info.is_using_wpr_go_archives) | |
| 97 self.platform.network_controller.Open(wpr_mode, | 90 self.platform.network_controller.Open(wpr_mode, |
| 98 browser_options.extra_wpr_args, | 91 browser_options.extra_wpr_args) |
| 99 use_wpr_go=use_wpr_go) | |
| 100 self.platform.Initialize() | 92 self.platform.Initialize() |
| 101 | 93 |
| 102 @property | 94 @property |
| 103 def possible_browser(self): | 95 def possible_browser(self): |
| 104 return self._possible_browser | 96 return self._possible_browser |
| 105 | 97 |
| 106 @property | 98 @property |
| 107 def browser(self): | 99 def browser(self): |
| 108 return self._browser | 100 return self._browser |
| 109 | 101 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 else: | 362 else: |
| 371 _device_type = 'desktop' | 363 _device_type = 'desktop' |
| 372 | 364 |
| 373 | 365 |
| 374 class SharedTabletPageState(SharedPageState): | 366 class SharedTabletPageState(SharedPageState): |
| 375 _device_type = 'tablet' | 367 _device_type = 'tablet' |
| 376 | 368 |
| 377 | 369 |
| 378 class Shared10InchTabletPageState(SharedPageState): | 370 class Shared10InchTabletPageState(SharedPageState): |
| 379 _device_type = 'tablet_10_inch' | 371 _device_type = 'tablet_10_inch' |
| OLD | NEW |