Index: printing/printed_page_unittest.cc |
diff --git a/printing/printed_page_unittest.cc b/printing/printed_page_unittest.cc |
index 9cce52a1cb831640511f485b25b1b82f3c76a060..d37d93a60cfac0c559bef6e0e192d35cfc59dd6e 100644 |
--- a/printing/printed_page_unittest.cc |
+++ b/printing/printed_page_unittest.cc |
@@ -12,56 +12,52 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { |
gfx::Rect page_content; |
// No centering. |
- page = new PrintedPage(1, |
- NULL, |
- gfx::Size(1200, 1200), |
- gfx::Rect(0, 0, 400, 1100), |
- 0.2f); |
+ page = new PrintedPage( |
+ 1, NULL, gfx::Size(1200, 1200), gfx::Rect(0, 0, 400, 1100)); |
page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); |
EXPECT_EQ(0, page_content.x()); |
EXPECT_EQ(0, page_content.y()); |
EXPECT_EQ(400, page_content.width()); |
EXPECT_EQ(1100, page_content.height()); |
- EXPECT_EQ(0.2f, page->shrink_factor()); |
// X centered. |
- page = new PrintedPage(1, |
- NULL, |
- gfx::Size(500, 1200), |
- gfx::Rect(0, 0, 400, 1100), |
- 0.8f); |
+ page = new PrintedPage( |
+ 1, NULL, gfx::Size(500, 1200), gfx::Rect(0, 0, 400, 1100)); |
page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); |
EXPECT_EQ(250, page_content.x()); |
EXPECT_EQ(0, page_content.y()); |
EXPECT_EQ(400, page_content.width()); |
EXPECT_EQ(1100, page_content.height()); |
- EXPECT_EQ(0.8f, page->shrink_factor()); |
// Y centered. |
- page = new PrintedPage(1, |
- NULL, |
- gfx::Size(1200, 500), |
- gfx::Rect(0, 0, 400, 1100), |
- 1.0f); |
+ page = new PrintedPage( |
+ 1, NULL, gfx::Size(1200, 500), gfx::Rect(0, 0, 400, 1100)); |
page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); |
EXPECT_EQ(0, page_content.x()); |
EXPECT_EQ(250, page_content.y()); |
EXPECT_EQ(400, page_content.width()); |
EXPECT_EQ(1100, page_content.height()); |
- EXPECT_EQ(1.0f, page->shrink_factor()); |
// Both X and Y centered. |
- page = new PrintedPage(1, |
- NULL, |
- gfx::Size(500, 500), |
- gfx::Rect(0, 0, 400, 1100), |
- 0.3f); |
+ page = |
+ new PrintedPage(1, NULL, gfx::Size(500, 500), gfx::Rect(0, 0, 400, 1100)); |
page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); |
EXPECT_EQ(250, page_content.x()); |
EXPECT_EQ(250, page_content.y()); |
EXPECT_EQ(400, page_content.width()); |
EXPECT_EQ(1100, page_content.height()); |
- EXPECT_EQ(0.3f, page->shrink_factor()); |
} |
+#if defined(OS_WIN) |
+TEST(PrintedPageTest, Shrink) { |
+ scoped_refptr<PrintedPage> page = new PrintedPage( |
+ 1, NULL, gfx::Size(1200, 1200), gfx::Rect(0, 0, 400, 1100)); |
+ EXPECT_EQ(0.0f, page->shrink_factor()); |
+ page->set_shrink_factor(0.2f); |
+ EXPECT_EQ(0.2f, page->shrink_factor()); |
+ page->set_shrink_factor(0.7f); |
+ EXPECT_EQ(0.7f, page->shrink_factor()); |
+} |
+#endif // OS_WIN |
+ |
} // namespace printing |