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

Side by Side Diff: printing/printing_context_win_unittest.cc

Issue 740983002: Implement window.print() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « printing/printing_context_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "printing/printing_context_win.h" 5 #include "printing/printing_context_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "printing/backend/printing_info_win.h" 9 #include "printing/backend/printing_info_win.h"
10 #include "printing/backend/win_helper.h" 10 #include "printing/backend/win_helper.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 TEST_F(PrintingContextTest, PrintAll) { 155 TEST_F(PrintingContextTest, PrintAll) {
156 base::MessageLoop message_loop; 156 base::MessageLoop message_loop;
157 if (IsTestCaseDisabled()) 157 if (IsTestCaseDisabled())
158 return; 158 return;
159 159
160 MockPrintingContextWin context(this); 160 MockPrintingContextWin context(this);
161 context.AskUserForSettings( 161 context.AskUserForSettings(
162 123, 162 123,
163 false, 163 false,
164 false,
164 base::Bind(&PrintingContextTest::PrintSettingsCallback, 165 base::Bind(&PrintingContextTest::PrintSettingsCallback,
165 base::Unretained(this))); 166 base::Unretained(this)));
166 EXPECT_EQ(PrintingContext::OK, result()); 167 EXPECT_EQ(PrintingContext::OK, result());
167 PrintSettings settings = context.settings(); 168 PrintSettings settings = context.settings();
168 EXPECT_EQ(settings.ranges().size(), 0); 169 EXPECT_EQ(settings.ranges().size(), 0);
169 } 170 }
170 171
171 TEST_F(PrintingContextTest, Base) { 172 TEST_F(PrintingContextTest, Base) {
172 if (IsTestCaseDisabled()) 173 if (IsTestCaseDisabled())
173 return; 174 return;
174 175
175 PrintSettings settings; 176 PrintSettings settings;
176 settings.set_device_name(GetDefaultPrinter()); 177 settings.set_device_name(GetDefaultPrinter());
177 // Initialize it. 178 // Initialize it.
178 scoped_ptr<PrintingContext> context(PrintingContext::Create(this)); 179 scoped_ptr<PrintingContext> context(PrintingContext::Create(this));
179 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings)); 180 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings));
180 181
181 // The print may lie to use and may not support world transformation. 182 // The print may lie to use and may not support world transformation.
182 // Verify right now. 183 // Verify right now.
183 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; 184 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 };
184 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); 185 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix));
185 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); 186 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY));
186 } 187 }
187 188
188 } // namespace printing 189 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698