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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/gfx/gdi_util.h" | 7 #include "base/gfx/gdi_util.h" |
8 #include "skia/ext/platform_device.h" | 8 #include "skia/ext/platform_device.h" |
9 #include "base/gfx/png_decoder.h" | 9 #include "base/gfx/png_decoder.h" |
10 #include "base/gfx/png_encoder.h" | 10 #include "base/gfx/png_encoder.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 EXPECT_NE(rect.width(), 0); | 165 EXPECT_NE(rect.width(), 0); |
166 EXPECT_NE(rect.height(), 0); | 166 EXPECT_NE(rect.height(), 0); |
167 size_ = rect.size(); | 167 size_ = rect.size(); |
168 gfx::CreateBitmapV4Header(rect.width(), rect.height(), &hdr); | 168 gfx::CreateBitmapV4Header(rect.width(), rect.height(), &hdr); |
169 void* bits; | 169 void* bits; |
170 HBITMAP bitmap = CreateDIBSection(hdc, | 170 HBITMAP bitmap = CreateDIBSection(hdc, |
171 reinterpret_cast<BITMAPINFO*>(&hdr), 0, | 171 reinterpret_cast<BITMAPINFO*>(&hdr), 0, |
172 &bits, NULL, 0); | 172 &bits, NULL, 0); |
173 EXPECT_TRUE(bitmap); | 173 EXPECT_TRUE(bitmap); |
174 EXPECT_TRUE(SelectObject(hdc, bitmap)); | 174 EXPECT_TRUE(SelectObject(hdc, bitmap)); |
175 gfx::PlatformDeviceWin::InitializeDC(hdc); | 175 skia::PlatformDeviceWin::InitializeDC(hdc); |
176 EXPECT_TRUE(emf.Playback(hdc, NULL)); | 176 EXPECT_TRUE(emf.Playback(hdc, NULL)); |
177 row_length_ = size_.width() * sizeof(uint32); | 177 row_length_ = size_.width() * sizeof(uint32); |
178 size_t bytes = row_length_ * size_.height(); | 178 size_t bytes = row_length_ * size_.height(); |
179 ASSERT_TRUE(bytes); | 179 ASSERT_TRUE(bytes); |
180 data_.resize(bytes); | 180 data_.resize(bytes); |
181 memcpy(&*data_.begin(), bits, bytes); | 181 memcpy(&*data_.begin(), bits, bytes); |
182 DeleteDC(hdc); | 182 DeleteDC(hdc); |
183 DeleteObject(bitmap); | 183 DeleteObject(bitmap); |
184 } | 184 } |
185 | 185 |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 url = server.TestServerPage("files/printing/test1.html"); | 620 url = server.TestServerPage("files/printing/test1.html"); |
621 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 621 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
622 tab_proxy->NavigateToURL(url)); | 622 tab_proxy->NavigateToURL(url)); |
623 } | 623 } |
624 CloseBrowserAndServer(); | 624 CloseBrowserAndServer(); |
625 | 625 |
626 EXPECT_EQ(0., CompareWithResult(L"iframe")) | 626 EXPECT_EQ(0., CompareWithResult(L"iframe")) |
627 << L"iframe"; | 627 << L"iframe"; |
628 } | 628 } |
629 | 629 |
OLD | NEW |