Chromium Code Reviews| 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 { |