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

Unified Diff: printing/emf_win_unittest.cc

Issue 6611032: Unifying NativeMetafile class interface (as much as possible) for Linux, Mac, Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-enabled DCHECK in pdf_ps_metafile_cairo.cc Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: printing/emf_win_unittest.cc
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index 9d3aa00a20e22d0d68dff891d7e487fd1ed1ba36..9ae9323aa211f90beac68d070ed7f7fe2a04c341 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -48,9 +48,9 @@ TEST(EmfTest, DC) {
HDC hdc = CreateCompatibleDC(NULL);
EXPECT_TRUE(hdc != NULL);
EXPECT_TRUE(emf.CreateDc(hdc, &rect));
- EXPECT_TRUE(emf.hdc() != NULL);
+ EXPECT_TRUE(emf.context() != NULL);
// In theory, you'd use the HDC with GDI functions here.
- EXPECT_TRUE(emf.CloseDc());
+ EXPECT_TRUE(emf.Close());
uint32 size = emf.GetDataSize();
EXPECT_EQ(size, EMF_HEADER_SIZE);
std::vector<BYTE> data;
@@ -104,7 +104,7 @@ TEST_F(EmfPrintingTest, Enumerate) {
context->NewPage();
// Process one at a time.
printing::Emf::Enumerator emf_enum(emf, context->context(),
- &emf.GetBounds().ToRECT());
+ &emf.GetPageBounds(1).ToRECT());
for (printing::Emf::Enumerator::const_iterator itr = emf_enum.begin();
itr != emf_enum.end();
++itr) {
@@ -128,15 +128,15 @@ TEST_F(EmfPrintingTest, PageBreak) {
return;
printing::Emf emf;
EXPECT_TRUE(emf.CreateDc(dc.Get(), NULL));
- EXPECT_TRUE(emf.hdc() != NULL);
+ EXPECT_TRUE(emf.context() != NULL);
int pages = 3;
while (pages) {
EXPECT_TRUE(emf.StartPage());
- ::Rectangle(emf.hdc(), 10, 10, 190, 190);
- EXPECT_TRUE(emf.EndPage());
+ ::Rectangle(emf.context(), 10, 10, 190, 190);
+ EXPECT_TRUE(emf.FinishPage());
--pages;
}
- EXPECT_TRUE(emf.CloseDc());
+ EXPECT_TRUE(emf.Close());
uint32 size = emf.GetDataSize();
std::vector<BYTE> data;
EXPECT_TRUE(emf.GetData(&data));
@@ -172,9 +172,9 @@ TEST(EmfTest, FileBackedDC) {
EXPECT_TRUE(file_util::CreateTemporaryFileInDir(scratch_metafile_dir.path(),
&metafile_path));
EXPECT_TRUE(emf.CreateFileBackedDc(hdc, &rect, metafile_path));
- EXPECT_TRUE(emf.hdc() != NULL);
+ EXPECT_TRUE(emf.context() != NULL);
// In theory, you'd use the HDC with GDI functions here.
- EXPECT_TRUE(emf.CloseDc());
+ EXPECT_TRUE(emf.Close());
uint32 size = emf.GetDataSize();
EXPECT_EQ(size, EMF_HEADER_SIZE);

Powered by Google App Engine
This is Rietveld 408576698