summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-19 08:58:54 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-19 13:16:57 +0000
commit3b71d26f092ebc86ca9177fbbe89d83caa67ae1b (patch)
treea81ab092972ab8a2ce474d8d53984bfe9b6887a8 /xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
parent5af27b63bf94e7f60212f6759c8342ce02da5ad2 (diff)
downloadpdfium-3b71d26f092ebc86ca9177fbbe89d83caa67ae1b.tar.xz
Move CFGAS_Stream to CFX_SeekableStreamProxy
This CL moves the FGAS stream code into core/fxcrt and renames to CFX_SeekableStreamProxy. Change-Id: I6641fe0cca45a128ef3ec281b0b40f8d60296387 Reviewed-on: https://pdfium-review.googlesource.com/4311 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp')
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp79
1 files changed, 47 insertions, 32 deletions
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
index aecb3ee39e..45ad3bb2f0 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
@@ -6,10 +6,10 @@
#include <memory>
+#include "core/fxcrt/cfx_seekablestreamproxy.h"
+#include "core/fxcrt/fx_codepage.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/test_support.h"
-#include "xfa/fgas/crt/cfgas_stream.h"
-#include "xfa/fgas/crt/fgas_codepage.h"
class CFDE_XMLSyntaxParserTest : public pdfium::FPDF_Test {};
@@ -28,8 +28,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CData) {
L" app.alert(\"Tclams\");\n"
L" ";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -75,8 +76,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) {
L" </script>\n"
L" ";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -111,8 +113,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangArrow) {
" <!>\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -145,8 +148,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangBracketArrow) {
" <![>\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -174,8 +178,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncompleteCData) {
" <![CDATA>\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -203,8 +208,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, UnClosedCData) {
" <![CDATA[\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -232,8 +238,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EmptyCData) {
" <![CDATA[]]>\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -268,8 +275,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, Comment) {
" <!-- A Comment -->\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -301,8 +309,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncorrectCommentStart) {
" <!- A Comment -->\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -334,8 +343,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentEmpty) {
" <!---->\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -367,8 +377,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentThreeDash) {
" <!--->\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -394,8 +405,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentTwoDash) {
" <!-->\n"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -425,8 +437,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, Entities) {
"&#x0000000000000000000;"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -456,8 +469,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowHex) {
"&#xafffffffffffffffffffffffffffffffff;"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -487,8 +501,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowDecimal) {
"&#29149102052342342134521341234512351234213452315;"
"</script>";
- CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
+ CFX_RetainPtr<CFX_SeekableStreamProxy> stream =
+ pdfium::MakeRetain<CFX_SeekableStreamProxy>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);