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

Unified Diff: chrome/renderer/print_web_view_helper_browsertest.cc

Issue 7817013: PrintPreview: Added code to identify the printer default duplex value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failures Created 9 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/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 abc34d5a5e3305faf55fd3ddcf57ecce8aeda283..b08e9f821d2aea7054b34e1af0aae94ba7488b5b 100644
--- a/chrome/renderer/print_web_view_helper_browsertest.cc
+++ b/chrome/renderer/print_web_view_helper_browsertest.cc
@@ -38,11 +38,17 @@ const char kPrintPreviewHTML[] =
"<body><p id=\"pdf-viewer\">Hello World!</p></body>";
vandebo (ex-Chrome) 2011/09/02 18:12:50 Probably should add a test for the new code you ad
kmadhusu 2011/09/03 00:34:00 I have added a js test.
void CreatePrintSettingsDictionary(DictionaryValue* dict) {
+ DictionaryValue* duplex_info = new DictionaryValue();
+ duplex_info->SetInteger(printing::kPrinterDefaultDuplexValue,
+ printing::ONE_SIDED);
+ duplex_info->SetInteger(printing::kUserSelectedDuplexValue,
+ printing::SIMPLEX);
+
dict->SetBoolean(printing::kSettingLandscape, false);
dict->SetBoolean(printing::kSettingCollate, false);
dict->SetBoolean(printing::kSettingColor, false);
dict->SetBoolean(printing::kSettingPrintToPDF, true);
- dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX);
+ dict->Set(printing::kSettingDuplexModeInfo, duplex_info);
dict->SetInteger(printing::kSettingCopies, 1);
dict->SetString(printing::kSettingDeviceName, "dummy");
dict->SetString(printing::kPreviewUIAddr, "0xb33fbeef");
@@ -380,6 +386,7 @@ TEST_F(PrintWebViewHelperPreviewTest, OnPrintPreview) {
// Fill in some dummy values.
DictionaryValue dict;
CreatePrintSettingsDictionary(&dict);
+
PrintWebViewHelper::Get(view_)->OnPrintPreview(dict);
EXPECT_EQ(0, render_thread_.print_preview_pages_remaining());

Powered by Google App Engine
This is Rietveld 408576698