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

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

Issue 2785413002: [chromedriver] Introduce chromeOptions.useAutomationExtension. (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/test/chromedriver/chrome_launcher.cc ('k') | 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 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 extension_path = os.path.join(_TEST_DATA_DIR, 'all_frames') 1811 extension_path = os.path.join(_TEST_DATA_DIR, 'all_frames')
1812 driver = self.CreateDriver( 1812 driver = self.CreateDriver(
1813 chrome_switches=['load-extension=%s' % extension_path]) 1813 chrome_switches=['load-extension=%s' % extension_path])
1814 driver.Load( 1814 driver.Load(
1815 ChromeDriverTest._http_server.GetUrl() + '/chromedriver/container.html') 1815 ChromeDriverTest._http_server.GetUrl() + '/chromedriver/container.html')
1816 driver.SwitchToMainFrame() 1816 driver.SwitchToMainFrame()
1817 self.assertEqual('one', driver.ExecuteScript("return window['global_var']")) 1817 self.assertEqual('one', driver.ExecuteScript("return window['global_var']"))
1818 driver.SwitchToFrame('iframe') 1818 driver.SwitchToFrame('iframe')
1819 self.assertEqual('two', driver.ExecuteScript("return window['iframe_var']")) 1819 self.assertEqual('two', driver.ExecuteScript("return window['iframe_var']"))
1820 1820
1821 def testDontUseAutomationExtension(self):
1822 driver = self.CreateDriver(
1823 experimental_options={'useAutomationExtension': False})
1824 driver.Load('chrome:version')
1825 command_line = driver.FindElement('id', 'command_line').GetText()
1826 self.assertNotIn('load-extension', command_line)
1827
1821 1828
1822 class ChromeLogPathCapabilityTest(ChromeDriverBaseTest): 1829 class ChromeLogPathCapabilityTest(ChromeDriverBaseTest):
1823 """Tests that chromedriver properly processes chromeOptions.logPath.""" 1830 """Tests that chromedriver properly processes chromeOptions.logPath."""
1824 1831
1825 LOG_MESSAGE = 'Welcome to ChromeLogPathCapabilityTest!' 1832 LOG_MESSAGE = 'Welcome to ChromeLogPathCapabilityTest!'
1826 1833
1827 def testChromeLogPath(self): 1834 def testChromeLogPath(self):
1828 """Checks that user can specify the path of the chrome log. 1835 """Checks that user can specify the path of the chrome log.
1829 1836
1830 Verifies that a log message is written into the specified log file. 1837 Verifies that a log message is written into the specified log file.
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 2426
2420 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 2427 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
2421 sys.modules[__name__]) 2428 sys.modules[__name__])
2422 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) 2429 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter)
2423 ChromeDriverTest.GlobalSetUp() 2430 ChromeDriverTest.GlobalSetUp()
2424 MobileEmulationCapabilityTest.GlobalSetUp() 2431 MobileEmulationCapabilityTest.GlobalSetUp()
2425 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) 2432 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests)
2426 ChromeDriverTest.GlobalTearDown() 2433 ChromeDriverTest.GlobalTearDown()
2427 MobileEmulationCapabilityTest.GlobalTearDown() 2434 MobileEmulationCapabilityTest.GlobalTearDown()
2428 sys.exit(len(result.failures) + len(result.errors)) 2435 sys.exit(len(result.failures) + len(result.errors))
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698