| 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 exceptions | 9 from telemetry.core import exceptions |
| 10 from telemetry.core import util | 10 from telemetry.core import util |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 browser_options = self._finder_options.browser_options | 87 browser_options = self._finder_options.browser_options |
| 88 if self._finder_options.use_live_sites: | 88 if self._finder_options.use_live_sites: |
| 89 wpr_mode = wpr_modes.WPR_OFF | 89 wpr_mode = wpr_modes.WPR_OFF |
| 90 elif browser_options.wpr_mode == wpr_modes.WPR_RECORD: | 90 elif browser_options.wpr_mode == wpr_modes.WPR_RECORD: |
| 91 wpr_mode = wpr_modes.WPR_RECORD | 91 wpr_mode = wpr_modes.WPR_RECORD |
| 92 else: | 92 else: |
| 93 wpr_mode = wpr_modes.WPR_REPLAY | 93 wpr_mode = wpr_modes.WPR_REPLAY |
| 94 | 94 |
| 95 if self.platform.network_controller.is_open: | 95 if self.platform.network_controller.is_open: |
| 96 self.platform.network_controller.Close() | 96 self.platform.network_controller.Close() |
| 97 self.platform.network_controller.InitializeIfNeeded() |
| 97 self.platform.network_controller.Open(wpr_mode, | 98 self.platform.network_controller.Open(wpr_mode, |
| 98 browser_options.extra_wpr_args) | 99 browser_options.extra_wpr_args) |
| 99 | 100 |
| 100 @property | 101 @property |
| 101 def browser(self): | 102 def browser(self): |
| 102 return self._browser | 103 return self._browser |
| 103 | 104 |
| 104 def _FindBrowser(self, finder_options): | 105 def _FindBrowser(self, finder_options): |
| 105 possible_browser = browser_finder.FindBrowser(finder_options) | 106 possible_browser = browser_finder.FindBrowser(finder_options) |
| 106 if not possible_browser: | 107 if not possible_browser: |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 class SharedDesktopPageState(SharedPageState): | 340 class SharedDesktopPageState(SharedPageState): |
| 340 _device_type = 'desktop' | 341 _device_type = 'desktop' |
| 341 | 342 |
| 342 | 343 |
| 343 class SharedTabletPageState(SharedPageState): | 344 class SharedTabletPageState(SharedPageState): |
| 344 _device_type = 'tablet' | 345 _device_type = 'tablet' |
| 345 | 346 |
| 346 | 347 |
| 347 class Shared10InchTabletPageState(SharedPageState): | 348 class Shared10InchTabletPageState(SharedPageState): |
| 348 _device_type = 'tablet_10_inch' | 349 _device_type = 'tablet_10_inch' |
| OLD | NEW |