diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-01-16 08:55:17 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-01-16 08:55:17 -0800 |
commit | 74b91b279d0dee175c2e461ffa4fcc7fe5002a6e (patch) | |
tree | 7291f9199291a54fe4649627ccb5b7ad44a65b30 /testing/embedder_test.cpp | |
parent | 624b166d4f50874f93c6d0824e91cd5b955c0487 (diff) | |
download | pdfium-74b91b279d0dee175c2e461ffa4fcc7fe5002a6e.tar.xz |
Follow-on to pdfium_embeddertests.
This includes:
- Fix TestLoader lifetime.
- Rename test file to match the equivalent .cpp under test
- Re-organize a few tests to avoid duplicate loading
- add tests for a few additional functions.
R=jam@chromium.org
Review URL: https://codereview.chromium.org/857483005
Diffstat (limited to 'testing/embedder_test.cpp')
-rw-r--r-- | testing/embedder_test.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 7b8498345a..e823347ef1 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -195,6 +195,9 @@ void EmbedderTest::SetUp() { void EmbedderTest::TearDown() { FPDF_CloseDocument(document_); FPDFAvail_Destroy(avail_); + if (loader_) { + delete loader_; + } if (file_contents_) { free(file_contents_); } @@ -206,11 +209,10 @@ bool EmbedderTest::OpenDocument(const std::string& filename) { return false; } - TestLoader loader(file_contents_, file_length_); - + loader_ = new TestLoader(file_contents_, file_length_); file_access_.m_FileLen = static_cast<unsigned long>(file_length_); file_access_.m_GetBlock = Get_Block; - file_access_.m_Param = &loader; + file_access_.m_Param = loader_; file_avail_.version = 1; file_avail_.IsDataAvail = Is_Data_Avail; |