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
cxfa_textparser_unittest.cpp
Go to the documentation of this file.
1
// Copyright 2016 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
"xfa/fxfa/cxfa_textparser.h"
6
7
#
include
"fxjs/gc/heap.h"
8
#
include
"testing/fxgc_unittest.h"
9
#
include
"testing/gtest/include/gtest/gtest.h"
10
#
include
"v8/include/cppgc/heap.h"
11
12
class
CXFA_TestTextParser
final
:
public
CXFA_TextParser
{
13
public
:
14
CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
;
15
16
private
:
17
CXFA_TestTextParser() =
default
;
18
19
// Add test cases as friends to access protected member functions.
20
FRIEND_TEST(CXFATextParserTest, TagValidate);
21
};
22
23
class
CXFATextParserTest
:
public
FXGCUnitTest
{};
24
25
TEST_F
(
CXFATextParserTest
,
TagValidate
) {
26
auto
* parser = cppgc::MakeGarbageCollected<CXFA_TestTextParser>(
27
heap()->GetAllocationHandle());
28
EXPECT_TRUE(parser->TagValidate(L"br"));
29
EXPECT_TRUE(parser->TagValidate(L"Br"));
30
EXPECT_TRUE(parser->TagValidate(L"BR"));
31
EXPECT_TRUE(parser->TagValidate(L"a"));
32
EXPECT_TRUE(parser->TagValidate(L"b"));
33
EXPECT_TRUE(parser->TagValidate(L"i"));
34
EXPECT_TRUE(parser->TagValidate(L"p"));
35
EXPECT_TRUE(parser->TagValidate(L"li"));
36
EXPECT_TRUE(parser->TagValidate(L"ol"));
37
EXPECT_TRUE(parser->TagValidate(L"ul"));
38
EXPECT_TRUE(parser->TagValidate(L"sub"));
39
EXPECT_TRUE(parser->TagValidate(L"sup"));
40
EXPECT_TRUE(parser->TagValidate(L"span"));
41
EXPECT_TRUE(parser->TagValidate(L"body"));
42
EXPECT_TRUE(parser->TagValidate(L"html"));
43
44
EXPECT_FALSE(parser->TagValidate(L""));
45
EXPECT_FALSE(parser->TagValidate(L"tml"));
46
EXPECT_FALSE(parser->TagValidate(L"xhtml"));
47
EXPECT_FALSE(parser->TagValidate(L"htmlx"));
48
}
CXFATextParserTest
Definition
cxfa_textparser_unittest.cpp:23
CXFA_TextParser
Definition
cxfa_textparser.h:35
FXGCUnitTest
Definition
fxgc_unittest.h:11
TEST_F
TEST_F(CXFATextParserTest, TagValidate)
Definition
cxfa_textparser_unittest.cpp:25
CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
Definition
heap.h:32
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fxfa
cxfa_textparser_unittest.cpp
Generated on
for Qt by
1.18.0