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 | |
109 @property | 104 @property |
110 def current_tab(self): | 105 def current_tab(self): |
111 return self._current_tab | 106 return self._current_tab |
112 | 107 |
113 @property | 108 @property |
114 def platform(self): | 109 def platform(self): |
115 return self._platform | 110 return self._platform |
116 | 111 |
117 def _CheckTestEnabled(self, test, possible_browser): | 112 def _CheckTestEnabled(self, test, possible_browser): |
118 should_skip, msg = decorators.ShouldSkip(test, possible_browser) | 113 should_skip, msg = decorators.ShouldSkip(test, possible_browser) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}), | 238 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}), |
244 browser_type='android-webview', | 239 browser_type='android-webview', |
245 phase='on_webview')) | 240 phase='on_webview')) |
246 | 241 |
247 # Stories that run on the browser selected by command line options. | 242 # Stories that run on the browser selected by command line options. |
248 self.AddStory(SinglePage( | 243 self.AddStory(SinglePage( |
249 name=re.sub('\W+', '_', url), | 244 name=re.sub('\W+', '_', url), |
250 url=url, | 245 url=url, |
251 browser_type='default', | 246 browser_type='default', |
252 phase='on_chrome')) | 247 phase='on_chrome')) |
OLD | NEW |