| OLD | NEW |
| 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/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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 if (!dc.Get()) | 129 if (!dc.Get()) |
| 130 return; | 130 return; |
| 131 uint32 size; | 131 uint32 size; |
| 132 std::vector<BYTE> data; | 132 std::vector<BYTE> data; |
| 133 { | 133 { |
| 134 printing::Emf emf; | 134 printing::Emf emf; |
| 135 EXPECT_TRUE(emf.Init()); | 135 EXPECT_TRUE(emf.Init()); |
| 136 EXPECT_TRUE(emf.context() != NULL); | 136 EXPECT_TRUE(emf.context() != NULL); |
| 137 int pages = 3; | 137 int pages = 3; |
| 138 while (pages) { | 138 while (pages) { |
| 139 EXPECT_TRUE(emf.StartPage(gfx::Size(), gfx::Point(), 1)); | 139 EXPECT_TRUE(emf.StartPage(gfx::Size(), gfx::Rect(), 1)); |
| 140 ::Rectangle(emf.context(), 10, 10, 190, 190); | 140 ::Rectangle(emf.context(), 10, 10, 190, 190); |
| 141 EXPECT_TRUE(emf.FinishPage()); | 141 EXPECT_TRUE(emf.FinishPage()); |
| 142 --pages; | 142 --pages; |
| 143 } | 143 } |
| 144 EXPECT_EQ(3U, emf.GetPageCount()); | 144 EXPECT_EQ(3U, emf.GetPageCount()); |
| 145 EXPECT_TRUE(emf.FinishDocument()); | 145 EXPECT_TRUE(emf.FinishDocument()); |
| 146 size = emf.GetDataSize(); | 146 size = emf.GetDataSize(); |
| 147 EXPECT_TRUE(emf.GetDataAsVector(&data)); | 147 EXPECT_TRUE(emf.GetDataAsVector(&data)); |
| 148 EXPECT_EQ(data.size(), size); | 148 EXPECT_EQ(data.size(), size); |
| 149 } | 149 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 HDC hdc = CreateCompatibleDC(NULL); | 195 HDC hdc = CreateCompatibleDC(NULL); |
| 196 EXPECT_TRUE(hdc); | 196 EXPECT_TRUE(hdc); |
| 197 printing::Emf emf; | 197 printing::Emf emf; |
| 198 EXPECT_TRUE(emf.InitFromFile(metafile_path)); | 198 EXPECT_TRUE(emf.InitFromFile(metafile_path)); |
| 199 RECT output_rect = {0, 0, 10, 10}; | 199 RECT output_rect = {0, 0, 10, 10}; |
| 200 EXPECT_TRUE(emf.Playback(hdc, &output_rect)); | 200 EXPECT_TRUE(emf.Playback(hdc, &output_rect)); |
| 201 EXPECT_TRUE(DeleteDC(hdc)); | 201 EXPECT_TRUE(DeleteDC(hdc)); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace printing | 204 } // namespace printing |
| OLD | NEW |