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

Side by Side Diff: chrome/browser/printing/printing_layout_uitest.cc

Issue 125109: Refactor the PlatformContext layer to have only one class. (Closed)
Patch Set: Created 11 years, 6 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_NE(rect.width(), 0); 162 EXPECT_NE(rect.width(), 0);
163 EXPECT_NE(rect.height(), 0); 163 EXPECT_NE(rect.height(), 0);
164 size_ = rect.size(); 164 size_ = rect.size();
165 gfx::CreateBitmapV4Header(rect.width(), rect.height(), &hdr); 165 gfx::CreateBitmapV4Header(rect.width(), rect.height(), &hdr);
166 void* bits; 166 void* bits;
167 HBITMAP bitmap = CreateDIBSection(hdc, 167 HBITMAP bitmap = CreateDIBSection(hdc,
168 reinterpret_cast<BITMAPINFO*>(&hdr), 0, 168 reinterpret_cast<BITMAPINFO*>(&hdr), 0,
169 &bits, NULL, 0); 169 &bits, NULL, 0);
170 EXPECT_TRUE(bitmap); 170 EXPECT_TRUE(bitmap);
171 EXPECT_TRUE(SelectObject(hdc, bitmap)); 171 EXPECT_TRUE(SelectObject(hdc, bitmap));
172 skia::PlatformDeviceWin::InitializeDC(hdc); 172 skia::PlatformDevice::InitializeDC(hdc);
173 EXPECT_TRUE(emf.Playback(hdc, NULL)); 173 EXPECT_TRUE(emf.Playback(hdc, NULL));
174 row_length_ = size_.width() * sizeof(uint32); 174 row_length_ = size_.width() * sizeof(uint32);
175 size_t bytes = row_length_ * size_.height(); 175 size_t bytes = row_length_ * size_.height();
176 ASSERT_TRUE(bytes); 176 ASSERT_TRUE(bytes);
177 data_.resize(bytes); 177 data_.resize(bytes);
178 memcpy(&*data_.begin(), bits, bytes); 178 memcpy(&*data_.begin(), bits, bytes);
179 DeleteDC(hdc); 179 DeleteDC(hdc);
180 DeleteObject(bitmap); 180 DeleteObject(bitmap);
181 } 181 }
182 182
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 615
616 // Force a navigation elsewhere to verify that it's fine with it. 616 // Force a navigation elsewhere to verify that it's fine with it.
617 url = server->TestServerPage("files/printing/test1.html"); 617 url = server->TestServerPage("files/printing/test1.html");
618 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, 618 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
619 tab_proxy->NavigateToURL(url)); 619 tab_proxy->NavigateToURL(url));
620 } 620 }
621 CloseBrowserAndServer(); 621 CloseBrowserAndServer();
622 622
623 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; 623 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe";
624 } 624 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/printed_document.cc ('k') | chrome/browser/printing/win_printing_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698