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
cfxjse_value_embeddertest.cpp
Go to the documentation of this file.
1
// Copyright 2019 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
"fxjs/xfa/cfxjse_value.h"
6
7
#
include
<
memory
>
8
#
include
<
utility
>
9
#
include
<
vector
>
10
11
#
include
"fxjs/xfa/cfxjse_engine.h"
12
#
include
"testing/gtest/include/gtest/gtest.h"
13
#
include
"testing/xfa_js_embedder_test.h"
14
15
class
CFXJSEValueEmbedderTest
:
public
XFAJSEmbedderTest
{};
16
17
TEST_F
(
CFXJSEValueEmbedderTest
,
Empty
) {
18
ASSERT_TRUE(OpenDocument(
"simple_xfa.pdf"
));
19
20
auto
pValue =
std
::make_unique<
CFXJSE_Value
>();
21
EXPECT_TRUE(pValue->IsEmpty());
22
EXPECT_FALSE(pValue->IsUndefined(isolate()));
23
EXPECT_FALSE(pValue->IsNull(isolate()));
24
EXPECT_FALSE(pValue->IsBoolean(isolate()));
25
EXPECT_FALSE(pValue->IsString(isolate()));
26
EXPECT_FALSE(pValue->IsNumber(isolate()));
27
EXPECT_FALSE(pValue->IsObject(isolate()));
28
EXPECT_FALSE(pValue->IsArray(isolate()));
29
EXPECT_FALSE(pValue->IsFunction(isolate()));
30
}
31
32
TEST_F
(
CFXJSEValueEmbedderTest
,
EmptyArrayInsert
) {
33
ASSERT_TRUE(OpenDocument(
"simple_xfa.pdf"
));
34
35
// Test inserting empty values into arrays.
36
auto
pValue =
std
::make_unique<
CFXJSE_Value
>();
37
std::vector<std::unique_ptr<CFXJSE_Value>> vec;
38
vec.push_back(
std
::move(pValue));
39
40
CFXJSE_Value
array;
41
array.SetArray(isolate(), vec);
42
EXPECT_TRUE(array.IsArray(isolate()));
43
}
TEST_F
TEST_F(CFXJSEValueEmbedderTest, Empty)
Definition
cfxjse_value_embeddertest.cpp:17
CFXJSEValueEmbedderTest
Definition
cfxjse_value_embeddertest.cpp:15
CFXJSE_Value
Definition
cfxjse_value.h:24
XFAJSEmbedderTest
Definition
xfa_js_embedder_test.h:19
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
xfa
cfxjse_value_embeddertest.cpp
Generated on
for Qt by
1.18.0