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

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

Issue 1162473006: [chromedriver] Include print preview dialog in window handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/chrome/chrome_impl.cc ('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/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 b63b926a9466796fcb90f011177654cdc0e187da..c49801577a3cac95bdbce86b4326685ac8c9a37d 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -1081,6 +1081,15 @@ class ChromeDriverTest(ChromeDriverBaseTest):
p = self._driver.FindElement('tag name', 'p')
self.assertEquals('Two', p.GetText())
+ def testCanSwitchToPrintPreviewDialog(self):
+ old_handles = self._driver.GetWindowHandles()
+ self.assertEquals(1, len(old_handles))
+ self._driver.ExecuteScript('setTimeout(function(){window.print();}, 0);')
+ new_window_handle = self._WaitForNewWindow(old_handles)
+ self.assertNotEqual(None, new_window_handle)
+ self._driver.SwitchToWindow(new_window_handle)
+ self.assertEquals('chrome://print/', self._driver.GetCurrentUrl())
+
class ChromeDriverAndroidTest(ChromeDriverBaseTest):
"""End to end tests for Android-specific tests."""
« no previous file with comments | « chrome/test/chromedriver/chrome/chrome_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698