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

Side by Side Diff: printing/printing_context_win_unittest.cc

Issue 605563002: Remove implicit HANDLE conversions from printing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return E_FAIL; 59 return E_FAIL;
60 60
61 scoped_ptr<uint8[]> buffer; 61 scoped_ptr<uint8[]> buffer;
62 const DEVMODE* dev_mode = NULL; 62 const DEVMODE* dev_mode = NULL;
63 HRESULT result = S_OK; 63 HRESULT result = S_OK;
64 lppd->hDC = NULL; 64 lppd->hDC = NULL;
65 lppd->hDevMode = NULL; 65 lppd->hDevMode = NULL;
66 lppd->hDevNames = NULL; 66 lppd->hDevNames = NULL;
67 67
68 PrinterInfo2 info_2; 68 PrinterInfo2 info_2;
69 if (info_2.Init(printer)) { 69 if (info_2.Init(printer.Get())) {
70 dev_mode = info_2.get()->pDevMode; 70 dev_mode = info_2.get()->pDevMode;
71 } 71 }
72 if (!dev_mode) { 72 if (!dev_mode) {
73 result = E_FAIL; 73 result = E_FAIL;
74 goto Cleanup; 74 goto Cleanup;
75 } 75 }
76 76
77 lppd->hDC = CreateDC(L"WINSPOOL", printer_name.c_str(), NULL, dev_mode); 77 lppd->hDC = CreateDC(L"WINSPOOL", printer_name.c_str(), NULL, dev_mode);
78 if (!lppd->hDC) { 78 if (!lppd->hDC) {
79 result = E_FAIL; 79 result = E_FAIL;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings)); 179 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings));
180 180
181 // The print may lie to use and may not support world transformation. 181 // The print may lie to use and may not support world transformation.
182 // Verify right now. 182 // Verify right now.
183 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; 183 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 };
184 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); 184 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix));
185 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); 185 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY));
186 } 186 }
187 187
188 } // namespace printing 188 } // 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