Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfx_xmltext_unittest.cpp
Go to the documentation of this file.
1
// Copyright 2018 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
"core/fxcrt/xml/cfx_xmltext.h"
6
#
include
"core/fxcrt/xml/cfx_xmldocument.h"
7
#
include
"testing/gtest/include/gtest/gtest.h"
8
#
include
"testing/string_write_stream.h"
9
10
TEST
(
CFX_XMLTextTest
,
GetType
) {
11
CFX_XMLText
text
(
L"My Text"
)
;
12
EXPECT_EQ(
CFX_XMLNode
::
Type
::
kText
, text
.
GetType
(
)
);
13
}
14
15
TEST
(
CFX_XMLTextTest
,
GetText
) {
16
CFX_XMLText
data
(
L"My Data"
)
;
17
EXPECT_EQ(L"My Data", data
.
GetText
(
)
);
18
}
19
20
TEST
(
CFX_XMLTextTest
,
Clone
) {
21
CFX_XMLDocument
doc;
22
23
CFX_XMLText
data
(
L"My Data"
)
;
24
CFX_XMLNode
* clone = data
.
Clone
(
&doc
)
;
25
EXPECT_TRUE(clone !=
nullptr
);
26
ASSERT_EQ(
CFX_XMLNode
::
Type
::
kText
, clone
->
GetType
(
)
);
27
EXPECT_EQ(L"My Data",
ToXMLText
(
clone
)
->
GetText
(
)
);
28
}
29
30
TEST
(
CFX_XMLTextTest
,
Save
) {
31
auto
stream =
pdfium
::MakeRetain<StringWriteStream>();
32
CFX_XMLText
data
(
L"My Data & this is < and > and ' and \" stuff."
)
;
33
data
.
Save
(
stream
)
;
34
EXPECT_EQ(
"My Data & this is < and > and ' and " stuff."
,
35
stream->ToString());
36
}
37
38
TEST
(
CFX_XMLTextTest
,
SetText
) {
39
CFX_XMLText
data
(
L"My Data"
)
;
40
EXPECT_EQ(L"My Data", data
.
GetText
(
)
);
41
data
.
SetText
(
L"New Text"
)
;
42
EXPECT_EQ(L"New Text", data
.
GetText
(
)
);
43
}
ToXMLText
CFX_XMLText * ToXMLText(CFX_XMLNode *pNode)
Definition
cfx_xmltext.h:38
CFX_XMLDocument
Definition
cfx_xmldocument.h:17
CFX_XMLNode
Definition
cfx_xmlnode.h:16
CFX_XMLNode::GetType
virtual Type GetType() const =0
CFX_XMLNode::Type
Type
Definition
cfx_xmlnode.h:18
CFX_XMLNode::Type::kText
@ kText
Definition
cfx_xmlnode.h:21
CFX_XMLText
Definition
cfx_xmltext.h:15
CFX_XMLText::SetText
void SetText(const WideString &wsText)
Definition
cfx_xmltext.h:26
CFX_XMLText::GetText
const WideString & GetText() const
Definition
cfx_xmltext.h:25
CFX_XMLText::CFX_XMLText
CFX_XMLText(const WideString &wsText)
Definition
cfx_xmltext.cpp:11
CFX_XMLText::Save
void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream) override
Definition
cfx_xmltext.cpp:23
CFX_XMLText::GetType
Type GetType() const override
Definition
cfx_xmltext.cpp:15
CFX_XMLText::Clone
CFX_XMLNode * Clone(CFX_XMLDocument *doc) override
Definition
cfx_xmltext.cpp:19
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
TEST
TEST(FXCRYPT, MD5GenerateEmtpyData)
Definition
fx_crypt_unittest.cpp:50
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcrt
xml
cfx_xmltext_unittest.cpp
Generated on
for Qt by
1.18.0