Index: printing/printed_page_unittest.cc |
diff --git a/printing/printed_page_unittest.cc b/printing/printed_page_unittest.cc |
index 1a33d10408fd6226c87392da47755fd3439275bc..9cce52a1cb831640511f485b25b1b82f3c76a060 100644 |
--- a/printing/printed_page_unittest.cc |
+++ b/printing/printed_page_unittest.cc |
@@ -15,45 +15,53 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { |
page = new PrintedPage(1, |
NULL, |
gfx::Size(1200, 1200), |
- gfx::Rect(0, 0, 400, 1100)); |
+ gfx::Rect(0, 0, 400, 1100), |
+ 0.2f); |
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)); |
+ gfx::Rect(0, 0, 400, 1100), |
+ 0.8f); |
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)); |
+ gfx::Rect(0, 0, 400, 1100), |
+ 1.0f); |
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)); |
+ gfx::Rect(0, 0, 400, 1100), |
+ 0.3f); |
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()); |
} |
} // namespace printing |