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

Unified Diff: chrome/renderer/print_web_view_helper_browsertest.cc

Issue 9705084: Block printing from blocked popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix init order Created 8 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 | « chrome/renderer/print_web_view_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper_browsertest.cc
diff --git a/chrome/renderer/print_web_view_helper_browsertest.cc b/chrome/renderer/print_web_view_helper_browsertest.cc
index bc4f8a35bc2c039d1f2c2ab99fa4828d242eb0f1..cff496265accfe4702470624c1d303c6028512bc 100644
--- a/chrome/renderer/print_web_view_helper_browsertest.cc
+++ b/chrome/renderer/print_web_view_helper_browsertest.cc
@@ -196,6 +196,21 @@ TEST_F(PrintWebViewHelperTest, BlockScriptInitiatedPrinting) {
VerifyPagesPrinted(true);
}
+TEST_F(PrintWebViewHelperTest, BlockScriptInitiatedPrintingFromPopup) {
+ // Simulate a blocked popup.
+ chrome_render_thread_->printer()->ResetPrinter();
+ chrome_render_thread_->printer()->SetScriptedPrintAllowed(false);
+ LoadHTML(kPrintWithJSHTML);
+ VerifyPagesPrinted(false);
+
+ // Unblock and verify printing works.
+ chrome_render_thread_->printer()->SetScriptedPrintAllowed(true);
+ chrome_render_thread_->printer()->ResetPrinter();
+ LoadHTML(kPrintWithJSHTML);
+ VerifyPageCount(1);
+ VerifyPagesPrinted(true);
+}
+
#if defined(OS_WIN) || defined(OS_MACOSX)
// TODO(estade): I don't think this test is worth porting to Linux. We will have
// to rip out and replace most of the IPC code if we ever plan to improve
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698