Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: tools/chrome_proxy/webdriver/common.py

Issue 2843463004: Add variations combinations testing framework (Closed)
Patch Set: fix merge issue 3 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/variations_combinations.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 argparse 5 import argparse
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import socket 10 import socket
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 def GetDictKey(argument): 159 def GetDictKey(argument):
160 return argument.split('=', 1)[0] 160 return argument.split('=', 1)[0]
161 if self._flags.browser_args and len(self._flags.browser_args) > 0: 161 if self._flags.browser_args and len(self._flags.browser_args) > 0:
162 # Build a dict of flags mapped to the whole argument. 162 # Build a dict of flags mapped to the whole argument.
163 original_args = {} 163 original_args = {}
164 for arg in self._chrome_args: 164 for arg in self._chrome_args:
165 original_args[GetDictKey(arg)] = arg 165 original_args[GetDictKey(arg)] = arg
166 # Override flags given in code with any command line arguments. 166 # Override flags given in code with any command line arguments.
167 for override_arg in shlex.split(self._flags.browser_args): 167 for override_arg in shlex.split(self._flags.browser_args):
168 arg_key = GetDictKey(override_arg) 168 arg_key = GetDictKey(override_arg)
169 if arg_key in original_args: 169 if (arg_key in original_args
170 and original_args[arg_key] in self._chrome_args):
170 self._chrome_args.remove(original_args[arg_key]) 171 self._chrome_args.remove(original_args[arg_key])
171 self._logger.info('Removed Chrome flag. %s', original_args[arg_key]) 172 self._logger.info('Removed Chrome flag. %s', original_args[arg_key])
172 self._chrome_args.add(override_arg) 173 self._chrome_args.add(override_arg)
173 self._logger.info('Added Chrome flag. %s', override_arg) 174 self._logger.info('Added Chrome flag. %s', override_arg)
174 # Always add the flag that allows histograms to be queried in javascript. 175 # Always add the flag that allows histograms to be queried in javascript.
175 self._chrome_args.add('--enable-stats-collection-bindings') 176 self._chrome_args.add('--enable-stats-collection-bindings')
176 177
177 def _StartDriver(self): 178 def _StartDriver(self):
178 """Parses the flags to pass to Chromium, then starts the ChromeDriver. 179 """Parses the flags to pass to Chromium, then starts the ChromeDriver.
179 180
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 for test_suite in test_suite_iter: 679 for test_suite in test_suite_iter:
679 for test_case in test_suite: 680 for test_case in test_suite:
680 for test in test_case: 681 for test in test_case:
681 # Drop the file name in the form <filename>.<classname>.<methodname> 682 # Drop the file name in the form <filename>.<classname>.<methodname>
682 test_id = test.id()[test.id().find('.') + 1:] 683 test_id = test.id()[test.id().find('.') + 1:]
683 if re.match(test_filter_re, test_id): 684 if re.match(test_filter_re, test_id):
684 tests.addTest(test) 685 tests.addTest(test)
685 testRunner = unittest.runner.TextTestRunner(verbosity=2, 686 testRunner = unittest.runner.TextTestRunner(verbosity=2,
686 failfast=flags.failfast, buffer=(not flags.disable_buffer)) 687 failfast=flags.failfast, buffer=(not flags.disable_buffer))
687 testRunner.run(tests) 688 testRunner.run(tests)
OLDNEW
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/variations_combinations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698