1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <list>
17 #include <unordered_map>
18 #include <vector>
19
20 #include "gtest/gtest.h"
21
22 #define protected public
23 #define private public
24
25 #include "base/geometry/dimension.h"
26 #include "base/geometry/dimension_rect.h"
27 #include "base/geometry/ng/offset_t.h"
28 #include "base/json/json_util.h"
29 #include "base/log/dump_log.h"
30 #include "base/memory/referenced.h"
31 #include "base/utils/system_properties.h"
32 #include "core/common/ace_application_info.h"
33 #include "core/common/resource/resource_configuration.h"
34 #include "core/components/common/layout/screen_system_manager.h"
35 #include "core/components_ng/animation/geometry_transition.h"
36 #include "core/components_ng/base/frame_node.h"
37 #include "core/components_ng/base/frame_scene_status.h"
38 #include "core/components_ng/base/modifier.h"
39 #include "core/components_ng/event/focus_hub.h"
40 #include "core/components_ng/layout/layout_wrapper.h"
41 #include "core/components_ng/pattern/linear_layout/linear_layout_pattern.h"
42 #include "core/components_ng/pattern/pattern.h"
43 #include "core/components_ng/pattern/stack/stack_pattern.h"
44 #include "core/components_ng/syntax/if_else_model_ng.h"
45 #include "test/mock/core/render/mock_render_context.h"
46 #include "core/components_v2/inspector/inspector_constants.h"
47 #include "core/event/mouse_event.h"
48 #include "core/pipeline_ng/pipeline_context.h"
49 #include "test/mock/core/pipeline/mock_pipeline_context.h"
50
51 using namespace testing;
52 using namespace testing::ext;
53
54 namespace OHOS::Ace::NG {
55 namespace {
56 const InspectorFilter filter;
57 const std::string NODE_TAG_ONE("111");
58 const std::string NODE_TAG_A("aaa");
59 const std::string NODE_TAG_SPOT("...");
60 const std::string NODE_TAG_EMPTY("");
61 } // namespace
62 class FrameNodeDropTestNg : public testing::Test {
63 public:
64 static void SetUpTestSuite();
65 static void TearDownTestSuite();
66 };
67
SetUpTestSuite()68 void FrameNodeDropTestNg::SetUpTestSuite()
69 {
70 MockPipelineContext::SetUp();
71 }
72
TearDownTestSuite()73 void FrameNodeDropTestNg::TearDownTestSuite()
74 {
75 MockPipelineContext::TearDown();
76 }
77
78 class TestNode : public UINode {
79 DECLARE_ACE_TYPE(TestNode, UINode);
80
81 public:
CreateTestNode(int32_t nodeId)82 static RefPtr<TestNode> CreateTestNode(int32_t nodeId)
83 {
84 auto node = MakeRefPtr<TestNode>(nodeId);
85 return node;
86 }
87
IsAtomicNode() const88 bool IsAtomicNode() const override
89 {
90 return true;
91 }
92
TestNode(int32_t nodeId)93 explicit TestNode(int32_t nodeId) : UINode("TestNode", nodeId) {}
94 ~TestNode() override = default;
95 };
96
97 /**
98 * @tc.name: FrameNodeDropTestNg001
99 * @tc.desc: Test frame node method
100 * @tc.type: FUNC
101 */
102 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg001, TestSize.Level1)
103 {
104 /**
105 * @tc.steps: step1. construct a frameNode.
106 * @tc.expected: frameNode is not null.
107 */
108 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
109 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_EMPTY, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
110 ASSERT_NE(frameNode, nullptr);
111
112 /**
113 * @tc.steps: step2. construct a allowDropSet.
114 * @tc.expected: allowDropSet is not null.
115 */
116 std::set<std::string> allowDropSet = { NODE_TAG_EMPTY };
117
118 /**
119 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
120 * @tc.expected: The set allowDrop is the same as the get allowDrop.
121 */
122 frameNode->SetAllowDrop(allowDropSet);
123 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
124 EXPECT_EQ(allowDropGet, allowDropSet);
125
126 /**
127 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
128 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
129 */
130 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
131 ASSERT_FALSE(isDisallowDropForcedly);
132 }
133
134 /**
135 * @tc.name: FrameNodeDropTestNg002
136 * @tc.desc: Test frame node method
137 * @tc.type: FUNC
138 */
139 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg002, TestSize.Level1)
140 {
141 /**
142 * @tc.steps: step1. construct a frameNode.
143 * @tc.expected: frameNode is not null.
144 */
145 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
146 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_ONE, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
147 ASSERT_NE(frameNode, nullptr);
148
149 /**
150 * @tc.steps: step2. construct a allowDropSet.
151 * @tc.expected: allowDropSet is not null.
152 */
153 std::set<std::string> allowDropSet = { NODE_TAG_ONE };
154
155 /**
156 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
157 * @tc.expected: The set allowDrop is the same as the get allowDrop.
158 */
159 frameNode->SetAllowDrop(allowDropSet);
160 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
161 EXPECT_EQ(allowDropGet, allowDropSet);
162
163 /**
164 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
165 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
166 */
167 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
168 ASSERT_FALSE(isDisallowDropForcedly);
169 }
170
171 /**
172 * @tc.name: FrameNodeDropTestNg003
173 * @tc.desc: Test frame node method
174 * @tc.type: FUNC
175 */
176 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg003, TestSize.Level1)
177 {
178 /**
179 * @tc.steps: step1. construct a frameNode.
180 * @tc.expected: frameNode is not null.
181 */
182 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
183 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_SPOT, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
184 ASSERT_NE(frameNode, nullptr);
185
186 /**
187 * @tc.steps: step2. construct a allowDropSet.
188 * @tc.expected: allowDropSet is not null.
189 */
190 std::set<std::string> allowDropSet = { NODE_TAG_SPOT };
191
192 /**
193 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
194 * @tc.expected: The set allowDrop is the same as the get allowDrop.
195 */
196 frameNode->SetAllowDrop(allowDropSet);
197 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
198 EXPECT_EQ(allowDropGet, allowDropSet);
199
200 /**
201 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
202 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
203 */
204 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
205 ASSERT_FALSE(isDisallowDropForcedly);
206 }
207
208 /**
209 * @tc.name: FrameNodeDropTestNg004
210 * @tc.desc: Test frame node method
211 * @tc.type: FUNC
212 */
213 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg004, TestSize.Level1)
214 {
215 /**
216 * @tc.steps: step1. construct a frameNode.
217 * @tc.expected: frameNode is not null.
218 */
219 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
220 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_A, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
221 ASSERT_NE(frameNode, nullptr);
222
223 /**
224 * @tc.steps: step2. construct a allowDropSet.
225 * @tc.expected: allowDropSet is not null.
226 */
227 std::set<std::string> allowDropSet = { NODE_TAG_A };
228
229 /**
230 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
231 * @tc.expected: The set allowDrop is the same as the get allowDrop.
232 */
233 frameNode->SetAllowDrop(allowDropSet);
234 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
235 EXPECT_EQ(allowDropGet, allowDropSet);
236
237 /**
238 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
239 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
240 */
241 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
242 ASSERT_FALSE(isDisallowDropForcedly);
243 }
244
245 /**
246 * @tc.name: FrameNodeDropTestNg005
247 * @tc.desc: Test frame node method
248 * @tc.type: FUNC
249 */
250 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg005, TestSize.Level1)
251 {
252 /**
253 * @tc.steps: step1. construct a frameNode.
254 * @tc.expected: frameNode is not null.
255 */
256 auto frameNode = FrameNode::CreateFrameNode("main", 1, AceType::MakeRefPtr<Pattern>(), true);
257 ASSERT_NE(frameNode, nullptr);
258
259 /**
260 * @tc.steps: step2. construct a allowDropSet.
261 * @tc.expected: allowDropSet is not null.
262 */
263 std::set<std::string> allowDropSet;
264
265 /**
266 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
267 * @tc.expected: The set allowDrop is the same as the get allowDrop.
268 */
269 frameNode->SetAllowDrop(allowDropSet);
270 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
271 EXPECT_EQ(allowDropGet, allowDropSet);
272
273 /**
274 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
275 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
276 */
277 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
278 ASSERT_FALSE(isDisallowDropForcedly);
279 }
280
281 /**
282 * @tc.name: FrameNodeDropTestNg006
283 * @tc.desc: Test frame node method
284 * @tc.type: FUNC
285 */
286 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg006, TestSize.Level1)
287 {
288 /**
289 * @tc.steps: step1. construct a frameNode.
290 * @tc.expected: frameNode is not null.
291 */
292 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
293 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_EMPTY, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
294 ASSERT_NE(frameNode, nullptr);
295
296 /**
297 * @tc.steps: step2. construct a allowDropSet.
298 * @tc.expected: allowDropSet is not null.
299 */
300 std::set<std::string> allowDropSet = { NODE_TAG_EMPTY };
301
302 /**
303 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
304 * @tc.expected: The set allowDrop is the same as the get allowDrop.
305 */
306 frameNode->SetAllowDrop(allowDropSet);
307 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
308 EXPECT_EQ(allowDropGet, allowDropSet);
309
310 /**
311 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
312 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
313 */
314 bool isDisallowDrop = true;
315 ASSERT_TRUE(isDisallowDrop);
316 frameNode->SetDisallowDropForcedly(isDisallowDrop);
317 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
318 ASSERT_TRUE(isDisallowDropForcedly);
319 }
320
321 /**
322 * @tc.name: FrameNodeDropTestNg007
323 * @tc.desc: Test frame node method
324 * @tc.type: FUNC
325 */
326 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg007, TestSize.Level1)
327 {
328 /**
329 * @tc.steps: step1. construct a frameNode.
330 * @tc.expected: frameNode is not null.
331 */
332 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
333 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_ONE, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
334 ASSERT_NE(frameNode, nullptr);
335
336 /**
337 * @tc.steps: step2. construct a allowDropSet.
338 * @tc.expected: allowDropSet is not null.
339 */
340 std::set<std::string> allowDropSet = { NODE_TAG_ONE };
341
342 /**
343 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
344 * @tc.expected: The set allowDrop is the same as the get allowDrop.
345 */
346 frameNode->SetAllowDrop(allowDropSet);
347 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
348 EXPECT_EQ(allowDropGet, allowDropSet);
349
350 /**
351 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
352 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
353 */
354 bool isDisallowDrop = true;
355 ASSERT_TRUE(isDisallowDrop);
356 frameNode->SetDisallowDropForcedly(isDisallowDrop);
357 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
358 ASSERT_TRUE(isDisallowDropForcedly);
359 }
360
361 /**
362 * @tc.name: FrameNodeDropTestNg008
363 * @tc.desc: Test frame node method
364 * @tc.type: FUNC
365 */
366 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg008, TestSize.Level1)
367 {
368 /**
369 * @tc.steps: step1. construct a frameNode.
370 * @tc.expected: frameNode is not null.
371 */
372 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
373 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_SPOT, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
374 ASSERT_NE(frameNode, nullptr);
375
376 /**
377 * @tc.steps: step2. construct a allowDropSet.
378 * @tc.expected: allowDropSet is not null.
379 */
380 std::set<std::string> allowDropSet = { NODE_TAG_SPOT };
381
382 /**
383 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
384 * @tc.expected: The set allowDrop is the same as the get allowDrop.
385 */
386 frameNode->SetAllowDrop(allowDropSet);
387 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
388 EXPECT_EQ(allowDropGet, allowDropSet);
389
390 /**
391 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
392 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
393 */
394 bool isDisallowDrop = true;
395 ASSERT_TRUE(isDisallowDrop);
396 frameNode->SetDisallowDropForcedly(isDisallowDrop);
397 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
398 ASSERT_TRUE(isDisallowDropForcedly);
399 }
400
401 /**
402 * @tc.name: FrameNodeDropTestNg009
403 * @tc.desc: Test frame node method
404 * @tc.type: FUNC
405 */
406 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg009, TestSize.Level1)
407 {
408 /**
409 * @tc.steps: step1. construct a frameNode.
410 * @tc.expected: frameNode is not null.
411 */
412 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
413 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_A, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
414 ASSERT_NE(frameNode, nullptr);
415
416 /**
417 * @tc.steps: step2. construct a allowDropSet.
418 * @tc.expected: allowDropSet is not null.
419 */
420 std::set<std::string> allowDropSet = { NODE_TAG_A };
421
422 /**
423 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
424 * @tc.expected: The set allowDrop is the same as the get allowDrop.
425 */
426 frameNode->SetAllowDrop(allowDropSet);
427 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
428 EXPECT_EQ(allowDropGet, allowDropSet);
429
430 /**
431 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
432 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
433 */
434 bool isDisallowDrop = true;
435 ASSERT_TRUE(isDisallowDrop);
436 frameNode->SetDisallowDropForcedly(isDisallowDrop);
437 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
438 ASSERT_TRUE(isDisallowDropForcedly);
439 }
440
441 /**
442 * @tc.name: FrameNodeDropTestNg010
443 * @tc.desc: Test frame node method
444 * @tc.type: FUNC
445 */
446 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg010, TestSize.Level1)
447 {
448 /**
449 * @tc.steps: step1. construct a frameNode.
450 * @tc.expected: frameNode is not null.
451 */
452 auto frameNode = FrameNode::CreateFrameNode("main", 1, AceType::MakeRefPtr<Pattern>(), true);
453 ASSERT_NE(frameNode, nullptr);
454
455 /**
456 * @tc.steps: step2. construct a allowDropSet.
457 * @tc.expected: allowDropSet is not null.
458 */
459 std::set<std::string> allowDropSet;
460
461 /**
462 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
463 * @tc.expected: The set allowDrop is the same as the get allowDrop.
464 */
465 frameNode->SetAllowDrop(allowDropSet);
466 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
467 EXPECT_EQ(allowDropGet, allowDropSet);
468
469 /**
470 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
471 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
472 */
473 bool isDisallowDrop = true;
474 ASSERT_TRUE(isDisallowDrop);
475 frameNode->SetDisallowDropForcedly(isDisallowDrop);
476 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
477 ASSERT_TRUE(isDisallowDropForcedly);
478 }
479
480 /**
481 * @tc.name: FrameNodeDropTestNg011
482 * @tc.desc: Test frame node method
483 * @tc.type: FUNC
484 */
485 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg011, TestSize.Level1)
486 {
487 /**
488 * @tc.steps: step1. construct a frameNode.
489 * @tc.expected: frameNode is not null.
490 */
491 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
492 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_EMPTY, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
493 ASSERT_NE(frameNode, nullptr);
494
495 /**
496 * @tc.steps: step2. construct a allowDropSet.
497 * @tc.expected: allowDropSet is not null.
498 */
499 std::set<std::string> allowDropSet = { NODE_TAG_EMPTY };
500
501 /**
502 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
503 * @tc.expected: The set allowDrop is the same as the get allowDrop.
504 */
505 frameNode->SetAllowDrop(allowDropSet);
506 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
507 EXPECT_EQ(allowDropGet, allowDropSet);
508
509 /**
510 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
511 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
512 */
513 bool isDisallowDrop = false;
514 ASSERT_FALSE(isDisallowDrop);
515 frameNode->SetDisallowDropForcedly(isDisallowDrop);
516 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
517 ASSERT_FALSE(isDisallowDropForcedly);
518 }
519
520 /**
521 * @tc.name: FrameNodeDropTestNg012
522 * @tc.desc: Test frame node method
523 * @tc.type: FUNC
524 */
525 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg012, TestSize.Level1)
526 {
527 /**
528 * @tc.steps: step1. construct a frameNode.
529 * @tc.expected: frameNode is not null.
530 */
531 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
532 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_ONE, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
533 ASSERT_NE(frameNode, nullptr);
534
535 /**
536 * @tc.steps: step2. construct a allowDropSet.
537 * @tc.expected: allowDropSet is not null.
538 */
539 std::set<std::string> allowDropSet = { NODE_TAG_ONE };
540
541 /**
542 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
543 * @tc.expected: The set allowDrop is the same as the get allowDrop.
544 */
545 frameNode->SetAllowDrop(allowDropSet);
546 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
547 EXPECT_EQ(allowDropGet, allowDropSet);
548
549 /**
550 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
551 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
552 */
553 bool isDisallowDrop = false;
554 ASSERT_FALSE(isDisallowDrop);
555 frameNode->SetDisallowDropForcedly(isDisallowDrop);
556 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
557 ASSERT_FALSE(isDisallowDropForcedly);
558 }
559
560 /**
561 * @tc.name: FrameNodeDropTestNg013
562 * @tc.desc: Test frame node method
563 * @tc.type: FUNC
564 */
565 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg013, TestSize.Level1)
566 {
567 /**
568 * @tc.steps: step1. construct a frameNode.
569 * @tc.expected: frameNode is not null.
570 */
571 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
572 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_SPOT, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
573 ASSERT_NE(frameNode, nullptr);
574
575 /**
576 * @tc.steps: step2. construct a allowDropSet.
577 * @tc.expected: allowDropSet is not null.
578 */
579 std::set<std::string> allowDropSet = { NODE_TAG_SPOT };
580
581 /**
582 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
583 * @tc.expected: The set allowDrop is the same as the get allowDrop.
584 */
585 frameNode->SetAllowDrop(allowDropSet);
586 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
587 EXPECT_EQ(allowDropGet, allowDropSet);
588
589 /**
590 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
591 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
592 */
593 bool isDisallowDrop = false;
594 ASSERT_FALSE(isDisallowDrop);
595 frameNode->SetDisallowDropForcedly(isDisallowDrop);
596 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
597 ASSERT_FALSE(isDisallowDropForcedly);
598 }
599
600 /**
601 * @tc.name: FrameNodeDropTestNg014
602 * @tc.desc: Test frame node method
603 * @tc.type: FUNC
604 */
605 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg014, TestSize.Level1)
606 {
607 /**
608 * @tc.steps: step1. construct a frameNode.
609 * @tc.expected: frameNode is not null.
610 */
611 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
612 auto frameNode = AceType::MakeRefPtr<FrameNode>(NODE_TAG_A, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
613 ASSERT_NE(frameNode, nullptr);
614
615 /**
616 * @tc.steps: step2. construct a allowDropSet.
617 * @tc.expected: allowDropSet is not null.
618 */
619 std::set<std::string> allowDropSet = { NODE_TAG_A };
620
621 /**
622 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
623 * @tc.expected: The set allowDrop is the same as the get allowDrop.
624 */
625 frameNode->SetAllowDrop(allowDropSet);
626 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
627 EXPECT_EQ(allowDropGet, allowDropSet);
628
629 /**
630 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
631 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
632 */
633 bool isDisallowDrop = false;
634 ASSERT_FALSE(isDisallowDrop);
635 frameNode->SetDisallowDropForcedly(isDisallowDrop);
636 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
637 ASSERT_FALSE(isDisallowDropForcedly);
638 }
639
640 /**
641 * @tc.name: FrameNodeDropTestNg015
642 * @tc.desc: Test frame node method
643 * @tc.type: FUNC
644 */
645 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg015, TestSize.Level1)
646 {
647 /**
648 * @tc.steps: step1. construct a frameNode.
649 * @tc.expected: frameNode is not null.
650 */
651 auto frameNode = FrameNode::CreateFrameNode("main", 1, AceType::MakeRefPtr<Pattern>(), true);
652 ASSERT_NE(frameNode, nullptr);
653
654 /**
655 * @tc.steps: step2. construct a allowDropSet.
656 * @tc.expected: allowDropSet is not null.
657 */
658 std::set<std::string> allowDropSet;
659
660 /**
661 * @tc.steps: step3. Set an allowDrop in the frameNode and then get an allowDrop.
662 * @tc.expected: The set allowDrop is the same as the get allowDrop.
663 */
664 frameNode->SetAllowDrop(allowDropSet);
665 std::set<std::string> allowDropGet = frameNode->GetAllowDrop();
666 EXPECT_EQ(allowDropGet, allowDropSet);
667
668 /**
669 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
670 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
671 */
672 bool isDisallowDrop = false;
673 ASSERT_FALSE(isDisallowDrop);
674 frameNode->SetDisallowDropForcedly(isDisallowDrop);
675 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
676 ASSERT_FALSE(isDisallowDropForcedly);
677 }
678
679 /**
680 * @tc.name: FrameNodeDropTestNg016
681 * @tc.desc: Test frame node method
682 * @tc.type: FUNC
683 */
684 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg016, TestSize.Level1)
685 {
686 /**
687 * @tc.steps: step1. construct a DragDropManager.
688 * @tc.expected: dragDropManager is not null.
689 */
690 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
691 ASSERT_NE(dragDropManager, nullptr);
692
693 /**
694 * @tc.steps: step2. construct frameNode and update the properties.
695 * @tc.expected: frameNode is not null.
696 */
697 const std::string allowTag(NODE_TAG_SPOT);
698 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
699 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
700 ASSERT_NE(frameNode, nullptr);
701 std::set<std::string> allowDrop = { allowTag };
702 frameNode->SetAllowDrop(allowDrop);
703 ASSERT_NE(frameNode, nullptr);
704
705 /**
706 * @tc.steps: step3. construct summaryMap for dragDropManager.
707 * @tc.expected: dragDropManager is not null.
708 */
709 const std::string summary_TAG(NODE_TAG_SPOT);
710 dragDropManager->summaryMap_.clear();
711 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
712 ASSERT_NE(dragDropManager, nullptr);
713
714 /**
715 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
716 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
717 */
718 bool isDisallowDrop = false;
719 ASSERT_FALSE(isDisallowDrop);
720 frameNode->SetDisallowDropForcedly(isDisallowDrop);
721 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
722 ASSERT_FALSE(isDisallowDropForcedly);
723
724 /**
725 * @tc.steps: step5. ReportingSupported is set to false.
726 * @tc.expected: reportingEnabledFalse is false.
727 */
728 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
729 }
730
731 /**
732 * @tc.name: FrameNodeDropTestNg017
733 * @tc.desc: Test frame node method
734 * @tc.type: FUNC
735 */
736 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg017, TestSize.Level1)
737 {
738 /**
739 * @tc.steps: step1. construct a DragDropManager.
740 * @tc.expected: dragDropManager is not null.
741 */
742 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
743 ASSERT_NE(dragDropManager, nullptr);
744
745 /**
746 * @tc.steps: step2. construct frameNode and update the properties.
747 * @tc.expected: frameNode is not null.
748 */
749 const std::string allowTag(NODE_TAG_SPOT);
750 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
751 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
752 ASSERT_NE(frameNode, nullptr);
753 std::set<std::string> allowDrop = { allowTag };
754 frameNode->SetAllowDrop(allowDrop);
755 ASSERT_NE(frameNode, nullptr);
756
757 /**
758 * @tc.steps: step3. construct summaryMap for dragDropManager.
759 * @tc.expected: dragDropManager is not null.
760 */
761 const std::string summary_TAG(NODE_TAG_ONE);
762 dragDropManager->summaryMap_.clear();
763 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
764 ASSERT_NE(dragDropManager, nullptr);
765
766 /**
767 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
768 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
769 */
770 bool isDisallowDrop = false;
771 ASSERT_FALSE(isDisallowDrop);
772 frameNode->SetDisallowDropForcedly(isDisallowDrop);
773 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
774 ASSERT_FALSE(isDisallowDropForcedly);
775
776 /**
777 * @tc.steps: step5. ReportingSupported is set to false.
778 * @tc.expected: reportingEnabledFalse is false.
779 */
780 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
781 }
782
783 /**
784 * @tc.name: FrameNodeDropTestNg018
785 * @tc.desc: Test frame node method
786 * @tc.type: FUNC
787 */
788 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg018, TestSize.Level1)
789 {
790 /**
791 * @tc.steps: step1. construct a DragDropManager.
792 * @tc.expected: dragDropManager is not null.
793 */
794 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
795 ASSERT_NE(dragDropManager, nullptr);
796
797 /**
798 * @tc.steps: step2. construct frameNode and update the properties.
799 * @tc.expected: frameNode is not null.
800 */
801 const std::string allowTag(NODE_TAG_SPOT);
802 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
803 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
804 ASSERT_NE(frameNode, nullptr);
805 std::set<std::string> allowDrop = { allowTag };
806 frameNode->SetAllowDrop(allowDrop);
807 ASSERT_NE(frameNode, nullptr);
808
809 /**
810 * @tc.steps: step3. construct summaryMap for dragDropManager.
811 * @tc.expected: dragDropManager is not null.
812 */
813 const std::string summary_TAG(NODE_TAG_A);
814 dragDropManager->summaryMap_.clear();
815 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
816 ASSERT_NE(dragDropManager, nullptr);
817
818 /**
819 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
820 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
821 */
822 bool isDisallowDrop = false;
823 ASSERT_FALSE(isDisallowDrop);
824 frameNode->SetDisallowDropForcedly(isDisallowDrop);
825 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
826 ASSERT_FALSE(isDisallowDropForcedly);
827
828 /**
829 * @tc.steps: step5. ReportingSupported is set to false.
830 * @tc.expected: reportingEnabledFalse is false.
831 */
832 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
833 }
834
835 /**
836 * @tc.name: FrameNodeDropTestNg019
837 * @tc.desc: Test frame node method
838 * @tc.type: FUNC
839 */
840 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg019, TestSize.Level1)
841 {
842 /**
843 * @tc.steps: step1. construct a DragDropManager.
844 * @tc.expected: dragDropManager is not null.
845 */
846 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
847 ASSERT_NE(dragDropManager, nullptr);
848
849 /**
850 * @tc.steps: step2. construct frameNode and update the properties.
851 * @tc.expected: frameNode is not null.
852 */
853 const std::string allowTag(NODE_TAG_ONE);
854 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
855 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
856 ASSERT_NE(frameNode, nullptr);
857 std::set<std::string> allowDrop = { allowTag };
858 frameNode->SetAllowDrop(allowDrop);
859 ASSERT_NE(frameNode, nullptr);
860
861 /**
862 * @tc.steps: step3. construct summaryMap for dragDropManager.
863 * @tc.expected: dragDropManager is not null.
864 */
865 const std::string summary_TAG(NODE_TAG_SPOT);
866 dragDropManager->summaryMap_.clear();
867 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
868 ASSERT_NE(dragDropManager, nullptr);
869
870 /**
871 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
872 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
873 */
874 bool isDisallowDrop = false;
875 ASSERT_FALSE(isDisallowDrop);
876 frameNode->SetDisallowDropForcedly(isDisallowDrop);
877 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
878 ASSERT_FALSE(isDisallowDropForcedly);
879
880 /**
881 * @tc.steps: step5. ReportingSupported is set to false.
882 * @tc.expected: reportingEnabledFalse is false.
883 */
884 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
885 }
886
887 /**
888 * @tc.name: FrameNodeDropTestNg020
889 * @tc.desc: Test frame node method
890 * @tc.type: FUNC
891 */
892 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg020, TestSize.Level1)
893 {
894 /**
895 * @tc.steps: step1. construct a DragDropManager.
896 * @tc.expected: dragDropManager is not null.
897 */
898 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
899 ASSERT_NE(dragDropManager, nullptr);
900
901 /**
902 * @tc.steps: step2. construct frameNode and update the properties.
903 * @tc.expected: frameNode is not null.
904 */
905 const std::string allowTag(NODE_TAG_ONE);
906 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
907 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
908 ASSERT_NE(frameNode, nullptr);
909 std::set<std::string> allowDrop = { allowTag };
910 frameNode->SetAllowDrop(allowDrop);
911 ASSERT_NE(frameNode, nullptr);
912
913 /**
914 * @tc.steps: step3. construct summaryMap for dragDropManager.
915 * @tc.expected: dragDropManager is not null.
916 */
917 const std::string summary_TAG(NODE_TAG_ONE);
918 dragDropManager->summaryMap_.clear();
919 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
920 ASSERT_NE(dragDropManager, nullptr);
921
922 /**
923 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
924 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
925 */
926 bool isDisallowDrop = false;
927 ASSERT_FALSE(isDisallowDrop);
928 frameNode->SetDisallowDropForcedly(isDisallowDrop);
929 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
930 ASSERT_FALSE(isDisallowDropForcedly);
931
932 /**
933 * @tc.steps: step5. ReportingSupported is set to false.
934 * @tc.expected: reportingEnabledFalse is false.
935 */
936 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
937 }
938
939 /**
940 * @tc.name: FrameNodeDropTestNg021
941 * @tc.desc: Test frame node method
942 * @tc.type: FUNC
943 */
944 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg021, TestSize.Level1)
945 {
946 /**
947 * @tc.steps: step1. construct a DragDropManager.
948 * @tc.expected: dragDropManager is not null.
949 */
950 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
951 ASSERT_NE(dragDropManager, nullptr);
952
953 /**
954 * @tc.steps: step2. construct frameNode and update the properties.
955 * @tc.expected: frameNode is not null.
956 */
957 const std::string allowTag(NODE_TAG_ONE);
958 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
959 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
960 ASSERT_NE(frameNode, nullptr);
961 std::set<std::string> allowDrop = { allowTag };
962 frameNode->SetAllowDrop(allowDrop);
963 ASSERT_NE(frameNode, nullptr);
964
965 /**
966 * @tc.steps: step3. construct summaryMap for dragDropManager.
967 * @tc.expected: dragDropManager is not null.
968 */
969 const std::string summary_TAG(NODE_TAG_A);
970 dragDropManager->summaryMap_.clear();
971 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
972 ASSERT_NE(dragDropManager, nullptr);
973
974 /**
975 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
976 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
977 */
978 bool isDisallowDrop = false;
979 ASSERT_FALSE(isDisallowDrop);
980 frameNode->SetDisallowDropForcedly(isDisallowDrop);
981 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
982 ASSERT_FALSE(isDisallowDropForcedly);
983
984 /**
985 * @tc.steps: step5. ReportingSupported is set to false.
986 * @tc.expected: reportingEnabledFalse is false.
987 */
988 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
989 }
990
991 /**
992 * @tc.name: FrameNodeDropTestNg022
993 * @tc.desc: Test frame node method
994 * @tc.type: FUNC
995 */
996 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg022, TestSize.Level1)
997 {
998 /**
999 * @tc.steps: step1. construct a DragDropManager.
1000 * @tc.expected: dragDropManager is not null.
1001 */
1002 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1003 ASSERT_NE(dragDropManager, nullptr);
1004
1005 /**
1006 * @tc.steps: step2. construct frameNode and update the properties.
1007 * @tc.expected: frameNode is not null.
1008 */
1009 const std::string allowTag(NODE_TAG_A);
1010 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1011 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1012 ASSERT_NE(frameNode, nullptr);
1013 std::set<std::string> allowDrop = { allowTag };
1014 frameNode->SetAllowDrop(allowDrop);
1015 ASSERT_NE(frameNode, nullptr);
1016
1017 /**
1018 * @tc.steps: step3. construct summaryMap for dragDropManager.
1019 * @tc.expected: dragDropManager is not null.
1020 */
1021 const std::string summary_TAG(NODE_TAG_SPOT);
1022 dragDropManager->summaryMap_.clear();
1023 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1024 ASSERT_NE(dragDropManager, nullptr);
1025
1026 /**
1027 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1028 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1029 */
1030 bool isDisallowDrop = false;
1031 ASSERT_FALSE(isDisallowDrop);
1032 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1033 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1034 ASSERT_FALSE(isDisallowDropForcedly);
1035
1036 /**
1037 * @tc.steps: step5. ReportingSupported is set to false.
1038 * @tc.expected: reportingEnabledFalse is false.
1039 */
1040 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1041 }
1042
1043 /**
1044 * @tc.name: FrameNodeDropTestNg023
1045 * @tc.desc: Test frame node method
1046 * @tc.type: FUNC
1047 */
1048 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg023, TestSize.Level1)
1049 {
1050 /**
1051 * @tc.steps: step1. construct a DragDropManager.
1052 * @tc.expected: dragDropManager is not null.
1053 */
1054 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1055 ASSERT_NE(dragDropManager, nullptr);
1056
1057 /**
1058 * @tc.steps: step2. construct frameNode and update the properties.
1059 * @tc.expected: frameNode is not null.
1060 */
1061 const std::string allowTag(NODE_TAG_A);
1062 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1063 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1064 ASSERT_NE(frameNode, nullptr);
1065 std::set<std::string> allowDrop = { allowTag };
1066 frameNode->SetAllowDrop(allowDrop);
1067 ASSERT_NE(frameNode, nullptr);
1068
1069 /**
1070 * @tc.steps: step3. construct summaryMap for dragDropManager.
1071 * @tc.expected: dragDropManager is not null.
1072 */
1073 const std::string summary_TAG(NODE_TAG_ONE);
1074 dragDropManager->summaryMap_.clear();
1075 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1076 ASSERT_NE(dragDropManager, nullptr);
1077
1078 /**
1079 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1080 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1081 */
1082 bool isDisallowDrop = false;
1083 ASSERT_FALSE(isDisallowDrop);
1084 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1085 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1086 ASSERT_FALSE(isDisallowDropForcedly);
1087
1088 /**
1089 * @tc.steps: step5. ReportingSupported is set to false.
1090 * @tc.expected: reportingEnabledFalse is false.
1091 */
1092 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1093 }
1094
1095 /**
1096 * @tc.name: FrameNodeDropTestNg024
1097 * @tc.desc: Test frame node method
1098 * @tc.type: FUNC
1099 */
1100 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg024, TestSize.Level1)
1101 {
1102 /**
1103 * @tc.steps: step1. construct a DragDropManager.
1104 * @tc.expected: dragDropManager is not null.
1105 */
1106 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1107 ASSERT_NE(dragDropManager, nullptr);
1108
1109 /**
1110 * @tc.steps: step2. construct frameNode and update the properties.
1111 * @tc.expected: frameNode is not null.
1112 */
1113 const std::string allowTag(NODE_TAG_A);
1114 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1115 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1116 ASSERT_NE(frameNode, nullptr);
1117 std::set<std::string> allowDrop = { allowTag };
1118 frameNode->SetAllowDrop(allowDrop);
1119 ASSERT_NE(frameNode, nullptr);
1120
1121 /**
1122 * @tc.steps: step3. construct summaryMap for dragDropManager.
1123 * @tc.expected: dragDropManager is not null.
1124 */
1125 const std::string summary_TAG(NODE_TAG_A);
1126 dragDropManager->summaryMap_.clear();
1127 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1128 ASSERT_NE(dragDropManager, nullptr);
1129
1130 /**
1131 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1132 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1133 */
1134 bool isDisallowDrop = false;
1135 ASSERT_FALSE(isDisallowDrop);
1136 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1137 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1138 ASSERT_FALSE(isDisallowDropForcedly);
1139
1140 /**
1141 * @tc.steps: step5. ReportingSupported is set to false.
1142 * @tc.expected: reportingEnabledFalse is false.
1143 */
1144 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1145 }
1146
1147 /**
1148 * @tc.name: FrameNodeDropTestNg025
1149 * @tc.desc: Test frame node method
1150 * @tc.type: FUNC
1151 */
1152 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg025, TestSize.Level1)
1153 {
1154 /**
1155 * @tc.steps: step1. construct a DragDropManager.
1156 * @tc.expected: dragDropManager is not null.
1157 */
1158 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1159 ASSERT_NE(dragDropManager, nullptr);
1160
1161 /**
1162 * @tc.steps: step2. construct frameNode and update the properties.
1163 * @tc.expected: frameNode is not null.
1164 */
1165 const std::string allowTag(NODE_TAG_EMPTY);
1166 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1167 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1168 ASSERT_NE(frameNode, nullptr);
1169 std::set<std::string> allowDrop;
1170 frameNode->SetAllowDrop(allowDrop);
1171 ASSERT_NE(frameNode, nullptr);
1172
1173 /**
1174 * @tc.steps: step3. construct summaryMap for dragDropManager.
1175 * @tc.expected: dragDropManager is not null.
1176 */
1177 const std::string summary_TAG(NODE_TAG_SPOT);
1178 dragDropManager->summaryMap_.clear();
1179 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1180 ASSERT_NE(dragDropManager, nullptr);
1181
1182 /**
1183 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1184 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1185 */
1186 bool isDisallowDrop = false;
1187 ASSERT_FALSE(isDisallowDrop);
1188 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1189 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1190 ASSERT_FALSE(isDisallowDropForcedly);
1191
1192 /**
1193 * @tc.steps: step5. ReportingSupported is set to false.
1194 * @tc.expected: reportingEnabledFalse is false.
1195 */
1196 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1197 }
1198
1199 /**
1200 * @tc.name: FrameNodeDropTestNg026
1201 * @tc.desc: Test frame node method
1202 * @tc.type: FUNC
1203 */
1204 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg026, TestSize.Level1)
1205 {
1206 /**
1207 * @tc.steps: step1. construct a DragDropManager.
1208 * @tc.expected: dragDropManager is not null.
1209 */
1210 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1211 ASSERT_NE(dragDropManager, nullptr);
1212
1213 /**
1214 * @tc.steps: step2. construct frameNode and update the properties.
1215 * @tc.expected: frameNode is not null.
1216 */
1217 const std::string allowTag(NODE_TAG_EMPTY);
1218 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1219 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1220 ASSERT_NE(frameNode, nullptr);
1221 std::set<std::string> allowDrop;
1222 frameNode->SetAllowDrop(allowDrop);
1223 ASSERT_NE(frameNode, nullptr);
1224
1225 /**
1226 * @tc.steps: step3. construct summaryMap for dragDropManager.
1227 * @tc.expected: dragDropManager is not null.
1228 */
1229 const std::string summary_TAG(NODE_TAG_ONE);
1230 dragDropManager->summaryMap_.clear();
1231 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1232 ASSERT_NE(dragDropManager, nullptr);
1233
1234 /**
1235 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1236 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1237 */
1238 bool isDisallowDrop = false;
1239 ASSERT_FALSE(isDisallowDrop);
1240 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1241 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1242 ASSERT_FALSE(isDisallowDropForcedly);
1243
1244 /**
1245 * @tc.steps: step5. ReportingSupported is set to false.
1246 * @tc.expected: reportingEnabledFalse is false.
1247 */
1248 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1249 }
1250
1251 /**
1252 * @tc.name: FrameNodeDropTestNg027
1253 * @tc.desc: Test frame node method
1254 * @tc.type: FUNC
1255 */
1256 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg027, TestSize.Level1)
1257 {
1258 /**
1259 * @tc.steps: step1. construct a DragDropManager.
1260 * @tc.expected: dragDropManager is not null.
1261 */
1262 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1263 ASSERT_NE(dragDropManager, nullptr);
1264
1265 /**
1266 * @tc.steps: step2. construct frameNode and update the properties.
1267 * @tc.expected: frameNode is not null.
1268 */
1269 const std::string allowTag(NODE_TAG_EMPTY);
1270 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1271 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1272 ASSERT_NE(frameNode, nullptr);
1273 std::set<std::string> allowDrop;
1274 frameNode->SetAllowDrop(allowDrop);
1275 ASSERT_NE(frameNode, nullptr);
1276
1277 /**
1278 * @tc.steps: step3. construct summaryMap for dragDropManager.
1279 * @tc.expected: dragDropManager is not null.
1280 */
1281 const std::string summary_TAG(NODE_TAG_A);
1282 dragDropManager->summaryMap_.clear();
1283 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1284 ASSERT_NE(dragDropManager, nullptr);
1285
1286 /**
1287 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1288 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1289 */
1290 bool isDisallowDrop = false;
1291 ASSERT_FALSE(isDisallowDrop);
1292 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1293 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1294 ASSERT_FALSE(isDisallowDropForcedly);
1295
1296 /**
1297 * @tc.steps: step5. ReportingSupported is set to false.
1298 * @tc.expected: reportingEnabledFalse is false.
1299 */
1300 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1301 }
1302
1303 /**
1304 * @tc.name: FrameNodeDropTestNg028
1305 * @tc.desc: Test frame node method
1306 * @tc.type: FUNC
1307 */
1308 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg028, TestSize.Level1)
1309 {
1310 /**
1311 * @tc.steps: step1. construct a DragDropManager.
1312 * @tc.expected: dragDropManager is not null.
1313 */
1314 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1315 ASSERT_NE(dragDropManager, nullptr);
1316
1317 /**
1318 * @tc.steps: step2. construct frameNode and update the properties.
1319 * @tc.expected: frameNode is not null.
1320 */
1321 const std::string allowTag(NODE_TAG_SPOT);
1322 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1323 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1324 ASSERT_NE(frameNode, nullptr);
1325 std::set<std::string> allowDrop = { allowTag };
1326 frameNode->SetAllowDrop(allowDrop);
1327 ASSERT_NE(frameNode, nullptr);
1328
1329 /**
1330 * @tc.steps: step3. construct summaryMap for dragDropManager.
1331 * @tc.expected: dragDropManager is not null.
1332 */
1333 dragDropManager->summaryMap_.clear();
1334 ASSERT_NE(dragDropManager, nullptr);
1335
1336 /**
1337 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1338 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1339 */
1340 bool isDisallowDrop = false;
1341 ASSERT_FALSE(isDisallowDrop);
1342 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1343 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1344 ASSERT_FALSE(isDisallowDropForcedly);
1345
1346 /**
1347 * @tc.steps: step5. ReportingSupported is set to false.
1348 * @tc.expected: reportingEnabledFalse is false.
1349 */
1350 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1351 }
1352
1353 /**
1354 * @tc.name: FrameNodeDropTestNg029
1355 * @tc.desc: Test frame node method
1356 * @tc.type: FUNC
1357 */
1358 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg029, TestSize.Level1)
1359 {
1360 /**
1361 * @tc.steps: step1. construct a DragDropManager.
1362 * @tc.expected: dragDropManager is not null.
1363 */
1364 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1365 ASSERT_NE(dragDropManager, nullptr);
1366
1367 /**
1368 * @tc.steps: step2. construct frameNode and update the properties.
1369 * @tc.expected: frameNode is not null.
1370 */
1371 const std::string allowTag(NODE_TAG_ONE);
1372 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1373 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1374 ASSERT_NE(frameNode, nullptr);
1375 std::set<std::string> allowDrop = { allowTag };
1376 frameNode->SetAllowDrop(allowDrop);
1377 ASSERT_NE(frameNode, nullptr);
1378
1379 /**
1380 * @tc.steps: step3. construct summaryMap for dragDropManager.
1381 * @tc.expected: dragDropManager is not null.
1382 */
1383 dragDropManager->summaryMap_.clear();
1384 ASSERT_NE(dragDropManager, nullptr);
1385
1386 /**
1387 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1388 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1389 */
1390 bool isDisallowDrop = false;
1391 ASSERT_FALSE(isDisallowDrop);
1392 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1393 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1394 ASSERT_FALSE(isDisallowDropForcedly);
1395
1396 /**
1397 * @tc.steps: step5. ReportingSupported is set to false.
1398 * @tc.expected: reportingEnabledFalse is false.
1399 */
1400 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1401 }
1402
1403 /**
1404 * @tc.name: FrameNodeDropTestNg030
1405 * @tc.desc: Test frame node method
1406 * @tc.type: FUNC
1407 */
1408 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg030, TestSize.Level1)
1409 {
1410 /**
1411 * @tc.steps: step1. construct a DragDropManager.
1412 * @tc.expected: dragDropManager is not null.
1413 */
1414 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1415 ASSERT_NE(dragDropManager, nullptr);
1416
1417 /**
1418 * @tc.steps: step2. construct frameNode and update the properties.
1419 * @tc.expected: frameNode is not null.
1420 */
1421 const std::string allowTag(NODE_TAG_A);
1422 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1423 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1424 ASSERT_NE(frameNode, nullptr);
1425 std::set<std::string> allowDrop = { allowTag };
1426 frameNode->SetAllowDrop(allowDrop);
1427 ASSERT_NE(frameNode, nullptr);
1428
1429 /**
1430 * @tc.steps: step3. construct summaryMap for dragDropManager.
1431 * @tc.expected: dragDropManager is not null.
1432 */
1433 dragDropManager->summaryMap_.clear();
1434 ASSERT_NE(dragDropManager, nullptr);
1435
1436 /**
1437 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1438 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1439 */
1440 bool isDisallowDrop = false;
1441 ASSERT_FALSE(isDisallowDrop);
1442 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1443 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1444 ASSERT_FALSE(isDisallowDropForcedly);
1445
1446 /**
1447 * @tc.steps: step5. ReportingSupported is set to false.
1448 * @tc.expected: reportingEnabledFalse is false.
1449 */
1450 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
1451 }
1452
1453 /**
1454 * @tc.name: FrameNodeDropTestNg031
1455 * @tc.desc: Test frame node method
1456 * @tc.type: FUNC
1457 */
1458 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg031, TestSize.Level1)
1459 {
1460 /**
1461 * @tc.steps: step1. construct a DragDropManager.
1462 * @tc.expected: dragDropManager is not null.
1463 */
1464 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1465 ASSERT_NE(dragDropManager, nullptr);
1466
1467 /**
1468 * @tc.steps: step2. construct frameNode and update the properties.
1469 * @tc.expected: frameNode is not null.
1470 */
1471 const std::string allowTag(NODE_TAG_SPOT);
1472 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1473 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1474 ASSERT_NE(frameNode, nullptr);
1475 std::set<std::string> allowDrop = { allowTag };
1476 frameNode->SetAllowDrop(allowDrop);
1477 ASSERT_NE(frameNode, nullptr);
1478
1479 /**
1480 * @tc.steps: step3. construct summaryMap for dragDropManager.
1481 * @tc.expected: dragDropManager is not null.
1482 */
1483 const std::string summary_TAG(NODE_TAG_SPOT);
1484 dragDropManager->summaryMap_.clear();
1485 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1486 ASSERT_NE(dragDropManager, nullptr);
1487
1488 /**
1489 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1490 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1491 */
1492 bool isDisallowDrop = true;
1493 ASSERT_TRUE(isDisallowDrop);
1494 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1495 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1496 ASSERT_TRUE(isDisallowDropForcedly);
1497
1498 /**
1499 * @tc.steps: step5. ReportingSupported is set to false.
1500 * @tc.expected: reportingEnabledFalse is false.
1501 */
1502 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1503 }
1504
1505 /**
1506 * @tc.name: FrameNodeDropTestNg032
1507 * @tc.desc: Test frame node method
1508 * @tc.type: FUNC
1509 */
1510 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg032, TestSize.Level1)
1511 {
1512 /**
1513 * @tc.steps: step1. construct a DragDropManager.
1514 * @tc.expected: dragDropManager is not null.
1515 */
1516 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1517 ASSERT_NE(dragDropManager, nullptr);
1518
1519 /**
1520 * @tc.steps: step2. construct frameNode and update the properties.
1521 * @tc.expected: frameNode is not null.
1522 */
1523 const std::string allowTag(NODE_TAG_SPOT);
1524 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1525 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1526 ASSERT_NE(frameNode, nullptr);
1527 std::set<std::string> allowDrop = { allowTag };
1528 frameNode->SetAllowDrop(allowDrop);
1529 ASSERT_NE(frameNode, nullptr);
1530
1531 /**
1532 * @tc.steps: step3. construct summaryMap for dragDropManager.
1533 * @tc.expected: dragDropManager is not null.
1534 */
1535 const std::string summary_TAG(NODE_TAG_ONE);
1536 dragDropManager->summaryMap_.clear();
1537 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1538 ASSERT_NE(dragDropManager, nullptr);
1539
1540 /**
1541 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1542 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1543 */
1544 bool isDisallowDrop = true;
1545 ASSERT_TRUE(isDisallowDrop);
1546 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1547 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1548 ASSERT_TRUE(isDisallowDropForcedly);
1549
1550 /**
1551 * @tc.steps: step5. ReportingSupported is set to false.
1552 * @tc.expected: reportingEnabledFalse is false.
1553 */
1554 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1555 }
1556
1557 /**
1558 * @tc.name: FrameNodeDropTestNg033
1559 * @tc.desc: Test frame node method
1560 * @tc.type: FUNC
1561 */
1562 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg033, TestSize.Level1)
1563 {
1564 /**
1565 * @tc.steps: step1. construct a DragDropManager.
1566 * @tc.expected: dragDropManager is not null.
1567 */
1568 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1569 ASSERT_NE(dragDropManager, nullptr);
1570
1571 /**
1572 * @tc.steps: step2. construct frameNode and update the properties.
1573 * @tc.expected: frameNode is not null.
1574 */
1575 const std::string allowTag(NODE_TAG_SPOT);
1576 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1577 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1578 ASSERT_NE(frameNode, nullptr);
1579 std::set<std::string> allowDrop = { allowTag };
1580 frameNode->SetAllowDrop(allowDrop);
1581 ASSERT_NE(frameNode, nullptr);
1582
1583 /**
1584 * @tc.steps: step3. construct summaryMap for dragDropManager.
1585 * @tc.expected: dragDropManager is not null.
1586 */
1587 const std::string summary_TAG(NODE_TAG_A);
1588 dragDropManager->summaryMap_.clear();
1589 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1590 ASSERT_NE(dragDropManager, nullptr);
1591
1592 /**
1593 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1594 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1595 */
1596 bool isDisallowDrop = true;
1597 ASSERT_TRUE(isDisallowDrop);
1598 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1599 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1600 ASSERT_TRUE(isDisallowDropForcedly);
1601
1602 /**
1603 * @tc.steps: step5. ReportingSupported is set to false.
1604 * @tc.expected: reportingEnabledFalse is false.
1605 */
1606 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1607 }
1608
1609 /**
1610 * @tc.name: FrameNodeDropTestNg034
1611 * @tc.desc: Test frame node method
1612 * @tc.type: FUNC
1613 */
1614 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg034, TestSize.Level1)
1615 {
1616 /**
1617 * @tc.steps: step1. construct a DragDropManager.
1618 * @tc.expected: dragDropManager is not null.
1619 */
1620 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1621 ASSERT_NE(dragDropManager, nullptr);
1622
1623 /**
1624 * @tc.steps: step2. construct frameNode and update the properties.
1625 * @tc.expected: frameNode is not null.
1626 */
1627 const std::string allowTag(NODE_TAG_ONE);
1628 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1629 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1630 ASSERT_NE(frameNode, nullptr);
1631 std::set<std::string> allowDrop = { allowTag };
1632 frameNode->SetAllowDrop(allowDrop);
1633 ASSERT_NE(frameNode, nullptr);
1634
1635 /**
1636 * @tc.steps: step3. construct summaryMap for dragDropManager.
1637 * @tc.expected: dragDropManager is not null.
1638 */
1639 const std::string summary_TAG(NODE_TAG_SPOT);
1640 dragDropManager->summaryMap_.clear();
1641 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1642 ASSERT_NE(dragDropManager, nullptr);
1643
1644 /**
1645 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1646 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1647 */
1648 bool isDisallowDrop = true;
1649 ASSERT_TRUE(isDisallowDrop);
1650 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1651 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1652 ASSERT_TRUE(isDisallowDropForcedly);
1653
1654 /**
1655 * @tc.steps: step5. ReportingSupported is set to false.
1656 * @tc.expected: reportingEnabledFalse is false.
1657 */
1658 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1659 }
1660
1661 /**
1662 * @tc.name: FrameNodeDropTestNg035
1663 * @tc.desc: Test frame node method
1664 * @tc.type: FUNC
1665 */
1666 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg035, TestSize.Level1)
1667 {
1668 /**
1669 * @tc.steps: step1. construct a DragDropManager.
1670 * @tc.expected: dragDropManager is not null.
1671 */
1672 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1673 ASSERT_NE(dragDropManager, nullptr);
1674
1675 /**
1676 * @tc.steps: step2. construct frameNode and update the properties.
1677 * @tc.expected: frameNode is not null.
1678 */
1679 const std::string allowTag(NODE_TAG_ONE);
1680 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1681 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1682 ASSERT_NE(frameNode, nullptr);
1683 std::set<std::string> allowDrop = { allowTag };
1684 frameNode->SetAllowDrop(allowDrop);
1685 ASSERT_NE(frameNode, nullptr);
1686
1687 /**
1688 * @tc.steps: step3. construct summaryMap for dragDropManager.
1689 * @tc.expected: dragDropManager is not null.
1690 */
1691 const std::string summary_TAG(NODE_TAG_ONE);
1692 dragDropManager->summaryMap_.clear();
1693 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1694 ASSERT_NE(dragDropManager, nullptr);
1695
1696 /**
1697 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1698 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1699 */
1700 bool isDisallowDrop = true;
1701 ASSERT_TRUE(isDisallowDrop);
1702 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1703 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1704 ASSERT_TRUE(isDisallowDropForcedly);
1705
1706 /**
1707 * @tc.steps: step5. ReportingSupported is set to false.
1708 * @tc.expected: reportingEnabledFalse is false.
1709 */
1710 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1711 }
1712
1713 /**
1714 * @tc.name: FrameNodeDropTestNg036
1715 * @tc.desc: Test frame node method
1716 * @tc.type: FUNC
1717 */
1718 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg036, TestSize.Level1)
1719 {
1720 /**
1721 * @tc.steps: step1. construct a DragDropManager.
1722 * @tc.expected: dragDropManager is not null.
1723 */
1724 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1725 ASSERT_NE(dragDropManager, nullptr);
1726
1727 /**
1728 * @tc.steps: step2. construct frameNode and update the properties.
1729 * @tc.expected: frameNode is not null.
1730 */
1731 const std::string allowTag(NODE_TAG_ONE);
1732 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1733 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1734 ASSERT_NE(frameNode, nullptr);
1735 std::set<std::string> allowDrop = { allowTag };
1736 frameNode->SetAllowDrop(allowDrop);
1737 ASSERT_NE(frameNode, nullptr);
1738
1739 /**
1740 * @tc.steps: step3. construct summaryMap for dragDropManager.
1741 * @tc.expected: dragDropManager is not null.
1742 */
1743 const std::string summary_TAG(NODE_TAG_A);
1744 dragDropManager->summaryMap_.clear();
1745 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1746 ASSERT_NE(dragDropManager, nullptr);
1747
1748 /**
1749 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1750 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1751 */
1752 bool isDisallowDrop = true;
1753 ASSERT_TRUE(isDisallowDrop);
1754 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1755 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1756 ASSERT_TRUE(isDisallowDropForcedly);
1757
1758 /**
1759 * @tc.steps: step5. ReportingSupported is set to false.
1760 * @tc.expected: reportingEnabledFalse is false.
1761 */
1762 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1763 }
1764
1765 /**
1766 * @tc.name: FrameNodeDropTestNg037
1767 * @tc.desc: Test frame node method
1768 * @tc.type: FUNC
1769 */
1770 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg037, TestSize.Level1)
1771 {
1772 /**
1773 * @tc.steps: step1. construct a DragDropManager.
1774 * @tc.expected: dragDropManager is not null.
1775 */
1776 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1777 ASSERT_NE(dragDropManager, nullptr);
1778
1779 /**
1780 * @tc.steps: step2. construct frameNode and update the properties.
1781 * @tc.expected: frameNode is not null.
1782 */
1783 const std::string allowTag(NODE_TAG_A);
1784 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1785 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1786 ASSERT_NE(frameNode, nullptr);
1787 std::set<std::string> allowDrop = { allowTag };
1788 frameNode->SetAllowDrop(allowDrop);
1789 ASSERT_NE(frameNode, nullptr);
1790
1791 /**
1792 * @tc.steps: step3. construct summaryMap for dragDropManager.
1793 * @tc.expected: dragDropManager is not null.
1794 */
1795 const std::string summary_TAG(NODE_TAG_SPOT);
1796 dragDropManager->summaryMap_.clear();
1797 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1798 ASSERT_NE(dragDropManager, nullptr);
1799
1800 /**
1801 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1802 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1803 */
1804 bool isDisallowDrop = true;
1805 ASSERT_TRUE(isDisallowDrop);
1806 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1807 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1808 ASSERT_TRUE(isDisallowDropForcedly);
1809
1810 /**
1811 * @tc.steps: step5. ReportingSupported is set to false.
1812 * @tc.expected: reportingEnabledFalse is false.
1813 */
1814 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1815 }
1816
1817 /**
1818 * @tc.name: FrameNodeDropTestNg038
1819 * @tc.desc: Test frame node method
1820 * @tc.type: FUNC
1821 */
1822 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg038, TestSize.Level1)
1823 {
1824 /**
1825 * @tc.steps: step1. construct a DragDropManager.
1826 * @tc.expected: dragDropManager is not null.
1827 */
1828 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1829 ASSERT_NE(dragDropManager, nullptr);
1830
1831 /**
1832 * @tc.steps: step2. construct frameNode and update the properties.
1833 * @tc.expected: frameNode is not null.
1834 */
1835 const std::string allowTag(NODE_TAG_A);
1836 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1837 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1838 ASSERT_NE(frameNode, nullptr);
1839 std::set<std::string> allowDrop = { allowTag };
1840 frameNode->SetAllowDrop(allowDrop);
1841 ASSERT_NE(frameNode, nullptr);
1842
1843 /**
1844 * @tc.steps: step3. construct summaryMap for dragDropManager.
1845 * @tc.expected: dragDropManager is not null.
1846 */
1847 const std::string summary_TAG(NODE_TAG_ONE);
1848 dragDropManager->summaryMap_.clear();
1849 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1850 ASSERT_NE(dragDropManager, nullptr);
1851
1852 /**
1853 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1854 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1855 */
1856 bool isDisallowDrop = true;
1857 ASSERT_TRUE(isDisallowDrop);
1858 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1859 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1860 ASSERT_TRUE(isDisallowDropForcedly);
1861
1862 /**
1863 * @tc.steps: step5. ReportingSupported is set to false.
1864 * @tc.expected: reportingEnabledFalse is false.
1865 */
1866 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1867 }
1868
1869 /**
1870 * @tc.name: FrameNodeDropTestNg039
1871 * @tc.desc: Test frame node method
1872 * @tc.type: FUNC
1873 */
1874 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg039, TestSize.Level1)
1875 {
1876 /**
1877 * @tc.steps: step1. construct a DragDropManager.
1878 * @tc.expected: dragDropManager is not null.
1879 */
1880 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1881 ASSERT_NE(dragDropManager, nullptr);
1882
1883 /**
1884 * @tc.steps: step2. construct frameNode and update the properties.
1885 * @tc.expected: frameNode is not null.
1886 */
1887 const std::string allowTag(NODE_TAG_A);
1888 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1889 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1890 ASSERT_NE(frameNode, nullptr);
1891 std::set<std::string> allowDrop = { allowTag };
1892 frameNode->SetAllowDrop(allowDrop);
1893 ASSERT_NE(frameNode, nullptr);
1894
1895 /**
1896 * @tc.steps: step3. construct summaryMap for dragDropManager.
1897 * @tc.expected: dragDropManager is not null.
1898 */
1899 const std::string summary_TAG(NODE_TAG_A);
1900 dragDropManager->summaryMap_.clear();
1901 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1902 ASSERT_NE(dragDropManager, nullptr);
1903
1904 /**
1905 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1906 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1907 */
1908 bool isDisallowDrop = true;
1909 ASSERT_TRUE(isDisallowDrop);
1910 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1911 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1912 ASSERT_TRUE(isDisallowDropForcedly);
1913
1914 /**
1915 * @tc.steps: step5. ReportingSupported is set to false.
1916 * @tc.expected: reportingEnabledFalse is false.
1917 */
1918 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1919 }
1920
1921 /**
1922 * @tc.name: FrameNodeDropTestNg040
1923 * @tc.desc: Test frame node method
1924 * @tc.type: FUNC
1925 */
1926 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg040, TestSize.Level1)
1927 {
1928 /**
1929 * @tc.steps: step1. construct a DragDropManager.
1930 * @tc.expected: dragDropManager is not null.
1931 */
1932 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1933 ASSERT_NE(dragDropManager, nullptr);
1934
1935 /**
1936 * @tc.steps: step2. construct frameNode and update the properties.
1937 * @tc.expected: frameNode is not null.
1938 */
1939 const std::string allowTag(NODE_TAG_EMPTY);
1940 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1941 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1942 ASSERT_NE(frameNode, nullptr);
1943 std::set<std::string> allowDrop;
1944 frameNode->SetAllowDrop(allowDrop);
1945 ASSERT_NE(frameNode, nullptr);
1946
1947 /**
1948 * @tc.steps: step3. construct summaryMap for dragDropManager.
1949 * @tc.expected: dragDropManager is not null.
1950 */
1951 const std::string summary_TAG(NODE_TAG_SPOT);
1952 dragDropManager->summaryMap_.clear();
1953 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
1954 ASSERT_NE(dragDropManager, nullptr);
1955
1956 /**
1957 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
1958 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
1959 */
1960 bool isDisallowDrop = true;
1961 ASSERT_TRUE(isDisallowDrop);
1962 frameNode->SetDisallowDropForcedly(isDisallowDrop);
1963 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
1964 ASSERT_TRUE(isDisallowDropForcedly);
1965
1966 /**
1967 * @tc.steps: step5. ReportingSupported is set to false.
1968 * @tc.expected: reportingEnabledFalse is false.
1969 */
1970 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
1971 }
1972
1973 /**
1974 * @tc.name: FrameNodeDropTestNg041
1975 * @tc.desc: Test frame node method
1976 * @tc.type: FUNC
1977 */
1978 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg041, TestSize.Level1)
1979 {
1980 /**
1981 * @tc.steps: step1. construct a DragDropManager.
1982 * @tc.expected: dragDropManager is not null.
1983 */
1984 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
1985 ASSERT_NE(dragDropManager, nullptr);
1986
1987 /**
1988 * @tc.steps: step2. construct frameNode and update the properties.
1989 * @tc.expected: frameNode is not null.
1990 */
1991 const std::string allowTag(NODE_TAG_EMPTY);
1992 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
1993 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
1994 ASSERT_NE(frameNode, nullptr);
1995 std::set<std::string> allowDrop;
1996 frameNode->SetAllowDrop(allowDrop);
1997 ASSERT_NE(frameNode, nullptr);
1998
1999 /**
2000 * @tc.steps: step3. construct summaryMap for dragDropManager.
2001 * @tc.expected: dragDropManager is not null.
2002 */
2003 const std::string summary_TAG(NODE_TAG_ONE);
2004 dragDropManager->summaryMap_.clear();
2005 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
2006 ASSERT_NE(dragDropManager, nullptr);
2007
2008 /**
2009 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2010 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2011 */
2012 bool isDisallowDrop = true;
2013 ASSERT_TRUE(isDisallowDrop);
2014 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2015 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2016 ASSERT_TRUE(isDisallowDropForcedly);
2017
2018 /**
2019 * @tc.steps: step5. ReportingSupported is set to false.
2020 * @tc.expected: reportingEnabledFalse is false.
2021 */
2022 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2023 }
2024
2025 /**
2026 * @tc.name: FrameNodeDropTestNg042
2027 * @tc.desc: Test frame node method
2028 * @tc.type: FUNC
2029 */
2030 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg042, TestSize.Level1)
2031 {
2032 /**
2033 * @tc.steps: step1. construct a DragDropManager.
2034 * @tc.expected: dragDropManager is not null.
2035 */
2036 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2037 ASSERT_NE(dragDropManager, nullptr);
2038
2039 /**
2040 * @tc.steps: step2. construct frameNode and update the properties.
2041 * @tc.expected: frameNode is not null.
2042 */
2043 const std::string allowTag(NODE_TAG_EMPTY);
2044 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2045 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2046 ASSERT_NE(frameNode, nullptr);
2047 std::set<std::string> allowDrop;
2048 frameNode->SetAllowDrop(allowDrop);
2049 ASSERT_NE(frameNode, nullptr);
2050
2051 /**
2052 * @tc.steps: step3. construct summaryMap for dragDropManager.
2053 * @tc.expected: dragDropManager is not null.
2054 */
2055 const std::string summary_TAG(NODE_TAG_A);
2056 dragDropManager->summaryMap_.clear();
2057 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
2058 ASSERT_NE(dragDropManager, nullptr);
2059
2060 /**
2061 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2062 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2063 */
2064 bool isDisallowDrop = true;
2065 ASSERT_TRUE(isDisallowDrop);
2066 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2067 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2068 ASSERT_TRUE(isDisallowDropForcedly);
2069
2070 /**
2071 * @tc.steps: step5. ReportingSupported is set to false.
2072 * @tc.expected: reportingEnabledFalse is false.
2073 */
2074 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2075 }
2076
2077 /**
2078 * @tc.name: FrameNodeDropTestNg043
2079 * @tc.desc: Test frame node method
2080 * @tc.type: FUNC
2081 */
2082 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg043, TestSize.Level1)
2083 {
2084 /**
2085 * @tc.steps: step1. construct a DragDropManager.
2086 * @tc.expected: dragDropManager is not null.
2087 */
2088 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2089 ASSERT_NE(dragDropManager, nullptr);
2090
2091 /**
2092 * @tc.steps: step2. construct frameNode and update the properties.
2093 * @tc.expected: frameNode is not null.
2094 */
2095 const std::string allowTag(NODE_TAG_SPOT);
2096 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2097 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2098 ASSERT_NE(frameNode, nullptr);
2099 std::set<std::string> allowDrop = { allowTag };
2100 frameNode->SetAllowDrop(allowDrop);
2101 ASSERT_NE(frameNode, nullptr);
2102
2103 /**
2104 * @tc.steps: step3. construct summaryMap for dragDropManager.
2105 * @tc.expected: dragDropManager is not null.
2106 */
2107 const std::string summary_TAG(NODE_TAG_EMPTY);
2108 dragDropManager->summaryMap_.clear();
2109 ASSERT_NE(dragDropManager, nullptr);
2110
2111 /**
2112 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2113 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2114 */
2115 bool isDisallowDrop = true;
2116 ASSERT_TRUE(isDisallowDrop);
2117 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2118 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2119 ASSERT_TRUE(isDisallowDropForcedly);
2120
2121 /**
2122 * @tc.steps: step5. ReportingSupported is set to false.
2123 * @tc.expected: reportingEnabledFalse is false.
2124 */
2125 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2126 }
2127
2128 /**
2129 * @tc.name: FrameNodeDropTestNg044
2130 * @tc.desc: Test frame node method
2131 * @tc.type: FUNC
2132 */
2133 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg044, TestSize.Level1)
2134 {
2135 /**
2136 * @tc.steps: step1. construct a DragDropManager.
2137 * @tc.expected: dragDropManager is not null.
2138 */
2139 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2140 ASSERT_NE(dragDropManager, nullptr);
2141
2142 /**
2143 * @tc.steps: step2. construct frameNode and update the properties.
2144 * @tc.expected: frameNode is not null.
2145 */
2146 const std::string allowTag(NODE_TAG_ONE);
2147 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2148 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2149 ASSERT_NE(frameNode, nullptr);
2150 std::set<std::string> allowDrop = { allowTag };
2151 frameNode->SetAllowDrop(allowDrop);
2152 ASSERT_NE(frameNode, nullptr);
2153
2154 /**
2155 * @tc.steps: step3. construct summaryMap for dragDropManager.
2156 * @tc.expected: dragDropManager is not null.
2157 */
2158 const std::string summary_TAG(NODE_TAG_EMPTY);
2159 dragDropManager->summaryMap_.clear();
2160 ASSERT_NE(dragDropManager, nullptr);
2161
2162 /**
2163 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2164 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2165 */
2166 bool isDisallowDrop = true;
2167 ASSERT_TRUE(isDisallowDrop);
2168 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2169 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2170 ASSERT_TRUE(isDisallowDropForcedly);
2171
2172 /**
2173 * @tc.steps: step5. ReportingSupported is set to false.
2174 * @tc.expected: reportingEnabledFalse is false.
2175 */
2176 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2177 }
2178
2179 /**
2180 * @tc.name: FrameNodeDropTestNg045
2181 * @tc.desc: Test frame node method
2182 * @tc.type: FUNC
2183 */
2184 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg045, TestSize.Level1)
2185 {
2186 /**
2187 * @tc.steps: step1. construct a DragDropManager.
2188 * @tc.expected: dragDropManager is not null.
2189 */
2190 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2191 ASSERT_NE(dragDropManager, nullptr);
2192
2193 /**
2194 * @tc.steps: step2. construct frameNode and update the properties.
2195 * @tc.expected: frameNode is not null.
2196 */
2197 const std::string allowTag(NODE_TAG_A);
2198 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2199 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2200 ASSERT_NE(frameNode, nullptr);
2201 std::set<std::string> allowDrop = { allowTag };
2202 frameNode->SetAllowDrop(allowDrop);
2203 ASSERT_NE(frameNode, nullptr);
2204
2205 /**
2206 * @tc.steps: step3. construct summaryMap for dragDropManager.
2207 * @tc.expected: dragDropManager is not null.
2208 */
2209 const std::string summary_TAG(NODE_TAG_EMPTY);
2210 dragDropManager->summaryMap_.clear();
2211 ASSERT_NE(dragDropManager, nullptr);
2212
2213 /**
2214 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2215 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2216 */
2217 bool isDisallowDrop = true;
2218 ASSERT_TRUE(isDisallowDrop);
2219 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2220 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2221 ASSERT_TRUE(isDisallowDropForcedly);
2222
2223 /**
2224 * @tc.steps: step5. ReportingSupported is set to false.
2225 * @tc.expected: reportingEnabledFalse is false.
2226 */
2227 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2228 }
2229
2230 /**
2231 * @tc.name: FrameNodeDropTestNg046
2232 * @tc.desc: Test frame node method
2233 * @tc.type: FUNC
2234 */
2235 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg046, TestSize.Level1)
2236 {
2237 /**
2238 * @tc.steps: step1. construct a DragDropManager.
2239 * @tc.expected: dragDropManager is not null.
2240 */
2241 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2242 ASSERT_NE(dragDropManager, nullptr);
2243
2244 /**
2245 * @tc.steps: step2. construct frameNode and update the properties.
2246 * @tc.expected: frameNode is not null.
2247 */
2248 const std::string allowTag(NODE_TAG_EMPTY);
2249 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2250 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2251 ASSERT_NE(frameNode, nullptr);
2252 std::set<std::string> allowDrop = { allowTag };
2253 frameNode->SetAllowDrop(allowDrop);
2254 ASSERT_NE(frameNode, nullptr);
2255
2256 /**
2257 * @tc.steps: step3. construct summaryMap for dragDropManager.
2258 * @tc.expected: dragDropManager is not null.
2259 */
2260 const std::string summary_TAG(NODE_TAG_EMPTY);
2261 dragDropManager->summaryMap_.clear();
2262 dragDropManager->summaryMap_.insert(make_pair(summary_TAG, frameNodeNullId));
2263 ASSERT_NE(dragDropManager, nullptr);
2264
2265 /**
2266 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2267 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2268 */
2269 bool isDisallowDrop = false;
2270 ASSERT_FALSE(isDisallowDrop);
2271 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2272 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2273 ASSERT_FALSE(isDisallowDropForcedly);
2274
2275 /**
2276 * @tc.steps: step5. ReportingSupported is set to false.
2277 * @tc.expected: reportingEnabledFalse is false.
2278 */
2279 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
2280 }
2281
2282 /**
2283 * @tc.name: FrameNodeDropTestNg047
2284 * @tc.desc: Test frame node method
2285 * @tc.type: FUNC
2286 */
2287 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg047, TestSize.Level1)
2288 {
2289 /**
2290 * @tc.steps: step1. construct a DragDropManager.
2291 * @tc.expected: dragDropManager is not null.
2292 */
2293 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2294 ASSERT_NE(dragDropManager, nullptr);
2295
2296 /**
2297 * @tc.steps: step2. construct frameNode and update the properties.
2298 * @tc.expected: frameNode is not null.
2299 */
2300 const std::string allowTag(NODE_TAG_EMPTY);
2301 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2302 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2303 ASSERT_NE(frameNode, nullptr);
2304 std::set<std::string> allowDrop = { allowTag };
2305 frameNode->SetAllowDrop(allowDrop);
2306 ASSERT_NE(frameNode, nullptr);
2307
2308 /**
2309 * @tc.steps: step3. construct summaryMap for dragDropManager.
2310 * @tc.expected: dragDropManager is not null.
2311 */
2312 const std::string summary_TAG(NODE_TAG_EMPTY);
2313 dragDropManager->summaryMap_.clear();
2314 ASSERT_NE(dragDropManager, nullptr);
2315
2316 /**
2317 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2318 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2319 */
2320 bool isDisallowDrop = true;
2321 ASSERT_TRUE(isDisallowDrop);
2322 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2323 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2324 ASSERT_TRUE(isDisallowDropForcedly);
2325
2326 /**
2327 * @tc.steps: step5. ReportingSupported is set to false.
2328 * @tc.expected: reportingEnabledFalse is false.
2329 */
2330 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2331 }
2332
2333 /**
2334 * @tc.name: FrameNodeDropTestNg048
2335 * @tc.desc: Test frame node method
2336 * @tc.type: FUNC
2337 */
2338 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg048, TestSize.Level1)
2339 {
2340 /**
2341 * @tc.steps: step1. construct a DragDropManager.
2342 * @tc.expected: dragDropManager is not null.
2343 */
2344 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2345 ASSERT_NE(dragDropManager, nullptr);
2346
2347 /**
2348 * @tc.steps: step2. construct frameNode and update the properties.
2349 * @tc.expected: frameNode is not null.
2350 */
2351 const std::string allowTag(NODE_TAG_SPOT);
2352 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2353 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2354 ASSERT_NE(frameNode, nullptr);
2355 std::set<std::string> allowDrop = { allowTag };
2356 frameNode->SetAllowDrop(allowDrop);
2357 ASSERT_NE(frameNode, nullptr);
2358
2359 /**
2360 * @tc.steps: step3. construct summaryMap for dragDropManager.
2361 * @tc.expected: dragDropManager is not null.
2362 */
2363 const std::string summary_TAG(NODE_TAG_EMPTY);
2364 dragDropManager->summaryMap_.clear();
2365 ASSERT_NE(dragDropManager, nullptr);
2366
2367 /**
2368 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2369 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2370 */
2371 bool isDisallowDrop = false;
2372 ASSERT_FALSE(isDisallowDrop);
2373 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2374 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2375 ASSERT_FALSE(isDisallowDropForcedly);
2376
2377 /**
2378 * @tc.steps: step5. ReportingSupported is set to false.
2379 * @tc.expected: reportingEnabledFalse is false.
2380 */
2381 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
2382 }
2383
2384 /**
2385 * @tc.name: FrameNodeDropTestNg049
2386 * @tc.desc: Test frame node method
2387 * @tc.type: FUNC
2388 */
2389 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg049, TestSize.Level1)
2390 {
2391 /**
2392 * @tc.steps: step1. construct a DragDropManager.
2393 * @tc.expected: dragDropManager is not null.
2394 */
2395 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2396 ASSERT_NE(dragDropManager, nullptr);
2397
2398 /**
2399 * @tc.steps: step2. construct frameNode and update the properties.
2400 * @tc.expected: frameNode is not null.
2401 */
2402 const std::string allowTag(NODE_TAG_ONE);
2403 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2404 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2405 ASSERT_NE(frameNode, nullptr);
2406 std::set<std::string> allowDrop = { allowTag };
2407 frameNode->SetAllowDrop(allowDrop);
2408 ASSERT_NE(frameNode, nullptr);
2409
2410 /**
2411 * @tc.steps: step3. construct summaryMap for dragDropManager.
2412 * @tc.expected: dragDropManager is not null.
2413 */
2414 const std::string summary_TAG(NODE_TAG_EMPTY);
2415 dragDropManager->summaryMap_.clear();
2416 ASSERT_NE(dragDropManager, nullptr);
2417
2418 /**
2419 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2420 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2421 */
2422 bool isDisallowDrop = false;
2423 ASSERT_FALSE(isDisallowDrop);
2424 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2425 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2426 ASSERT_FALSE(isDisallowDropForcedly);
2427
2428 /**
2429 * @tc.steps: step5. ReportingSupported is set to false.
2430 * @tc.expected: reportingEnabledFalse is false.
2431 */
2432 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
2433 }
2434
2435 /**
2436 * @tc.name: FrameNodeDropTestNg050
2437 * @tc.desc: Test frame node method
2438 * @tc.type: FUNC
2439 */
2440 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg050, TestSize.Level1)
2441 {
2442 /**
2443 * @tc.steps: step1. construct a DragDropManager.
2444 * @tc.expected: dragDropManager is not null.
2445 */
2446 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2447 ASSERT_NE(dragDropManager, nullptr);
2448
2449 /**
2450 * @tc.steps: step2. construct frameNode and update the properties.
2451 * @tc.expected: frameNode is not null.
2452 */
2453 const std::string allowTag(NODE_TAG_A);
2454 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2455 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2456 ASSERT_NE(frameNode, nullptr);
2457 std::set<std::string> allowDrop = { allowTag };
2458 frameNode->SetAllowDrop(allowDrop);
2459 ASSERT_NE(frameNode, nullptr);
2460
2461 /**
2462 * @tc.steps: step3. construct summaryMap for dragDropManager.
2463 * @tc.expected: dragDropManager is not null.
2464 */
2465 const std::string summary_TAG(NODE_TAG_EMPTY);
2466 dragDropManager->summaryMap_.clear();
2467 ASSERT_NE(dragDropManager, nullptr);
2468
2469 /**
2470 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2471 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2472 */
2473 bool isDisallowDrop = false;
2474 ASSERT_FALSE(isDisallowDrop);
2475 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2476 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2477 ASSERT_FALSE(isDisallowDropForcedly);
2478
2479 /**
2480 * @tc.steps: step5. ReportingSupported is set to false.
2481 * @tc.expected: reportingEnabledFalse is false.
2482 */
2483 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
2484 }
2485
2486 /**
2487 * @tc.name: FrameNodeDropTestNg051
2488 * @tc.desc: Test frame node method
2489 * @tc.type: FUNC
2490 */
2491 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg051, TestSize.Level1)
2492 {
2493 /**
2494 * @tc.steps: step1. construct a DragDropManager.
2495 * @tc.expected: dragDropManager is not null.
2496 */
2497 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2498 ASSERT_NE(dragDropManager, nullptr);
2499
2500 /**
2501 * @tc.steps: step2. construct frameNode and update the properties.
2502 * @tc.expected: frameNode is not null.
2503 */
2504 const std::string allowTag(NODE_TAG_EMPTY);
2505 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2506 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2507 ASSERT_NE(frameNode, nullptr);
2508 std::set<std::string> allowDrop = { allowTag };
2509 frameNode->SetAllowDrop(allowDrop);
2510 ASSERT_NE(frameNode, nullptr);
2511
2512 /**
2513 * @tc.steps: step3. construct summaryMap for dragDropManager.
2514 * @tc.expected: dragDropManager is not null.
2515 */
2516 const std::string summary_TAG(NODE_TAG_EMPTY);
2517 dragDropManager->summaryMap_.clear();
2518 ASSERT_NE(dragDropManager, nullptr);
2519
2520 /**
2521 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2522 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2523 */
2524 bool isDisallowDrop = false;
2525 ASSERT_FALSE(isDisallowDrop);
2526 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2527 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2528 ASSERT_FALSE(isDisallowDropForcedly);
2529
2530 /**
2531 * @tc.steps: step5. ReportingSupported is set to false.
2532 * @tc.expected: reportingEnabledFalse is false.
2533 */
2534 ASSERT_TRUE(dragDropManager->IsDropAllowed(frameNode));
2535 }
2536
2537 /**
2538 * @tc.name: FrameNodeDropTestNg048
2539 * @tc.desc: Test frame node method
2540 * @tc.type: FUNC
2541 */
2542 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg052, TestSize.Level1)
2543 {
2544 /**
2545 * @tc.steps: step1. construct a DragDropManager.
2546 * @tc.expected: dragDropManager is not null.
2547 */
2548 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2549 ASSERT_NE(dragDropManager, nullptr);
2550
2551 /**
2552 * @tc.steps: step2. construct frameNode and update the properties.
2553 * @tc.expected: frameNode is not null.
2554 */
2555 const std::string allowTag(NODE_TAG_SPOT);
2556 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2557 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2558 ASSERT_NE(frameNode, nullptr);
2559 std::set<std::string> allowDrop = { allowTag };
2560 frameNode->SetAllowDrop(allowDrop);
2561 ASSERT_NE(frameNode, nullptr);
2562
2563 /**
2564 * @tc.steps: step3. construct summaryMap for dragDropManager.
2565 * @tc.expected: dragDropManager is not null.
2566 */
2567 const std::string summary_TAG(NODE_TAG_EMPTY);
2568 dragDropManager->summaryMap_.clear();
2569 ASSERT_NE(dragDropManager, nullptr);
2570
2571 /**
2572 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2573 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2574 */
2575 bool isDisallowDrop = true;
2576 ASSERT_TRUE(isDisallowDrop);
2577 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2578 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2579 ASSERT_TRUE(isDisallowDropForcedly);
2580
2581 /**
2582 * @tc.steps: step5. ReportingSupported is set to false.
2583 * @tc.expected: reportingEnabledFalse is false.
2584 */
2585 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2586 }
2587
2588 /**
2589 * @tc.name: FrameNodeDropTestNg049
2590 * @tc.desc: Test frame node method
2591 * @tc.type: FUNC
2592 */
2593 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg053, TestSize.Level1)
2594 {
2595 /**
2596 * @tc.steps: step1. construct a DragDropManager.
2597 * @tc.expected: dragDropManager is not null.
2598 */
2599 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2600 ASSERT_NE(dragDropManager, nullptr);
2601
2602 /**
2603 * @tc.steps: step2. construct frameNode and update the properties.
2604 * @tc.expected: frameNode is not null.
2605 */
2606 const std::string allowTag(NODE_TAG_ONE);
2607 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2608 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2609 ASSERT_NE(frameNode, nullptr);
2610 std::set<std::string> allowDrop = { allowTag };
2611 frameNode->SetAllowDrop(allowDrop);
2612 ASSERT_NE(frameNode, nullptr);
2613
2614 /**
2615 * @tc.steps: step3. construct summaryMap for dragDropManager.
2616 * @tc.expected: dragDropManager is not null.
2617 */
2618 const std::string summary_TAG(NODE_TAG_EMPTY);
2619 dragDropManager->summaryMap_.clear();
2620 ASSERT_NE(dragDropManager, nullptr);
2621
2622 /**
2623 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2624 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2625 */
2626 bool isDisallowDrop = true;
2627 ASSERT_TRUE(isDisallowDrop);
2628 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2629 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2630 ASSERT_TRUE(isDisallowDropForcedly);
2631
2632 /**
2633 * @tc.steps: step5. ReportingSupported is set to false.
2634 * @tc.expected: reportingEnabledFalse is false.
2635 */
2636 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2637 }
2638
2639 /**
2640 * @tc.name: FrameNodeDropTestNg050
2641 * @tc.desc: Test frame node method
2642 * @tc.type: FUNC
2643 */
2644 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg054, TestSize.Level1)
2645 {
2646 /**
2647 * @tc.steps: step1. construct a DragDropManager.
2648 * @tc.expected: dragDropManager is not null.
2649 */
2650 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2651 ASSERT_NE(dragDropManager, nullptr);
2652
2653 /**
2654 * @tc.steps: step2. construct frameNode and update the properties.
2655 * @tc.expected: frameNode is not null.
2656 */
2657 const std::string allowTag(NODE_TAG_A);
2658 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2659 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2660 ASSERT_NE(frameNode, nullptr);
2661 std::set<std::string> allowDrop = { allowTag };
2662 frameNode->SetAllowDrop(allowDrop);
2663 ASSERT_NE(frameNode, nullptr);
2664
2665 /**
2666 * @tc.steps: step3. construct summaryMap for dragDropManager.
2667 * @tc.expected: dragDropManager is not null.
2668 */
2669 const std::string summary_TAG(NODE_TAG_EMPTY);
2670 dragDropManager->summaryMap_.clear();
2671 ASSERT_NE(dragDropManager, nullptr);
2672
2673 /**
2674 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2675 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2676 */
2677 bool isDisallowDrop = true;
2678 ASSERT_TRUE(isDisallowDrop);
2679 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2680 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2681 ASSERT_TRUE(isDisallowDropForcedly);
2682
2683 /**
2684 * @tc.steps: step5. ReportingSupported is set to false.
2685 * @tc.expected: reportingEnabledFalse is false.
2686 */
2687 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2688 }
2689
2690 /**
2691 * @tc.name: FrameNodeDropTestNg051
2692 * @tc.desc: Test frame node method
2693 * @tc.type: FUNC
2694 */
2695 HWTEST_F(FrameNodeDropTestNg, FrameNodeDropTestNg055, TestSize.Level1)
2696 {
2697 /**
2698 * @tc.steps: step1. construct a DragDropManager.
2699 * @tc.expected: dragDropManager is not null.
2700 */
2701 auto dragDropManager = AceType::MakeRefPtr<DragDropManager>();
2702 ASSERT_NE(dragDropManager, nullptr);
2703
2704 /**
2705 * @tc.steps: step2. construct frameNode and update the properties.
2706 * @tc.expected: frameNode is not null.
2707 */
2708 const std::string allowTag(NODE_TAG_EMPTY);
2709 auto frameNodeNullId = ElementRegister::GetInstance()->MakeUniqueId();
2710 auto frameNode = AceType::MakeRefPtr<FrameNode>(allowTag, frameNodeNullId, AceType::MakeRefPtr<Pattern>());
2711 ASSERT_NE(frameNode, nullptr);
2712 std::set<std::string> allowDrop = { allowTag };
2713 frameNode->SetAllowDrop(allowDrop);
2714 ASSERT_NE(frameNode, nullptr);
2715
2716 /**
2717 * @tc.steps: step3. construct summaryMap for dragDropManager.
2718 * @tc.expected: dragDropManager is not null.
2719 */
2720 const std::string summary_TAG(NODE_TAG_EMPTY);
2721 dragDropManager->summaryMap_.clear();
2722 ASSERT_NE(dragDropManager, nullptr);
2723
2724 /**
2725 * @tc.steps: step4. Set an isDisallowDropForcedly in the frameNode and then get an isDisallowDropForcedly.
2726 * @tc.expected: The set isDisallowDropForcedly is the same as the get isDisallowDropForcedly.
2727 */
2728 bool isDisallowDrop = true;
2729 ASSERT_TRUE(isDisallowDrop);
2730 frameNode->SetDisallowDropForcedly(isDisallowDrop);
2731 bool isDisallowDropForcedly = frameNode->GetDisallowDropForcedly();
2732 ASSERT_TRUE(isDisallowDropForcedly);
2733
2734 /**
2735 * @tc.steps: step5. ReportingSupported is set to false.
2736 * @tc.expected: reportingEnabledFalse is false.
2737 */
2738 ASSERT_FALSE(dragDropManager->IsDropAllowed(frameNode));
2739 }
2740 } // namespace OHOS::Ace::NG