OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 base64 | 8 import base64 |
9 import json | 9 import json |
10 import math | 10 import math |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1038 |
1039 def testBrowserDoesntSupportSyntheticGestures(self): | 1039 def testBrowserDoesntSupportSyntheticGestures(self): |
1040 # Current versions of stable and beta channel Chrome for Android do not | 1040 # Current versions of stable and beta channel Chrome for Android do not |
1041 # support synthetic gesture commands in DevTools, so touch action tests have | 1041 # support synthetic gesture commands in DevTools, so touch action tests have |
1042 # been disabled for chrome_stable and chrome_beta. | 1042 # been disabled for chrome_stable and chrome_beta. |
1043 # TODO(samuong): when this test starts failing, re-enable touch tests and | 1043 # TODO(samuong): when this test starts failing, re-enable touch tests and |
1044 # delete this test. | 1044 # delete this test. |
1045 if _ANDROID_PACKAGE_KEY: | 1045 if _ANDROID_PACKAGE_KEY: |
1046 packages = ['chrome_stable', 'chrome_beta', 'chromedriver_webview_shell'] | 1046 packages = ['chrome_stable', 'chrome_beta', 'chromedriver_webview_shell'] |
1047 if _ANDROID_PACKAGE_KEY in packages: | 1047 if _ANDROID_PACKAGE_KEY in packages: |
1048 self.assertRaisesRegexp(RuntimeError, | 1048 self.assertFalse(self._driver.capabilities['hasTouchScreen']) |
1049 'Server returned error: Not Implemented', | |
1050 self._driver.TouchPinch, 1, 2, 3.0) | |
1051 | 1049 |
1052 def testHasTouchScreen(self): | 1050 def testHasTouchScreen(self): |
1053 self.assertIn('hasTouchScreen', self._driver.capabilities) | 1051 self.assertIn('hasTouchScreen', self._driver.capabilities) |
1054 if _ANDROID_PACKAGE_KEY: | 1052 if _ANDROID_PACKAGE_KEY: |
1055 self.assertTrue(self._driver.capabilities['hasTouchScreen']) | 1053 self.assertTrue(self._driver.capabilities['hasTouchScreen']) |
1056 else: | 1054 else: |
1057 self.assertFalse(self._driver.capabilities['hasTouchScreen']) | 1055 self.assertFalse(self._driver.capabilities['hasTouchScreen']) |
1058 | 1056 |
1059 def testSwitchesToTopFrameAfterNavigation(self): | 1057 def testSwitchesToTopFrameAfterNavigation(self): |
1060 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/outer.html')) | 1058 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/outer.html')) |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 | 1602 |
1605 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( | 1603 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( |
1606 sys.modules[__name__]) | 1604 sys.modules[__name__]) |
1607 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) | 1605 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) |
1608 ChromeDriverTest.GlobalSetUp() | 1606 ChromeDriverTest.GlobalSetUp() |
1609 MobileEmulationCapabilityTest.GlobalSetUp() | 1607 MobileEmulationCapabilityTest.GlobalSetUp() |
1610 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) | 1608 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) |
1611 ChromeDriverTest.GlobalTearDown() | 1609 ChromeDriverTest.GlobalTearDown() |
1612 MobileEmulationCapabilityTest.GlobalTearDown() | 1610 MobileEmulationCapabilityTest.GlobalTearDown() |
1613 sys.exit(len(result.failures) + len(result.errors)) | 1611 sys.exit(len(result.failures) + len(result.errors)) |
OLD | NEW |