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

Unified Diff: chrome_frame/test/ui_test.cc

Issue 9475014: Merge 121891 - Disable Chrome's print preview in Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: 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
===================================================================
--- chrome_frame/test/ui_test.cc (revision 123778)
+++ chrome_frame/test/ui_test.cc (working copy)
@@ -380,6 +380,32 @@
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", ""));
+
+ // 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