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

Unified Diff: chrome/test/chromedriver/test.py

Issue 11778011: [chromedriver]Add a filter to run a subset of tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/run_py_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/test.py
diff --git a/chrome/test/chromedriver/test.py b/chrome/test/chromedriver/test.py
deleted file mode 100644
index e8fe41dbaf3646e73ef892af9f8ff5963d849c47..0000000000000000000000000000000000000000
--- a/chrome/test/chromedriver/test.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""End to end tests for ChromeDriver."""
-
-import ctypes
-import os
-import sys
-import unittest
-
-import chromedriver
-
-
-class ChromeDriverTest(unittest.TestCase):
- """End to end tests for ChromeDriver."""
-
- def testStartStop(self):
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
- driver.Quit()
-
- def testLoadUrl(self):
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
- driver.Load('http://www.google.com')
- driver.Quit()
-
- def testEvaluateScript(self):
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
- self.assertEquals(1, driver.ExecuteScript('return 1'))
- self.assertEquals(None, driver.ExecuteScript(''))
- driver.Quit()
-
- def testEvaluateScriptWithArgs(self):
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
- script = ('document.body.innerHTML = "<div>b</div><div>c</div>";' +
- 'return {stuff: document.querySelectorAll("div")};')
- stuff = driver.ExecuteScript(script)['stuff']
- script = 'return arguments[0].innerHTML + arguments[1].innerHTML';
- self.assertEquals('bc', driver.ExecuteScript(script, stuff[0], stuff[1]))
- driver.Quit()
-
- def testEvaluateInvalidScript(self):
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB, _CHROME_BINARY)
- self.assertRaises(chromedriver.ChromeDriverException,
- driver.ExecuteScript, '{{{')
- driver.Quit()
-
-
-if __name__ == '__main__':
- if len(sys.argv) != 2 and len(sys.argv) != 3:
- print ('Usage: %s <path_to_chromedriver_so> [path_to_chrome_binary]' %
- __file__)
- sys.exit(1)
- global _CHROMEDRIVER_LIB
- _CHROMEDRIVER_LIB = os.path.abspath(sys.argv[1])
- global _CHROME_BINARY
- if len(sys.argv) == 3:
- _CHROME_BINARY = os.path.abspath(sys.argv[2])
- else:
- _CHROME_BINARY = None
- all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
- sys.modules[__name__])
- result = unittest.TextTestRunner().run(all_tests_suite)
- sys.exit(len(result.failures) + len(result.errors))
« no previous file with comments | « chrome/test/chromedriver/run_py_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698