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/render_view_test.h" | 8 #include "chrome/test/base/render_view_test.h" |
9 #include "printing/print_job_constants.h" | 9 #include "printing/print_job_constants.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 void CreatePrintSettingsDictionary(DictionaryValue* dict) { | 36 void CreatePrintSettingsDictionary(DictionaryValue* dict) { |
37 dict->SetBoolean(printing::kSettingLandscape, false); | 37 dict->SetBoolean(printing::kSettingLandscape, false); |
38 dict->SetBoolean(printing::kSettingCollate, false); | 38 dict->SetBoolean(printing::kSettingCollate, false); |
39 dict->SetBoolean(printing::kSettingColor, false); | 39 dict->SetBoolean(printing::kSettingColor, false); |
40 dict->SetBoolean(printing::kSettingPrintToPDF, true); | 40 dict->SetBoolean(printing::kSettingPrintToPDF, true); |
41 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); | 41 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); |
42 dict->SetInteger(printing::kSettingCopies, 1); | 42 dict->SetInteger(printing::kSettingCopies, 1); |
43 dict->SetString(printing::kSettingDeviceName, "dummy"); | 43 dict->SetString(printing::kSettingDeviceName, "dummy"); |
44 dict->SetInteger(printing::kPreviewRequestID, 12345); | 44 dict->SetInteger(printing::kPreviewRequestID, 12345); |
45 dict->SetBoolean(printing::kIsFirstRequest, true); | 45 dict->SetBoolean(printing::kIsFirstRequest, true); |
| 46 dict->SetBoolean(printing::kSettingHeaderFooterEnabled, false); |
46 } | 47 } |
47 | 48 |
48 } // namespace | 49 } // namespace |
49 | 50 |
50 class PrintWebViewHelperTestBase : public RenderViewTest { | 51 class PrintWebViewHelperTestBase : public RenderViewTest { |
51 public: | 52 public: |
52 PrintWebViewHelperTestBase() {} | 53 PrintWebViewHelperTestBase() {} |
53 ~PrintWebViewHelperTestBase() {} | 54 ~PrintWebViewHelperTestBase() {} |
54 | 55 |
55 protected: | 56 protected: |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 LoadHTML(kPrintPreviewHTML); | 403 LoadHTML(kPrintPreviewHTML); |
403 | 404 |
404 // An empty dictionary should fail. | 405 // An empty dictionary should fail. |
405 DictionaryValue empty_dict; | 406 DictionaryValue empty_dict; |
406 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(empty_dict); | 407 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(empty_dict); |
407 | 408 |
408 VerifyPrintFailed(true); | 409 VerifyPrintFailed(true); |
409 VerifyPagesPrinted(false); | 410 VerifyPagesPrinted(false); |
410 } | 411 } |
411 #endif // !defined(OS_CHROMEOS) | 412 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |