printed_page_win_unittest.cc 704 B

123456789101112131415161718192021
  1. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "printing/printed_page_win.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace printing {
  7. TEST(PrintedPageTest, Shrink) {
  8. scoped_refptr<PrintedPage> page = base::MakeRefCounted<PrintedPage>(
  9. 1, std::unique_ptr<MetafilePlayer>(), gfx::Size(1200, 1200),
  10. gfx::Rect(0, 0, 400, 1100));
  11. EXPECT_EQ(0.0f, page->shrink_factor());
  12. page->set_shrink_factor(0.2f);
  13. EXPECT_EQ(0.2f, page->shrink_factor());
  14. page->set_shrink_factor(0.7f);
  15. EXPECT_EQ(0.7f, page->shrink_factor());
  16. }
  17. } // namespace printing