• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 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 "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
6 
7 #include "fpdfsdk/cpdfsdk_helpers.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/xfa_js_embedder_test.h"
10 
11 class CPDFXFAContextEmbedderTest : public XFAJSEmbedderTest {};
12 
13 // Should not crash.
TEST_F(CPDFXFAContextEmbedderTest,HasHeap)14 TEST_F(CPDFXFAContextEmbedderTest, HasHeap) {
15   ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
16 
17   CPDF_Document* pDocument = CPDFDocumentFromFPDFDocument(document());
18   auto* pContext = static_cast<CPDFXFA_Context*>(pDocument->GetExtension());
19   EXPECT_TRUE(pContext->GetGCHeap());
20 }
21