summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromedriver/run_py_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/chromedriver/run_py_tests.py')
-rwxr-xr-xchrome/test/chromedriver/run_py_tests.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/test/chromedriver/run_py_tests.py b/chrome/test/chromedriver/run_py_tests.py
index 5b92214..79a6bb6 100755
--- a/chrome/test/chromedriver/run_py_tests.py
+++ b/chrome/test/chromedriver/run_py_tests.py
@@ -356,16 +356,21 @@ class ChromeSwitchesCapabilitiesTest(unittest.TestCase):
Makes sure the switches are passed to Chrome.
"""
+ def setUp(self):
+ self._driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB,
+ chrome_binary=_CHROME_BINARY,
+ chrome_switches=['dom-automation'])
+
+ def tearDown(self):
+ self._driver.Quit()
+
def testSwitchWithoutArgument(self):
"""Tests that switch --dom-automation can be passed to Chrome.
Unless --dom-automation is specified, window.domAutomationController
is undefined.
"""
- driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB,
- chrome_binary=_CHROME_BINARY,
- chrome_switches=['dom-automation'])
- result = driver.ExecuteScript('return window.domAutomationController')
+ result = self._driver.ExecuteScript('return window.domAutomationController')
self.assertNotEqual(None, result)
@@ -382,6 +387,7 @@ class ChromeExtensionsCapabilityTest(unittest.TestCase):
driver = chromedriver.ChromeDriver(_CHROMEDRIVER_LIB,
chrome_binary=_CHROME_BINARY,
chrome_extensions=extensions)
+ driver.Quit()
if __name__ == '__main__':