| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 collections | 5 import collections |
| 6 import logging | 6 import logging |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 import urllib | 9 import urllib |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if finder_options.use_live_sites: | 94 if finder_options.use_live_sites: |
| 95 wpr_mode = wpr_modes.WPR_OFF | 95 wpr_mode = wpr_modes.WPR_OFF |
| 96 elif browser_options.wpr_mode == wpr_modes.WPR_RECORD: | 96 elif browser_options.wpr_mode == wpr_modes.WPR_RECORD: |
| 97 wpr_mode = wpr_modes.WPR_RECORD | 97 wpr_mode = wpr_modes.WPR_RECORD |
| 98 else: | 98 else: |
| 99 wpr_mode = wpr_modes.WPR_REPLAY | 99 wpr_mode = wpr_modes.WPR_REPLAY |
| 100 | 100 |
| 101 self.platform.network_controller.Open(wpr_mode, | 101 self.platform.network_controller.Open(wpr_mode, |
| 102 browser_options.extra_wpr_args) | 102 browser_options.extra_wpr_args) |
| 103 | 103 |
| 104 # Make sure all browsers are open before starting. |
| 105 for story in story_set: |
| 106 if story.browser_type not in self._browsers: |
| 107 self._SetCurrentBrowser(story.browser_type) |
| 108 |
| 104 @property | 109 @property |
| 105 def current_tab(self): | 110 def current_tab(self): |
| 106 return self._current_tab | 111 return self._current_tab |
| 107 | 112 |
| 108 @property | 113 @property |
| 109 def platform(self): | 114 def platform(self): |
| 110 return self._platform | 115 return self._platform |
| 111 | 116 |
| 112 def _CheckTestEnabled(self, test, possible_browser): | 117 def _CheckTestEnabled(self, test, possible_browser): |
| 113 should_skip, msg = decorators.ShouldSkip(test, possible_browser) | 118 should_skip, msg = decorators.ShouldSkip(test, possible_browser) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}), | 243 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}), |
| 239 browser_type='android-webview', | 244 browser_type='android-webview', |
| 240 phase='on_webview')) | 245 phase='on_webview')) |
| 241 | 246 |
| 242 # Stories that run on the browser selected by command line options. | 247 # Stories that run on the browser selected by command line options. |
| 243 self.AddStory(SinglePage( | 248 self.AddStory(SinglePage( |
| 244 name=re.sub('\W+', '_', url), | 249 name=re.sub('\W+', '_', url), |
| 245 url=url, | 250 url=url, |
| 246 browser_type='default', | 251 browser_type='default', |
| 247 phase='on_chrome')) | 252 phase='on_chrome')) |
| OLD | NEW |