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

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

Issue 11411367: [chromedriver] Change testLoadUrl to use the supplied Chrome binary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """End to end tests for ChromeDriver.""" 5 """End to end tests for ChromeDriver."""
6 6
7 import ctypes 7 import ctypes
8 import os 8 import os
9 import sys 9 import sys
10 import unittest 10 import unittest
11 11
12 import chromedriver 12 import chromedriver
13 13
14 14
15 class ChromeDriverTest(unittest.TestCase): 15 class ChromeDriverTest(unittest.TestCase):
16 """End to end tests for ChromeDriver.""" 16 """End to end tests for ChromeDriver."""
17 17
18 def testStartStop(self): 18 def testStartStop(self):
19 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY) 19 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
20 driver.Quit() 20 driver.Quit()
21 21
22 def testLoadUrl(self): 22 def testLoadUrl(self):
23 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB) 23 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
24 driver.Load('http://www.google.com') 24 driver.Load('http://www.google.com')
25 driver.Quit() 25 driver.Quit()
26 26
27 27
28 if __name__ == '__main__': 28 if __name__ == '__main__':
29 if len(sys.argv) != 2 and len(sys.argv) != 3: 29 if len(sys.argv) != 2 and len(sys.argv) != 3:
30 print ('Usage: %s <path_to_chromedriver_so> [path_to_chrome_binary]' % 30 print ('Usage: %s <path_to_chromedriver_so> [path_to_chrome_binary]' %
31 __file__) 31 __file__)
32 sys.exit(1) 32 sys.exit(1)
33 global _CHROMEDRIVER_LIB 33 global _CHROMEDRIVER_LIB
34 _CHROMEDRIVER_LIB = os.path.abspath(sys.argv[1]) 34 _CHROMEDRIVER_LIB = os.path.abspath(sys.argv[1])
35 global _CHROME_BINARY 35 global _CHROME_BINARY
36 if len(sys.argv) == 3: 36 if len(sys.argv) == 3:
37 _CHROME_BINARY = os.path.abspath(sys.argv[2]) 37 _CHROME_BINARY = os.path.abspath(sys.argv[2])
38 else: 38 else:
39 _CHROME_BINARY = None 39 _CHROME_BINARY = None
40 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 40 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
41 sys.modules[__name__]) 41 sys.modules[__name__])
42 result = unittest.TextTestRunner().run(all_tests_suite) 42 result = unittest.TextTestRunner().run(all_tests_suite)
43 sys.exit(len(result.failures) + len(result.errors)) 43 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