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

Side by Side Diff: chrome/test/chromedriver/run_py_tests.py

Issue 11830030: [chromedriver]Fix error in pyauto bots run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """End to end tests for ChromeDriver.""" 6 """End to end tests for ChromeDriver."""
7 7
8 import ctypes 8 import ctypes
9 import optparse 9 import optparse
10 import os 10 import os
11 import sys 11 import sys
12 import unittest 12 import unittest
13 13
14 import chromedriver 14 import chromedriver
15 import webserver 15 import webserver
16 16
17 _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) 17 _THIS_DIR = os.path.abspath(os.path.dirname(__file__))
18 sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'pylib')) 18 sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'pylib'))
19 19
20 from common import chrome_paths 20 from common import chrome_paths
21 from common import unittest_util 21 from common import unittest_util
22 22
23 23
24 class ChromeDriverTest(unittest.TestCase): 24 class ChromeDriverTest(unittest.TestCase):
25 """End to end tests for ChromeDriver.""" 25 """End to end tests for ChromeDriver."""
26 26
27 @classmethod 27 @staticmethod
28 def setUpClass(cls): 28 def GlobalSetUp():
29 cls._http_server = webserver.WebServer(chrome_paths.GetTestData()) 29 ChromeDriverTest._http_server = webserver.WebServer(
30 chrome_paths.GetTestData())
30 31
31 @classmethod 32 @staticmethod
32 def tearDownClass(cls): 33 def GlobalTearDown():
33 cls._http_server.Shutdown() 34 ChromeDriverTest._http_server.Shutdown()
34 35
35 @staticmethod 36 @staticmethod
36 def GetHttpUrlForFile(file_path): 37 def GetHttpUrlForFile(file_path):
37 return ChromeDriverTest._http_server.GetUrl() + file_path 38 return ChromeDriverTest._http_server.GetUrl() + file_path
38 39
39 def setUp(self): 40 def setUp(self):
40 self._driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY) 41 self._driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
41 42
42 def tearDown(self): 43 def tearDown(self):
43 self._driver.Quit() 44 self._driver.Quit()
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 _CHROMEDRIVER_LIB = os.path.abspath(options.chromedriver) 111 _CHROMEDRIVER_LIB = os.path.abspath(options.chromedriver)
111 global _CHROME_BINARY 112 global _CHROME_BINARY
112 if options.chrome is not None: 113 if options.chrome is not None:
113 _CHROME_BINARY = os.path.abspath(options.chrome) 114 _CHROME_BINARY = os.path.abspath(options.chrome)
114 else: 115 else:
115 _CHROME_BINARY = None 116 _CHROME_BINARY = None
116 117
117 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 118 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
118 sys.modules[__name__]) 119 sys.modules[__name__])
119 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) 120 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter)
121 ChromeDriverTest.GlobalSetUp();
120 result = unittest.TextTestRunner().run(tests) 122 result = unittest.TextTestRunner().run(tests)
123 ChromeDriverTest.GlobalTearDown();
121 sys.exit(len(result.failures) + len(result.errors)) 124 sys.exit(len(result.failures) + len(result.errors))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698