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

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

Issue 1166633003: [chromedriver] Use hasTouchScreen capability to test for synthetic gestures in test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« 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 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
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
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))
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