OLD | NEW |
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) | 19 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB) |
20 driver.Quit() | 20 driver.Quit() |
21 | 21 |
| 22 def testLoadUrl(self): |
| 23 driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB) |
| 24 driver.Load('http://www.google.com') |
| 25 driver.Quit() |
| 26 |
22 if __name__ == '__main__': | 27 if __name__ == '__main__': |
23 if len(sys.argv) != 2: | 28 if len(sys.argv) != 2: |
24 print 'Usage: %s <path_to_chromedriver_so>' % __file__ | 29 print 'Usage: %s <path_to_chromedriver_so>' % __file__ |
25 sys.exit(1) | 30 sys.exit(1) |
26 global _CHROMEDRIVER_LIB | 31 global _CHROMEDRIVER_LIB |
27 _CHROMEDRIVER_LIB = os.path.abspath(sys.argv[1]) | 32 _CHROMEDRIVER_LIB = os.path.abspath(sys.argv[1]) |
28 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( | 33 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( |
29 sys.modules[__name__]) | 34 sys.modules[__name__]) |
30 result = unittest.TextTestRunner().run(all_tests_suite) | 35 result = unittest.TextTestRunner().run(all_tests_suite) |
31 sys.exit(len(result.failures) + len(result.errors)) | 36 sys.exit(len(result.failures) + len(result.errors)) |
OLD | NEW |