summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchrisgao@chromium.org <chrisgao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 18:25:36 +0000
committerchrisgao@chromium.org <chrisgao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 18:25:36 +0000
commit492077fa838f62a980a1aa1d08c7489d9f13de90 (patch)
tree04caa7915a27af059f322c03b530fd5d262ef428
parent9dc8f182a49ff2d994fcbfcac4236e30e9656736 (diff)
downloadchromium_src-492077fa838f62a980a1aa1d08c7489d9f13de90.zip
chromium_src-492077fa838f62a980a1aa1d08c7489d9f13de90.tar.gz
chromium_src-492077fa838f62a980a1aa1d08c7489d9f13de90.tar.bz2
[chromedriver] Fix python test in pyauto bots.
As chrome remote debugging port is hardcoded as 33081, we have to quit chrome after every test, even when the test fails. NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186747 0039d316-1c4b-4281-b951-d872f2087c98
-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__':