1bc03f14fSopenharmony_ci/*
2bc03f14fSopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3bc03f14fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4bc03f14fSopenharmony_ci * you may not use this file except in compliance with the License.
5bc03f14fSopenharmony_ci * You may obtain a copy of the License at
6bc03f14fSopenharmony_ci *
7bc03f14fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8bc03f14fSopenharmony_ci *
9bc03f14fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10bc03f14fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11bc03f14fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12bc03f14fSopenharmony_ci * See the License for the specific language governing permissions and
13bc03f14fSopenharmony_ci * limitations under the License.
14bc03f14fSopenharmony_ci */
15bc03f14fSopenharmony_ci
16bc03f14fSopenharmony_ci#include "pasteboard_web_controller.h"
17bc03f14fSopenharmony_ci#include <gtest/gtest.h>
18bc03f14fSopenharmony_ci
19bc03f14fSopenharmony_ciusing namespace testing;
20bc03f14fSopenharmony_ciusing namespace testing::ext;
21bc03f14fSopenharmony_ciusing namespace OHOS::MiscServices;
22bc03f14fSopenharmony_ciclass WebControllerTest : public testing::Test {
23bc03f14fSopenharmony_cipublic:
24bc03f14fSopenharmony_ci    WebControllerTest() {};
25bc03f14fSopenharmony_ci    ~WebControllerTest() {};
26bc03f14fSopenharmony_ci    static void SetUpTestCase(void);
27bc03f14fSopenharmony_ci    static void TearDownTestCase(void);
28bc03f14fSopenharmony_ci    void SetUp();
29bc03f14fSopenharmony_ci    void TearDown();
30bc03f14fSopenharmony_ci};
31bc03f14fSopenharmony_ci
32bc03f14fSopenharmony_civoid WebControllerTest::SetUpTestCase(void)
33bc03f14fSopenharmony_ci{
34bc03f14fSopenharmony_ci}
35bc03f14fSopenharmony_ci
36bc03f14fSopenharmony_civoid WebControllerTest::TearDownTestCase(void)
37bc03f14fSopenharmony_ci{
38bc03f14fSopenharmony_ci}
39bc03f14fSopenharmony_ci
40bc03f14fSopenharmony_civoid WebControllerTest::SetUp(void)
41bc03f14fSopenharmony_ci{
42bc03f14fSopenharmony_ci}
43bc03f14fSopenharmony_ci
44bc03f14fSopenharmony_civoid WebControllerTest::TearDown(void)
45bc03f14fSopenharmony_ci{
46bc03f14fSopenharmony_ci}
47bc03f14fSopenharmony_ci
48bc03f14fSopenharmony_ci/**
49bc03f14fSopenharmony_ci * @tc.name: SplitHtmlTest_001.
50bc03f14fSopenharmony_ci * @tc.desc: Test did not use local image address HTML with SplitHtml.
51bc03f14fSopenharmony_ci * @tc.type: FUNC.
52bc03f14fSopenharmony_ci * @tc.require:
53bc03f14fSopenharmony_ci * @tc.author:
54bc03f14fSopenharmony_ci */
55bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, SplitHtmlTest_001, TestSize.Level1)
56bc03f14fSopenharmony_ci{
57bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
58bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
59bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='http://file1.jpg'><img data-ohos='clipboard' "
60bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
61bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
62bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), 1);
63bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
64bc03f14fSopenharmony_ci    EXPECT_EQ(*(pasteDataRecords[0]->GetHtmlText()), *html);
65bc03f14fSopenharmony_ci}
66bc03f14fSopenharmony_ci
67bc03f14fSopenharmony_ci/**
68bc03f14fSopenharmony_ci * @tc.name: SplitHtmlTest_002.
69bc03f14fSopenharmony_ci * @tc.desc: Test contains a local image address HTML with SplitHtml.
70bc03f14fSopenharmony_ci * @tc.type: FUNC.
71bc03f14fSopenharmony_ci * @tc.require:
72bc03f14fSopenharmony_ci * @tc.author:
73bc03f14fSopenharmony_ci */
74bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, SplitHtmlTest_002, TestSize.Level1)
75bc03f14fSopenharmony_ci{
76bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
77bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
78bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='file:///file1.jpg'><img data-ohos='clipboard' "
79bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
80bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
81bc03f14fSopenharmony_ci    EXPECT_NE(pasteData, nullptr);
82bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
83bc03f14fSopenharmony_ci    EXPECT_FALSE(pasteDataRecords.empty());
84bc03f14fSopenharmony_ci}
85bc03f14fSopenharmony_ci
86bc03f14fSopenharmony_ci/**
87bc03f14fSopenharmony_ci * @tc.name: SplitHtmlTest_003.
88bc03f14fSopenharmony_ci * @tc.desc: Test contains multiple local image addresses HTML with SplitHtml.
89bc03f14fSopenharmony_ci * @tc.type: FUNC.
90bc03f14fSopenharmony_ci * @tc.require:
91bc03f14fSopenharmony_ci * @tc.author:
92bc03f14fSopenharmony_ci */
93bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, SplitHtmlTest_003, TestSize.Level1)
94bc03f14fSopenharmony_ci{
95bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
96bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
97bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='file:///file1.jpg'><img data-ohos='clipboard' "
98bc03f14fSopenharmony_ci                        "src='file2.jpg'><img data-ohos='clipboard' "
99bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
100bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
101bc03f14fSopenharmony_ci    EXPECT_NE(pasteData, nullptr);
102bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
103bc03f14fSopenharmony_ci    EXPECT_FALSE(pasteDataRecords.empty());
104bc03f14fSopenharmony_ci}
105bc03f14fSopenharmony_ci
106bc03f14fSopenharmony_ci/**
107bc03f14fSopenharmony_ci * @tc.name: RebuildHtmlTest_004.
108bc03f14fSopenharmony_ci * @tc.desc: Test does not include local image address HTML with RebuildHtml.
109bc03f14fSopenharmony_ci * @tc.type: FUNC.
110bc03f14fSopenharmony_ci * @tc.require:
111bc03f14fSopenharmony_ci * @tc.author:
112bc03f14fSopenharmony_ci */
113bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, RebuildHtmlTest_004, TestSize.Level1)
114bc03f14fSopenharmony_ci{
115bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
116bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
117bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='http://file1.jpg'><img data-ohos='clipboard' "
118bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
119bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
120bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), 1);
121bc03f14fSopenharmony_ci    std::shared_ptr<std::string> newHtml = webClipboardController.RebuildHtml(pasteData);
122bc03f14fSopenharmony_ci    EXPECT_EQ(*newHtml, *html);
123bc03f14fSopenharmony_ci}
124bc03f14fSopenharmony_ci
125bc03f14fSopenharmony_ci/**
126bc03f14fSopenharmony_ci * @tc.name: RebuildHtmlTest_005.
127bc03f14fSopenharmony_ci * @tc.desc: Test contains a local image address HTML with RebuildHtml.
128bc03f14fSopenharmony_ci * @tc.type: FUNC.
129bc03f14fSopenharmony_ci * @tc.require:
130bc03f14fSopenharmony_ci * @tc.author:
131bc03f14fSopenharmony_ci */
132bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, RebuildHtmlTest_005, TestSize.Level1)
133bc03f14fSopenharmony_ci{
134bc03f14fSopenharmony_ci    const int32_t splitRecordCount = 2;
135bc03f14fSopenharmony_ci    const std::string uri = "file:///data/storage/el2/distributedfiles/temp.png";
136bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
137bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
138bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='file:///file1.jpg'><img data-ohos='clipboard' "
139bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
140bc03f14fSopenharmony_ci    const char* execptHtml =
141bc03f14fSopenharmony_ci        "<img data-ohos='clipboard' src='file:///data/storage/el2/distributedfiles/temp.png'><img "
142bc03f14fSopenharmony_ci        "data-ohos='clipboard' "
143bc03f14fSopenharmony_ci        "src='https://data/storage/el2/distributedfiles/202305301.png'>";
144bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
145bc03f14fSopenharmony_ci    EXPECT_NE(pasteData, nullptr);
146bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), splitRecordCount);
147bc03f14fSopenharmony_ci    std::shared_ptr<PasteData> newPasteData = std::make_shared<PasteData>();
148bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
149bc03f14fSopenharmony_ci    EXPECT_EQ(*(pasteDataRecords[pasteData->GetRecordCount() - 1]->GetHtmlText()), *html);
150bc03f14fSopenharmony_ci
151bc03f14fSopenharmony_ci    newPasteData->AddHtmlRecord(*html);
152bc03f14fSopenharmony_ci    for (auto i = 0; i < pasteData->GetRecordCount() - 1; i++) {
153bc03f14fSopenharmony_ci        PasteDataRecord::Builder builder(MIMETYPE_TEXT_URI);
154bc03f14fSopenharmony_ci        auto newUri = std::make_shared<OHOS::Uri>(uri);
155bc03f14fSopenharmony_ci        builder.SetUri(newUri);
156bc03f14fSopenharmony_ci        builder.SetCustomData(pasteDataRecords[i]->GetCustomData());
157bc03f14fSopenharmony_ci        auto record = builder.Build();
158bc03f14fSopenharmony_ci        newPasteData->AddRecord(record);
159bc03f14fSopenharmony_ci    }
160bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), splitRecordCount);
161bc03f14fSopenharmony_ci    std::shared_ptr<std::string> newHtml = webClipboardController.RebuildHtml(newPasteData);
162bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), 1);
163bc03f14fSopenharmony_ci    const char* newHtmlStr = newHtml.get()->c_str();
164bc03f14fSopenharmony_ci    EXPECT_STREQ(newHtmlStr, execptHtml);
165bc03f14fSopenharmony_ci}
166bc03f14fSopenharmony_ci
167bc03f14fSopenharmony_ci/**
168bc03f14fSopenharmony_ci * @tc.name: RebuildHtmlTest_006.
169bc03f14fSopenharmony_ci * @tc.desc: Test contains a multiple image address HTML with RebuildHtml.
170bc03f14fSopenharmony_ci * @tc.type: FUNC.
171bc03f14fSopenharmony_ci * @tc.require:
172bc03f14fSopenharmony_ci * @tc.author:
173bc03f14fSopenharmony_ci */
174bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, RebuildHtmlTest_006, TestSize.Level1)
175bc03f14fSopenharmony_ci{
176bc03f14fSopenharmony_ci    const int32_t splitRecordCount = 3;
177bc03f14fSopenharmony_ci    const std::string uri = "file:///data/storage/el2/distributedfiles/temp.png";
178bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
179bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
180bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='file:///file1.jpg'><img data-ohos='clipboard' "
181bc03f14fSopenharmony_ci                        "src=\"file2.jpg\"><img data-ohos='clipboard' "
182bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
183bc03f14fSopenharmony_ci    const char* execptHtml =
184bc03f14fSopenharmony_ci        "<img data-ohos='clipboard' src='file:///data/storage/el2/distributedfiles/temp.png'><img "
185bc03f14fSopenharmony_ci        "data-ohos='clipboard' "
186bc03f14fSopenharmony_ci        "src=\"file:///data/storage/el2/distributedfiles/temp.png\"><img data-ohos='clipboard' "
187bc03f14fSopenharmony_ci        "src='https://data/storage/el2/distributedfiles/202305301.png'>";
188bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
189bc03f14fSopenharmony_ci    EXPECT_NE(pasteData, nullptr);
190bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), splitRecordCount);
191bc03f14fSopenharmony_ci    std::shared_ptr<PasteData> newPasteData = std::make_shared<PasteData>();
192bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
193bc03f14fSopenharmony_ci    EXPECT_EQ(*(pasteDataRecords[pasteData->GetRecordCount() - 1]->GetHtmlText()), *html);
194bc03f14fSopenharmony_ci
195bc03f14fSopenharmony_ci    newPasteData->AddHtmlRecord(*html);
196bc03f14fSopenharmony_ci    for (auto i = 0; i < pasteData->GetRecordCount() - 1; i++) {
197bc03f14fSopenharmony_ci        PasteDataRecord::Builder builder(MIMETYPE_TEXT_URI);
198bc03f14fSopenharmony_ci        auto newUri = std::make_shared<OHOS::Uri>(uri);
199bc03f14fSopenharmony_ci        builder.SetUri(newUri);
200bc03f14fSopenharmony_ci        builder.SetCustomData(pasteDataRecords[i]->GetCustomData());
201bc03f14fSopenharmony_ci        auto record = builder.Build();
202bc03f14fSopenharmony_ci        newPasteData->AddRecord(record);
203bc03f14fSopenharmony_ci    }
204bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), splitRecordCount);
205bc03f14fSopenharmony_ci    std::shared_ptr<std::string> newHtml = webClipboardController.RebuildHtml(newPasteData);
206bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), 1);
207bc03f14fSopenharmony_ci    const char* newHtmlStr = newHtml.get()->c_str();
208bc03f14fSopenharmony_ci    EXPECT_STREQ(newHtmlStr, execptHtml);
209bc03f14fSopenharmony_ci}
210bc03f14fSopenharmony_ci
211bc03f14fSopenharmony_ci/**
212bc03f14fSopenharmony_ci * @tc.name: SplitHtmlTest_007.
213bc03f14fSopenharmony_ci * @tc.desc: Test contains invalid protocol image link HTML with SplitHtml.
214bc03f14fSopenharmony_ci * @tc.type: FUNC.
215bc03f14fSopenharmony_ci * @tc.require:
216bc03f14fSopenharmony_ci * @tc.author:
217bc03f14fSopenharmony_ci */
218bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, SplitHtmlTest_007, TestSize.Level1)
219bc03f14fSopenharmony_ci{
220bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
221bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
222bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='xxx://file1.jpg'><img data-ohos='clipboard' "
223bc03f14fSopenharmony_ci                        "src='yyy://data/storage/el2/distributedfiles/202305301.png'>"));
224bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
225bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), 1);
226bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
227bc03f14fSopenharmony_ci    EXPECT_EQ(*(pasteDataRecords[0]->GetHtmlText()), *html);
228bc03f14fSopenharmony_ci}
229bc03f14fSopenharmony_ci
230bc03f14fSopenharmony_ci/**
231bc03f14fSopenharmony_ci * @tc.name: RebuildHtmlTest_008.
232bc03f14fSopenharmony_ci * @tc.desc: Test contains invalid protocol image link HTML with RebuildHtml.
233bc03f14fSopenharmony_ci * @tc.type: FUNC.
234bc03f14fSopenharmony_ci * @tc.require:
235bc03f14fSopenharmony_ci * @tc.author:
236bc03f14fSopenharmony_ci */
237bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, RebuildHtmlTest_008, TestSize.Level1)
238bc03f14fSopenharmony_ci{
239bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
240bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
241bc03f14fSopenharmony_ci        new std::string("<img data-ohos='clipboard' src='xxx://file1.jpg'><img data-ohos='clipboard' "
242bc03f14fSopenharmony_ci                        "src='ttt://data/storage/el2/distributedfiles/202305301.png'>"));
243bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
244bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), 1);
245bc03f14fSopenharmony_ci    std::shared_ptr<std::string> newHtml = webClipboardController.RebuildHtml(pasteData);
246bc03f14fSopenharmony_ci    EXPECT_EQ(*newHtml, *html);
247bc03f14fSopenharmony_ci}
248bc03f14fSopenharmony_ci
249bc03f14fSopenharmony_ci/**
250bc03f14fSopenharmony_ci * @tc.name: RebuildHtmlTest_009.
251bc03f14fSopenharmony_ci * @tc.desc: Test contains a local image address HTML with RebuildHtml.
252bc03f14fSopenharmony_ci * @tc.type: FUNC.
253bc03f14fSopenharmony_ci * @tc.require:
254bc03f14fSopenharmony_ci * @tc.author:
255bc03f14fSopenharmony_ci */
256bc03f14fSopenharmony_ciHWTEST_F(WebControllerTest, RebuildHtmlTest_009, TestSize.Level1)
257bc03f14fSopenharmony_ci{
258bc03f14fSopenharmony_ci    const int32_t splitRecordCount = 3;
259bc03f14fSopenharmony_ci    const std::string uri = "file:///data/storage/el2/distributedfiles/temp.png";
260bc03f14fSopenharmony_ci    auto webClipboardController = PasteboardWebController::GetInstance();
261bc03f14fSopenharmony_ci    std::shared_ptr<std::string> html(
262bc03f14fSopenharmony_ci        new std::string("<img src='file:///file1.jpg'><img src=\"file2.jpg\"><img "
263bc03f14fSopenharmony_ci                        "src='https://data/storage/el2/distributedfiles/202305301.png'>"));
264bc03f14fSopenharmony_ci    const char* execptHtml =
265bc03f14fSopenharmony_ci        "<img src='file:///data/storage/el2/distributedfiles/temp.png'><img "
266bc03f14fSopenharmony_ci        ""
267bc03f14fSopenharmony_ci        "src=\"file:///data/storage/el2/distributedfiles/temp.png\"><img "
268bc03f14fSopenharmony_ci        "src='https://data/storage/el2/distributedfiles/202305301.png'>";
269bc03f14fSopenharmony_ci    auto pasteData = webClipboardController.SplitHtml(html);
270bc03f14fSopenharmony_ci    EXPECT_NE(pasteData, nullptr);
271bc03f14fSopenharmony_ci    EXPECT_EQ(pasteData->GetRecordCount(), splitRecordCount);
272bc03f14fSopenharmony_ci    std::shared_ptr<PasteData> newPasteData = std::make_shared<PasteData>();
273bc03f14fSopenharmony_ci    std::vector<std::shared_ptr<PasteDataRecord>> pasteDataRecords = pasteData->AllRecords();
274bc03f14fSopenharmony_ci    EXPECT_EQ(*(pasteDataRecords[pasteData->GetRecordCount() - 1]->GetHtmlText()), *html);
275bc03f14fSopenharmony_ci
276bc03f14fSopenharmony_ci    newPasteData->AddHtmlRecord(*html);
277bc03f14fSopenharmony_ci    for (auto i = 0; i < pasteData->GetRecordCount() - 1; i++) {
278bc03f14fSopenharmony_ci        PasteDataRecord::Builder builder(MIMETYPE_TEXT_URI);
279bc03f14fSopenharmony_ci        auto newUri = std::make_shared<OHOS::Uri>(uri);
280bc03f14fSopenharmony_ci        builder.SetUri(newUri);
281bc03f14fSopenharmony_ci        builder.SetCustomData(pasteDataRecords[i]->GetCustomData());
282bc03f14fSopenharmony_ci        auto record = builder.Build();
283bc03f14fSopenharmony_ci        newPasteData->AddRecord(record);
284bc03f14fSopenharmony_ci    }
285bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), splitRecordCount);
286bc03f14fSopenharmony_ci    std::shared_ptr<std::string> newHtml = webClipboardController.RebuildHtml(newPasteData);
287bc03f14fSopenharmony_ci    EXPECT_EQ(newPasteData->GetRecordCount(), 1);
288bc03f14fSopenharmony_ci    const char* newHtmlStr = newHtml.get()->c_str();
289bc03f14fSopenharmony_ci    EXPECT_STREQ(newHtmlStr, execptHtml);
290bc03f14fSopenharmony_ci}