diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-14 18:26:36 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-14 18:26:36 +0000 |
commit | 88798cff29934b58e0a8d81e94005472d612b964 (patch) | |
tree | 3b5a25faa2a627ac30de219b89c8152a9fff2f27 /core/fpdfapi/parser/cpdf_read_validator_unittest.cpp | |
parent | b9c3e2712f75363372622282023143b86b72f2df (diff) | |
download | pdfium-88798cff29934b58e0a8d81e94005472d612b964.tar.xz |
Remove CFX_BufferSeekableReadStream.
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing.
Take some checks from CFX_BufferSeekableReadStream and add them
CFX_ReadOnlyMemoryStream.
Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f
Reviewed-on: https://pdfium-review.googlesource.com/40070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_read_validator_unittest.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_read_validator_unittest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fpdfapi/parser/cpdf_read_validator_unittest.cpp b/core/fpdfapi/parser/cpdf_read_validator_unittest.cpp index ccfb451dd8..640269884d 100644 --- a/core/fpdfapi/parser/cpdf_read_validator_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_read_validator_unittest.cpp @@ -8,6 +8,7 @@ #include <utility> #include <vector> +#include "core/fxcrt/cfx_readonlymemorystream.h" #include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" @@ -65,7 +66,7 @@ class MockDownloadHints : public CPDF_DataAvail::DownloadHints { TEST(CPDF_ReadValidatorTest, UnavailableData) { std::vector<uint8_t> test_data(kTestDataSize); - auto file = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(test_data); + auto file = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(test_data); MockFileAvail file_avail; auto validator = pdfium::MakeRetain<CPDF_ReadValidator>(file, &file_avail); @@ -88,7 +89,7 @@ TEST(CPDF_ReadValidatorTest, UnavailableData) { TEST(CPDF_ReadValidatorTest, UnavailableDataWithHints) { std::vector<uint8_t> test_data(kTestDataSize); - auto file = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(test_data); + auto file = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(test_data); MockFileAvail file_avail; auto validator = pdfium::MakeRetain<CPDF_ReadValidator>(file, &file_avail); @@ -143,7 +144,7 @@ TEST(CPDF_ReadValidatorTest, ReadError) { TEST(CPDF_ReadValidatorTest, IntOverflow) { std::vector<uint8_t> test_data(kTestDataSize); - auto file = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(test_data); + auto file = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(test_data); MockFileAvail file_avail; auto validator = pdfium::MakeRetain<CPDF_ReadValidator>(file, &file_avail); @@ -241,7 +242,7 @@ TEST(CPDF_ReadValidatorTest, SessionReset) { TEST(CPDF_ReadValidatorTest, CheckDataRangeAndRequestIfUnavailable) { std::vector<uint8_t> test_data(kTestDataSize); - auto file = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(test_data); + auto file = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(test_data); MockFileAvail file_avail; auto validator = pdfium::MakeRetain<CPDF_ReadValidator>(file, &file_avail); |