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

Side by Side Diff: chrome/test/webdriver/run_webdriver_tests.py

Issue 6694007: Small test and ChromeDriver fixes to enable additional tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import logging 7 import logging
8 import optparse 8 import optparse
9 import os 9 import os
10 import sys 10 import sys
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if name.startswith('-'): # Exclude 236 if name.startswith('-'): # Exclude
237 excluded.extend(self._GetTestsFromName(self.TEST_PREFIX + name[1:])) 237 excluded.extend(self._GetTestsFromName(self.TEST_PREFIX + name[1:]))
238 else: 238 else:
239 args.extend(self._GetTestsFromName(self.TEST_PREFIX + name)) 239 args.extend(self._GetTestsFromName(self.TEST_PREFIX + name))
240 for name in excluded: 240 for name in excluded:
241 args.remove(name) 241 args.remove(name)
242 if excluded: 242 if excluded:
243 logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) 243 logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded))
244 return args 244 return args
245 245
246 def _FakePytestHack(self):
247 """Adds a fake 'pytest' module to the system modules.
248
249 This is a hack for getting the text_handling_tests to run. It is the only
dennis_jeffrey 2011/03/23 16:57:02 Optional: you may want to describe why this hack e
kkania 2011/03/26 01:58:32 Done.
250 file that uses the pytest module, which we're not sure we want to pull
251 into chromium yet.
dennis_jeffrey 2011/03/23 16:57:02 This comment may be ambiguous: what is it that you
kkania 2011/03/26 01:58:32 Done.
252 """
253 import imp
254 sys.modules['pytest'] = imp.new_module('pytest')
255
246 def _Run(self): 256 def _Run(self):
247 """Run the tests.""" 257 """Run the tests."""
258 # TODO(kkania): Remove this hack.
259 self._FakePytestHack()
260
248 test_names = self._GetTestNames(self._args) 261 test_names = self._GetTestNames(self._args)
249 262
250 # The tests expect to run with preset 'driver' and 'webserver' class 263 # The tests expect to run with preset 'driver' and 'webserver' class
251 # properties. 264 # properties.
252 launcher = ChromeDriverLauncher(self._options.driver_exe, 265 launcher = ChromeDriverLauncher(self._options.driver_exe,
253 chromedriver_paths.WEBDRIVER_TEST_DATA) 266 chromedriver_paths.WEBDRIVER_TEST_DATA)
254 driver = WebDriver(launcher.GetURL(), {}) 267 driver = WebDriver(launcher.GetURL(), {})
255 # The tests expect a webserver. Since ChromeDriver also operates as one, 268 # The tests expect a webserver. Since ChromeDriver also operates as one,
256 # just pass this dummy class with the right info. 269 # just pass this dummy class with the right info.
257 class DummyWebserver: 270 class DummyWebserver:
(...skipping 12 matching lines...) Expand all
270 verbosity = 1 283 verbosity = 1
271 if self._options.verbose: 284 if self._options.verbose:
272 verbosity = 2 285 verbosity = 2
273 result = GTestTextTestRunner(verbosity=verbosity).run(test_suite) 286 result = GTestTextTestRunner(verbosity=verbosity).run(test_suite)
274 launcher.Kill() 287 launcher.Kill()
275 sys.exit(not result.wasSuccessful()) 288 sys.exit(not result.wasSuccessful())
276 289
277 290
278 if __name__ == '__main__': 291 if __name__ == '__main__':
279 Main() 292 Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698