• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "public/cpp/fpdf_scopers.h"
6 #include "testing/embedder_test.h"
7 #include "testing/embedder_test_environment.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 
10 class FXGETextEmbedderTest : public EmbedderTest {
11  public:
TearDown()12   void TearDown() override {
13     EmbedderTest::TearDown();
14 
15     // TODO(tsepez): determine how this is changing the environment,
16     // such that FPDFAnnotEmbedderTest.BUG_1206 will diff if run
17     // after this.
18     EmbedderTestEnvironment::GetInstance()->TearDown();
19     EmbedderTestEnvironment::GetInstance()->SetUp();
20   }
21 };
22 
TEST_F(FXGETextEmbedderTest,BadItalic)23 TEST_F(FXGETextEmbedderTest, BadItalic) {
24   // Shouldn't crash.
25   ASSERT_TRUE(OpenDocument("bug_601362.pdf"));
26   ScopedEmbedderTestPage page = LoadScopedPage(0);
27   ASSERT_TRUE(page);
28   ScopedFPDFBitmap bitmap = RenderLoadedPage(page.get());
29   EXPECT_EQ(612, FPDFBitmap_GetWidth(bitmap.get()));
30   EXPECT_EQ(792, FPDFBitmap_GetHeight(bitmap.get()));
31 }
32