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

Unified Diff: chrome_frame/test/ui_test.cc

Issue 9350044: Disable Chrome's print preview in Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: chromium build Created 8 years, 10 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_frame/test/data/window_print.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/ui_test.cc
diff --git a/chrome_frame/test/ui_test.cc b/chrome_frame/test/ui_test.cc
index 86fc3029a5c5abc4e7dad94d38753f3c626a045d..8446ab67e841b96a25ac9f11f629fdd732c59a7a 100644
--- a/chrome_frame/test/ui_test.cc
+++ b/chrome_frame/test/ui_test.cc
@@ -380,6 +380,32 @@ TEST_P(FullTabUITest, DISABLED_TabCrashRefresh) {
LaunchIEAndNavigate(GetSimplePageUrl());
}
+// Test that window.print() on a page results in the native Windows print dialog
+// appearing rather than Chrome's in-page print preview.
+TEST_P(FullTabUITest, WindowPrintOpensNativePrintDialog) {
+ std::wstring window_print_url(GetTestUrl(L"window_print.html"));
+ std::wstring window_print_title(L"window.print");
+
+ const bool is_cf = GetParam().invokes_cf();
+ MockWindowObserver win_observer_mock;
+
+ // When the page is loaded, start watching for the Print dialog to appear.
+ EXPECT_CALL(ie_mock_, OnLoad(is_cf, StrEq(window_print_url)))
+ .WillOnce(WatchWindow(&win_observer_mock, "Print", ""));
robertshield 2012/02/13 20:23:21 Does the print window contain the word "Print" on
grt (UTC plus 2) 2012/02/14 01:48:30 Your guess is as good as mine. I think I have a f
+
+ // When the print dialog opens, close it.
+ EXPECT_CALL(win_observer_mock, OnWindowOpen(_))
+ .WillOnce(DoCloseWindow());
+
+ // When the print dialog closes, close the browser.
+ EXPECT_CALL(win_observer_mock, OnWindowClose(_))
+ .WillOnce(CloseBrowserMock(&ie_mock_));
+
+ // Launch IE and navigate to the window_print.html page, which will
+ // window.print() immediately after loading.
+ LaunchIEAndNavigate(window_print_url);
+}
+
// Test fixture for tests related to the context menu UI. Since the context
// menus for CF and IE are different, these tests are not parameterized.
class ContextMenuTest : public MockIEEventSinkTest, public testing::Test {
« no previous file with comments | « chrome_frame/test/data/window_print.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698