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 "printing/emf_win.h" | 5 #include "printing/emf_win.h" |
6 | 6 |
7 // For quick access. | 7 // For quick access. |
8 #include <wingdi.h> | 8 #include <wingdi.h> |
9 #include <winspool.h> | 9 #include <winspool.h> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (IsTestCaseDisabled()) | 71 if (IsTestCaseDisabled()) |
72 return; | 72 return; |
73 | 73 |
74 printing::PrintSettings settings; | 74 printing::PrintSettings settings; |
75 | 75 |
76 // My test case is a HP Color LaserJet 4550 PCL. | 76 // My test case is a HP Color LaserJet 4550 PCL. |
77 settings.set_device_name(L"UnitTest Printer"); | 77 settings.set_device_name(L"UnitTest Printer"); |
78 | 78 |
79 // Initialize it. | 79 // Initialize it. |
80 scoped_ptr<printing::PrintingContext> context( | 80 scoped_ptr<printing::PrintingContext> context( |
81 printing::PrintingContext::Create()); | 81 printing::PrintingContext::Create(std::string())); |
82 EXPECT_EQ(context->InitWithSettings(settings), printing::PrintingContext::OK); | 82 EXPECT_EQ(context->InitWithSettings(settings), printing::PrintingContext::OK); |
83 | 83 |
84 FilePath emf_file; | 84 FilePath emf_file; |
85 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &emf_file)); | 85 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &emf_file)); |
86 emf_file = emf_file.Append(FILE_PATH_LITERAL("printing")) | 86 emf_file = emf_file.Append(FILE_PATH_LITERAL("printing")) |
87 .Append(FILE_PATH_LITERAL("test")) | 87 .Append(FILE_PATH_LITERAL("test")) |
88 .Append(FILE_PATH_LITERAL("data")) | 88 .Append(FILE_PATH_LITERAL("data")) |
89 .Append(FILE_PATH_LITERAL("test4.emf")); | 89 .Append(FILE_PATH_LITERAL("test4.emf")); |
90 // Load any EMF with an image. | 90 // Load any EMF with an image. |
91 printing::Emf emf; | 91 printing::Emf emf; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Playback the data. | 187 // Playback the data. |
188 hdc = CreateCompatibleDC(NULL); | 188 hdc = CreateCompatibleDC(NULL); |
189 EXPECT_TRUE(hdc); | 189 EXPECT_TRUE(hdc); |
190 EXPECT_TRUE(emf.CreateFromFile(metafile_path)); | 190 EXPECT_TRUE(emf.CreateFromFile(metafile_path)); |
191 RECT output_rect = {0, 0, 10, 10}; | 191 RECT output_rect = {0, 0, 10, 10}; |
192 EXPECT_TRUE(emf.Playback(hdc, &output_rect)); | 192 EXPECT_TRUE(emf.Playback(hdc, &output_rect)); |
193 EXPECT_TRUE(DeleteDC(hdc)); | 193 EXPECT_TRUE(DeleteDC(hdc)); |
194 emf.CloseEmf(); | 194 emf.CloseEmf(); |
195 } | 195 } |
196 | 196 |
OLD | NEW |