summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-18 16:35:55 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 20:50:08 +0000
commitbf510b7c520bccbd2edf5bb3e2f91b125ebfd6d7 (patch)
tree6ffafd1e5fcc767f5a4160d290e0b5f72d2ce271 /xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
parentfdf7d4092a5fa9c79bbb4a626a4d3d087053ae2c (diff)
downloadpdfium-bf510b7c520bccbd2edf5bb3e2f91b125ebfd6d7.tar.xz
Rename IFGAS_Stream to CFGAS_Stream
This CL replaces IFGAS_Stream with the only implementation CFGAS_Stream. The CreateReadStream and CreateWriteStream methods are removed in favour of calling MakeRetain directly. Change-Id: I882a89258f642e24fc3d631587db05652bd53ded Reviewed-on: https://pdfium-review.googlesource.com/4210 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp')
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp77
1 files changed, 31 insertions, 46 deletions
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
index a45bb1276a..aecb3ee39e 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
@@ -8,8 +8,8 @@
#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"
-#include "xfa/fgas/crt/ifgas_stream.h"
class CFDE_XMLSyntaxParserTest : public pdfium::FPDF_Test {};
@@ -28,9 +28,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, CData) {
L" app.alert(\"Tclams\");\n"
L" ";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -76,9 +75,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) {
L" </script>\n"
L" ";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -113,9 +111,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangArrow) {
" <!>\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -148,9 +145,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangBracketArrow) {
" <![>\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -178,9 +174,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncompleteCData) {
" <![CDATA>\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -208,9 +203,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, UnClosedCData) {
" <![CDATA[\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -238,9 +232,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, EmptyCData) {
" <![CDATA[]]>\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -275,9 +268,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, Comment) {
" <!-- A Comment -->\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -309,9 +301,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncorrectCommentStart) {
" <!- A Comment -->\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -343,9 +334,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentEmpty) {
" <!---->\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -377,9 +367,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentThreeDash) {
" <!--->\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -405,9 +394,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentTwoDash) {
" <!-->\n"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -437,9 +425,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, Entities) {
"&#x0000000000000000000;"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -469,9 +456,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowHex) {
"&#xafffffffffffffffffffffffffffffffff;"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);
@@ -501,9 +487,8 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowDecimal) {
"&#29149102052342342134521341234512351234213452315;"
"</script>";
- CFX_RetainPtr<IFGAS_Stream> stream =
- IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create(
- reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)));
+ CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>(
+ reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input));
stream->SetCodePage(FX_CODEPAGE_UTF8);
CFDE_XMLSyntaxParser parser(stream);