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

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

Issue 1882603003: [Chromedriver] Add testcase for testing alert on new window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland - Disable test in _NEGATIVE_FILTER Created 3 years, 9 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 | « no previous file | chrome/test/data/chromedriver/alert_onload.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/test/run_py_tests.py
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py
index 2c5e728952ef44f8938b54e24d74f51f13a94c72..e60b377076a9ec02f3d0bae19a5164dff5e7a6ff 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -67,6 +67,8 @@ _NEGATIVE_FILTER = [
'ChromeDriverTest.testShadowDomHover',
'ChromeDriverTest.testMouseMoveTo',
'ChromeDriverTest.testHoverOverElement',
+ # https://bugs.chromium.org/p/chromedriver/issues/detail?id=833
+ 'ChromeDriverTest.testAlertOnNewWindow',
]
_VERSION_SPECIFIC_FILTER = {}
@@ -211,6 +213,7 @@ _ANDROID_NEGATIVE_FILTER['chromedriver_webview_shell'] = (
'testHistoryNavigationWithPageLoadTimeout',
# Webview shell doesn't support Alerts.
'ChromeDriverTest.testAlert',
+ 'ChromeDriverTest.testAlertOnNewWindow',
'ChromeDesiredCapabilityTest.testUnexpectedAlertBehaviour',
'ChromeDriverTest.testAlertHandlingOnPageUnload',
]
@@ -787,6 +790,18 @@ class ChromeDriverTest(ChromeDriverBaseTestWithWebServer):
self.assertEquals(False,
self._driver.ExecuteScript('return window.confirmed'))
+ def testAlertOnNewWindow(self):
+ self._driver.Load(self.GetHttpUrlForFile('/chromedriver/empty.html'))
+ old_windows = self._driver.GetWindowHandles()
+ self._driver.ExecuteScript("window.open('%s')" %
+ self.GetHttpUrlForFile('/chromedriver/alert_onload.html'))
+ new_window = self.WaitForNewWindow(self._driver, old_windows)
+ self.assertNotEqual(None, new_window)
+ self._driver.SwitchToWindow(new_window)
+ self.assertTrue(self._driver.IsAlertOpen())
+ self._driver.HandleAlert(False)
+ self.assertFalse(self._driver.IsAlertOpen())
+
def testShouldHandleNewWindowLoadingProperly(self):
"""Tests that ChromeDriver determines loading correctly for new windows."""
self._http_server.SetDataForPath(
« no previous file with comments | « no previous file | chrome/test/data/chromedriver/alert_onload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698