| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 VerifyPreviewPageCount(3); | 890 VerifyPreviewPageCount(3); |
| 891 VerifyPrintPreviewCancelled(false); | 891 VerifyPrintPreviewCancelled(false); |
| 892 VerifyPrintPreviewFailed(false); | 892 VerifyPrintPreviewFailed(false); |
| 893 VerifyPrintPreviewGenerated(true); | 893 VerifyPrintPreviewGenerated(true); |
| 894 VerifyPagesPrinted(false); | 894 VerifyPagesPrinted(false); |
| 895 } | 895 } |
| 896 | 896 |
| 897 // Test to verify that preview generated only for one page. | 897 // Test to verify that preview generated only for one page. |
| 898 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, OnPrintPreviewForSelectedText) { | 898 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, OnPrintPreviewForSelectedText) { |
| 899 LoadHTML(kMultipageHTML); | 899 LoadHTML(kMultipageHTML); |
| 900 GetMainFrame()->selectRange( | 900 GetMainFrame()->selectRange(blink::WebRange(1, 3)); |
| 901 blink::WebRange::fromDocumentRange(GetMainFrame(), 1, 3)); | |
| 902 | 901 |
| 903 // Fill in some dummy values. | 902 // Fill in some dummy values. |
| 904 base::DictionaryValue dict; | 903 base::DictionaryValue dict; |
| 905 CreatePrintSettingsDictionary(&dict); | 904 CreatePrintSettingsDictionary(&dict); |
| 906 dict.SetBoolean(kSettingShouldPrintSelectionOnly, true); | 905 dict.SetBoolean(kSettingShouldPrintSelectionOnly, true); |
| 907 | 906 |
| 908 OnPrintPreview(dict); | 907 OnPrintPreview(dict); |
| 909 | 908 |
| 910 VerifyPreviewPageCount(1); | 909 VerifyPreviewPageCount(1); |
| 911 VerifyPrintPreviewCancelled(false); | 910 VerifyPrintPreviewCancelled(false); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 | 1053 |
| 1055 VerifyPrintFailed(true); | 1054 VerifyPrintFailed(true); |
| 1056 VerifyPagesPrinted(false); | 1055 VerifyPagesPrinted(false); |
| 1057 } | 1056 } |
| 1058 #endif // defined(ENABLE_BASIC_PRINTING) | 1057 #endif // defined(ENABLE_BASIC_PRINTING) |
| 1059 #endif // defined(ENABLE_PRINT_PREVIEW) | 1058 #endif // defined(ENABLE_PRINT_PREVIEW) |
| 1060 | 1059 |
| 1061 #endif // !defined(OS_CHROMEOS) | 1060 #endif // !defined(OS_CHROMEOS) |
| 1062 | 1061 |
| 1063 } // namespace printing | 1062 } // namespace printing |
| OLD | NEW |