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

Unified Diff: printing/emf_win_unittest.cc

Issue 2538133003: Remove unused printing::Emf code. (Closed)
Patch Set: more Created 3 years, 7 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
« no previous file with comments | « printing/emf_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/emf_win_unittest.cc
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index d8b3121ad7d9b2bee9ae37afbb5f7b341fcf0cac..e98b628a0796df5d94a33421b215ca6d8e91556b 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -47,7 +47,6 @@ class EmfPrintingTest : public testing::Test, public PrintingContext::Delegate {
};
const uint32_t EMF_HEADER_SIZE = 128;
-const int ONE_MB = 1024 * 1024;
} // namespace
@@ -211,29 +210,4 @@ TEST(EmfTest, FileBackedEmf) {
EXPECT_TRUE(DeleteDC(hdc));
}
-TEST(EmfTest, RasterizeMetafile) {
- Emf emf;
- EXPECT_TRUE(emf.Init());
- EXPECT_TRUE(emf.context());
- HBRUSH brush = static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH));
- for (int i = 0; i < 4; ++i) {
- RECT rect = { 5 + i, 5 + i, 5 + i + 1, 5 + i + 2};
- FillRect(emf.context(), &rect, brush);
- }
- EXPECT_TRUE(emf.FinishDocument());
-
- std::unique_ptr<Emf> raster(emf.RasterizeMetafile(1));
- // Just 1px bitmap but should be stretched to the same bounds.
- EXPECT_EQ(emf.GetPageBounds(1), raster->GetPageBounds(1));
-
- raster = emf.RasterizeMetafile(20);
- EXPECT_EQ(emf.GetPageBounds(1), raster->GetPageBounds(1));
-
- raster = emf.RasterizeMetafile(16 * ONE_MB);
- // Expected size about 64MB.
- EXPECT_LE(abs(static_cast<int>(raster->GetDataSize()) - 64 * ONE_MB), ONE_MB);
- // Bounds should still be the same.
- EXPECT_EQ(emf.GetPageBounds(1), raster->GetPageBounds(1));
-}
-
} // namespace printing
« no previous file with comments | « printing/emf_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698