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

Unified Diff: chrome/renderer/printing/print_web_view_helper_browsertest.cc

Issue 488853002: Removed --disable-print-preview switch and policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: chrome/renderer/printing/print_web_view_helper_browsertest.cc
diff --git a/chrome/renderer/printing/print_web_view_helper_browsertest.cc b/chrome/renderer/printing/print_web_view_helper_browsertest.cc
index aac7f4391d6ad1cd80ac0b7f49e3f9301ee41aa7..53e004913ef0330800e76d23db8f929e756566f7 100644
--- a/chrome/renderer/printing/print_web_view_helper_browsertest.cc
+++ b/chrome/renderer/printing/print_web_view_helper_browsertest.cc
@@ -242,30 +242,6 @@ TEST_F(PrintWebViewHelperTest, PrintWithJavascript) {
VerifyPagesPrinted(true);
}
-// Tests that the renderer blocks window.print() calls if they occur too
-// frequently.
-TEST_F(PrintWebViewHelperTest, BlockScriptInitiatedPrinting) {
- // Pretend user will cancel printing.
- chrome_render_thread_->set_print_dialog_user_response(false);
- // Try to print with window.print() a few times.
- PrintWithJavaScript();
- PrintWithJavaScript();
- PrintWithJavaScript();
- VerifyPagesPrinted(false);
-
- // Pretend user will print. (but printing is blocked.)
- chrome_render_thread_->set_print_dialog_user_response(true);
- PrintWithJavaScript();
- VerifyPagesPrinted(false);
-
- // Unblock script initiated printing and verify printing works.
- PrintWebViewHelper::Get(view_)->ResetScriptedPrintCount();
- chrome_render_thread_->printer()->ResetPrinter();
- PrintWithJavaScript();
- VerifyPageCount(1);
- VerifyPagesPrinted(true);
-}
-
// Tests that the renderer always allows window.print() calls if they are user
// initiated.
TEST_F(PrintWebViewHelperTest, AllowUserOriginatedPrinting) {
@@ -467,10 +443,6 @@ class PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
virtual ~PrintWebViewHelperPreviewTest() {}
virtual void SetUp() OVERRIDE {
- // Append the print preview switch before creating the PrintWebViewHelper.
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kRendererPrintPreview);
-
ChromeRenderViewTest::SetUp();
}
@@ -969,15 +941,6 @@ class PrintWebViewHelperKioskTest : public PrintWebViewHelperTestBase {
PrintWebViewHelperKioskTest() {}
virtual ~PrintWebViewHelperKioskTest() {}
- virtual void SetUp() OVERRIDE {
- // Append the throttling disable switch before creating the
- // PrintWebViewHelper.
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kDisableScriptedPrintThrottling);
-
- ChromeRenderViewTest::SetUp();
- }
-
protected:
DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperKioskTest);
};

Powered by Google App Engine
This is Rietveld 408576698