OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <ocidl.h> | 5 #include <ocidl.h> |
6 #include <commdlg.h> | 6 #include <commdlg.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 TEST_F(PrintingContextTest, Base) { | 106 TEST_F(PrintingContextTest, Base) { |
107 // Sometimes ::GetDefaultPrinter() fails? bug 61509. | 107 // Sometimes ::GetDefaultPrinter() fails? bug 61509. |
108 if (IsTestCaseDisabled()) | 108 if (IsTestCaseDisabled()) |
109 return; | 109 return; |
110 | 110 |
111 printing::PrintSettings settings; | 111 printing::PrintSettings settings; |
112 settings.set_device_name(GetDefaultPrinter()); | 112 settings.set_device_name(GetDefaultPrinter()); |
113 // Initialize it. | 113 // Initialize it. |
114 scoped_ptr<printing::PrintingContext> context( | 114 scoped_ptr<printing::PrintingContext> context( |
115 printing::PrintingContext::Create()); | 115 printing::PrintingContext::Create(std::string())); |
116 EXPECT_EQ(printing::PrintingContext::OK, context->InitWithSettings(settings)); | 116 EXPECT_EQ(printing::PrintingContext::OK, context->InitWithSettings(settings)); |
117 | 117 |
118 // The print may lie to use and may not support world transformation. | 118 // The print may lie to use and may not support world transformation. |
119 // Verify right now. | 119 // Verify right now. |
120 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; | 120 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; |
121 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); | 121 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); |
122 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); | 122 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); |
123 } | 123 } |
124 | 124 |
125 TEST_F(PrintingContextTest, PrintAll) { | 125 TEST_F(PrintingContextTest, PrintAll) { |
126 // Sometimes ::GetDefaultPrinter() fails? bug 61509. | 126 // Sometimes ::GetDefaultPrinter() fails? bug 61509. |
127 if (IsTestCaseDisabled()) | 127 if (IsTestCaseDisabled()) |
128 return; | 128 return; |
129 | 129 |
130 printing::PrintingContextWin context; | 130 std::string dummy_locale; |
| 131 printing::PrintingContextWin context(dummy_locale); |
131 context.SetPrintDialog(&PrintDlgExMock); | 132 context.SetPrintDialog(&PrintDlgExMock); |
132 context.AskUserForSettings( | 133 context.AskUserForSettings( |
133 NULL, | 134 NULL, |
134 123, | 135 123, |
135 false, | 136 false, |
136 NewCallback(static_cast<PrintingContextTest*>(this), | 137 NewCallback(static_cast<PrintingContextTest*>(this), |
137 &PrintingContextTest::PrintSettingsCallback)); | 138 &PrintingContextTest::PrintSettingsCallback)); |
138 ASSERT_EQ(printing::PrintingContext::OK, result()); | 139 ASSERT_EQ(printing::PrintingContext::OK, result()); |
139 printing::PrintSettings settings = context.settings(); | 140 printing::PrintSettings settings = context.settings(); |
140 EXPECT_EQ(settings.ranges.size(), 0); | 141 EXPECT_EQ(settings.ranges.size(), 0); |
141 } | 142 } |
OLD | NEW |