| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/chrome_switches.h" | 5 #include "chrome/common/chrome_switches.h" |
| 6 #include "chrome/common/print_messages.h" | 6 #include "chrome/common/print_messages.h" |
| 7 #include "chrome/renderer/print_web_view_helper.h" | 7 #include "chrome/renderer/print_web_view_helper.h" |
| 8 #include "chrome/test/base/chrome_render_view_test.h" | 8 #include "chrome/test/base/chrome_render_view_test.h" |
| 9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
| 10 #include "printing/print_job_constants.h" | 10 #include "printing/print_job_constants.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 dict->SetBoolean(printing::kSettingCollate, false); | 43 dict->SetBoolean(printing::kSettingCollate, false); |
| 44 dict->SetInteger(printing::kSettingColor, printing::GRAY); | 44 dict->SetInteger(printing::kSettingColor, printing::GRAY); |
| 45 dict->SetBoolean(printing::kSettingPrintToPDF, true); | 45 dict->SetBoolean(printing::kSettingPrintToPDF, true); |
| 46 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); | 46 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); |
| 47 dict->SetInteger(printing::kSettingCopies, 1); | 47 dict->SetInteger(printing::kSettingCopies, 1); |
| 48 dict->SetString(printing::kSettingDeviceName, "dummy"); | 48 dict->SetString(printing::kSettingDeviceName, "dummy"); |
| 49 dict->SetString(printing::kPreviewUIAddr, "0xb33fbeef"); | 49 dict->SetString(printing::kPreviewUIAddr, "0xb33fbeef"); |
| 50 dict->SetInteger(printing::kPreviewRequestID, 12345); | 50 dict->SetInteger(printing::kPreviewRequestID, 12345); |
| 51 dict->SetBoolean(printing::kIsFirstRequest, true); | 51 dict->SetBoolean(printing::kIsFirstRequest, true); |
| 52 dict->SetInteger(printing::kSettingMarginsType, printing::DEFAULT_MARGINS); | 52 dict->SetInteger(printing::kSettingMarginsType, printing::DEFAULT_MARGINS); |
| 53 dict->SetBoolean(printing::kSettingPreviewModifiable, false); |
| 53 dict->SetBoolean(printing::kSettingHeaderFooterEnabled, false); | 54 dict->SetBoolean(printing::kSettingHeaderFooterEnabled, false); |
| 54 dict->SetBoolean(printing::kSettingGenerateDraftData, true); | 55 dict->SetBoolean(printing::kSettingGenerateDraftData, true); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace | 58 } // namespace |
| 58 | 59 |
| 59 class PrintWebViewHelperTestBase : public ChromeRenderViewTest { | 60 class PrintWebViewHelperTestBase : public ChromeRenderViewTest { |
| 60 public: | 61 public: |
| 61 PrintWebViewHelperTestBase() {} | 62 PrintWebViewHelperTestBase() {} |
| 62 ~PrintWebViewHelperTestBase() {} | 63 ~PrintWebViewHelperTestBase() {} |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // Fill in some dummy values. | 536 // Fill in some dummy values. |
| 536 DictionaryValue dict; | 537 DictionaryValue dict; |
| 537 CreatePrintSettingsDictionary(&dict); | 538 CreatePrintSettingsDictionary(&dict); |
| 538 OnPrintForPrintPreview(dict); | 539 OnPrintForPrintPreview(dict); |
| 539 | 540 |
| 540 VerifyPrintFailed(true); | 541 VerifyPrintFailed(true); |
| 541 VerifyPagesPrinted(false); | 542 VerifyPagesPrinted(false); |
| 542 } | 543 } |
| 543 | 544 |
| 544 #endif // !defined(OS_CHROMEOS) | 545 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |