1 /*
2 * Copyright (c) 2023 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 <gtest/gtest.h>
17 #include "window_session_property.h"
18
19 using namespace testing;
20 using namespace testing::ext;
21
22 namespace OHOS {
23 namespace Rosen {
24
25 class WindowSessionPropertyTest : public testing::Test {
26 public:
27 static void SetUpTestCase();
28 static void TearDownTestCase();
29 };
30
SetUpTestCase()31 void WindowSessionPropertyTest::SetUpTestCase()
32 {
33 }
34
TearDownTestCase()35 void WindowSessionPropertyTest::TearDownTestCase()
36 {
37 }
38
39 namespace {
40 /**
41 * @tc.name: SetDragEnabled001
42 * @tc.desc: SetDragEnabled and GetDragEnabled to check the value
43 * @tc.type: FUNC
44 */
45 HWTEST_F(WindowSessionPropertyTest, SetDragEnabled001, Function | SmallTest | Level2)
46 {
47 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
48 ASSERT_NE(nullptr, property);
49 property->SetDragEnabled(true);
50 ASSERT_EQ(property->GetDragEnabled(), true);
51 property->SetDragEnabled(false);
52 ASSERT_EQ(property->GetDragEnabled(), false);
53 }
54
55 /**
56 * @tc.name: SetRaiseEnabled001
57 * @tc.desc: SetRaiseEnabled and GetRaiseEnabled to check the value
58 * @tc.type: FUNC
59 */
60 HWTEST_F(WindowSessionPropertyTest, SetRaiseEnabled001, Function | SmallTest | Level2)
61 {
62 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
63 ASSERT_NE(nullptr, property);
64 property->SetRaiseEnabled(true);
65 ASSERT_EQ(property->GetRaiseEnabled(), true);
66 property->SetRaiseEnabled(false);
67 ASSERT_EQ(property->GetRaiseEnabled(), false);
68 }
69
70 /**
71 * @tc.name: WindowSessionProperty
72 * @tc.desc: WindowSessionProperty
73 * @tc.type: FUNC
74 */
75 HWTEST_F(WindowSessionPropertyTest, WindowSessionProperty, Function | SmallTest | Level2)
76 {
77 const sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
78 ASSERT_NE(nullptr, property);
79 sptr<WindowSessionProperty> targetProperty = sptr<WindowSessionProperty>::MakeSptr(property);
80 ASSERT_NE(nullptr, targetProperty);
81 ASSERT_EQ(property->GetDragEnabled(), targetProperty->GetDragEnabled());
82 }
83
84 /**
85 * @tc.name: SetSessionInfo
86 * @tc.desc: SetSessionInfo
87 * @tc.type: FUNC
88 */
89 HWTEST_F(WindowSessionPropertyTest, SetSessionInfo, Function | SmallTest | Level2)
90 {
91 SessionInfo* info = new SessionInfo();
92 ASSERT_NE(nullptr, info);
93 info->bundleName_ = "test";
94 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
95 ASSERT_NE(nullptr, property);
96 property->SetSessionInfo(*info);
97 auto result = property->GetSessionInfo();
98 ASSERT_EQ(result.bundleName_, info->bundleName_);
99 delete info;
100 }
101
102 /**
103 * @tc.name: SetRequestedOrientation
104 * @tc.desc: SetRequestedOrientation test
105 * @tc.type: FUNC
106 */
107 HWTEST_F(WindowSessionPropertyTest, SetRequestedOrientation, Function | SmallTest | Level2)
108 {
109 Orientation orientation = Orientation::REVERSE_HORIZONTAL;
110 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
111 ASSERT_NE(nullptr, property);
112 property->SetRequestedOrientation(orientation);
113 Orientation ret = property->GetRequestedOrientation();
114 ASSERT_EQ(ret, orientation);
115
116 property->SetRequestedOrientation(Orientation::AUTO_ROTATION_UNSPECIFIED);
117 Orientation ret1 = property->GetRequestedOrientation();
118 ASSERT_EQ(ret1, Orientation::AUTO_ROTATION_UNSPECIFIED);
119
120 property->SetRequestedOrientation(Orientation::USER_ROTATION_PORTRAIT);
121 Orientation ret2 = property->GetRequestedOrientation();
122 ASSERT_EQ(ret2, Orientation::USER_ROTATION_PORTRAIT);
123
124 property->SetRequestedOrientation(Orientation::USER_ROTATION_LANDSCAPE);
125 Orientation ret3 = property->GetRequestedOrientation();
126 ASSERT_EQ(ret3, Orientation::USER_ROTATION_LANDSCAPE);
127
128 property->SetRequestedOrientation(Orientation::USER_ROTATION_PORTRAIT_INVERTED);
129 Orientation ret4 = property->GetRequestedOrientation();
130 ASSERT_EQ(ret4, Orientation::USER_ROTATION_PORTRAIT_INVERTED);
131
132 property->SetRequestedOrientation(Orientation::USER_ROTATION_LANDSCAPE_INVERTED);
133 Orientation ret5 = property->GetRequestedOrientation();
134 ASSERT_EQ(ret5, Orientation::USER_ROTATION_LANDSCAPE_INVERTED);
135
136 property->SetRequestedOrientation(Orientation::FOLLOW_DESKTOP);
137 Orientation ret6 = property->GetRequestedOrientation();
138 ASSERT_EQ(ret6, Orientation::FOLLOW_DESKTOP);
139 }
140
141 /**
142 * @tc.name: SetDefaultRequestedOrientation
143 * @tc.desc: SetDefaultRequestedOrientation test
144 * @tc.type: FUNC
145 */
146 HWTEST_F(WindowSessionPropertyTest, SetDefaultRequestedOrientation, Function | SmallTest | Level2)
147 {
148 Orientation orientation = Orientation::REVERSE_HORIZONTAL;
149 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
150 ASSERT_NE(nullptr, property);
151 property->SetDefaultRequestedOrientation(orientation);
152 Orientation ret = property->GetDefaultRequestedOrientation();
153 ASSERT_EQ(ret, orientation);
154 }
155
156 /**
157 * @tc.name: SetPrivacyMode
158 * @tc.desc: SetPrivacyMode as true and false
159 * @tc.type: FUNC
160 */
161 HWTEST_F(WindowSessionPropertyTest, SetPrivacyMode, Function | SmallTest | Level2)
162 {
163 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
164 ASSERT_NE(nullptr, property);
165 ASSERT_EQ(property->GetPrivacyMode(), false);
166 property->SetPrivacyMode(true);
167 ASSERT_EQ(property->GetPrivacyMode(), true);
168 property->SetPrivacyMode(false);
169 ASSERT_EQ(property->GetPrivacyMode(), false);
170 }
171
172 /**
173 * @tc.name: SetSystemPrivacyMode
174 * @tc.desc: SetSystemPrivacyMode test
175 * @tc.type: FUNC
176 */
177 HWTEST_F(WindowSessionPropertyTest, SetSystemPrivacyMode, Function | SmallTest | Level2)
178 {
179 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
180 ASSERT_NE(nullptr, property);
181 property->SetSystemPrivacyMode(false);
182 ASSERT_EQ(property->GetSystemPrivacyMode(), false);
183 property->SetSystemPrivacyMode(true);
184 ASSERT_EQ(property->GetSystemPrivacyMode(), true);
185 }
186
187 /**
188 * @tc.name: SetBrightness
189 * @tc.desc: SetBrightness test
190 * @tc.type: FUNC
191 */
192 HWTEST_F(WindowSessionPropertyTest, SetBrightness, Function | SmallTest | Level2)
193 {
194 float brightness = 0.02;
195 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
196 ASSERT_NE(nullptr, property);
197 property->SetBrightness(brightness);
198 ASSERT_EQ(brightness, property->GetBrightness());
199 }
200
201 /**
202 * @tc.name: SetTopmost
203 * @tc.desc: SetTopmost test
204 * @tc.type: FUNC
205 */
206 HWTEST_F(WindowSessionPropertyTest, SetTopmost, Function | SmallTest | Level2)
207 {
208 bool topmost = true;
209 WindowSessionProperty windowSessionProperty;
210 windowSessionProperty.SetTopmost(topmost);
211 ASSERT_TRUE(windowSessionProperty.IsTopmost());
212 }
213
214 /**
215 * @tc.name: SetMainWindowTopmost
216 * @tc.desc: SetMainWindowTopmost test
217 * @tc.type: FUNC
218 */
219 HWTEST_F(WindowSessionPropertyTest, SetMainWindowTopmost, Function | SmallTest | Level2)
220 {
221 bool isTopmost = true;
222 WindowSessionProperty windowSessionProperty;
223 windowSessionProperty.SetMainWindowTopmost(isTopmost);
224 ASSERT_TRUE(windowSessionProperty.IsMainWindowTopmost());
225 }
226
227 /**
228 * @tc.name: GetParentId
229 * @tc.desc: GetParentId test
230 * @tc.type: FUNC
231 */
232 HWTEST_F(WindowSessionPropertyTest, GetParentId, Function | SmallTest | Level2)
233 {
234 WindowSessionProperty windowSessionProperty;
235 windowSessionProperty.SetParentId(0);
236 int32_t result = windowSessionProperty.GetParentId();
237 ASSERT_EQ(0, result);
238 }
239
240 /**
241 * @tc.name: SetWindowFlags
242 * @tc.desc: SetWindowFlags test
243 * @tc.type: FUNC
244 */
245 HWTEST_F(WindowSessionPropertyTest, SetWindowFlags, Function | SmallTest | Level2)
246 {
247 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
248 ASSERT_NE(nullptr, property);
249 property->SetWindowFlags(0);
250 ASSERT_EQ(property->GetWindowFlags(), 0);
251 }
252
253 /**
254 * @tc.name: SetAndGetPipTemplateInfo
255 * @tc.desc: SetAndGetPipTemplateInfo test
256 * @tc.type: FUNC
257 */
258 HWTEST_F(WindowSessionPropertyTest, SetAndGetPipTemplateInfo, Function | SmallTest | Level2)
259 {
260 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
261 ASSERT_NE(nullptr, property);
262 PiPTemplateInfo pipTemplateInfo;
263 pipTemplateInfo.pipTemplateType = static_cast<uint32_t>(PiPTemplateType::VIDEO_CALL);
264 property->SetPiPTemplateInfo(pipTemplateInfo);
265 ASSERT_EQ(property->GetPiPTemplateInfo().pipTemplateType,
266 static_cast<uint32_t>(PiPTemplateType::VIDEO_CALL));
267 }
268
269 /**
270 * @tc.name: SetAndGetRealParentId
271 * @tc.desc: SetRealParentId and GetRealParentId test
272 * @tc.type: FUNC
273 */
274 HWTEST_F(WindowSessionPropertyTest, SetAndGetRealParentId, Function | SmallTest | Level2)
275 {
276 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
277 ASSERT_NE(property, nullptr);
278 property->SetRealParentId(1919);
279 EXPECT_EQ(1919, property->GetRealParentId());
280 property->SetRealParentId(810);
281 EXPECT_EQ(810, property->GetRealParentId());
282 }
283
284 /**
285 * @tc.name: SetAndGetUIExtensionUsage
286 * @tc.desc: SetUIExtensionUsage and GetUIExtensionUsage test
287 * @tc.type: FUNC
288 */
289 HWTEST_F(WindowSessionPropertyTest, SetAndGetUIExtensionUsage, Function | SmallTest | Level2)
290 {
291 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
292 ASSERT_NE(property, nullptr);
293 property->SetUIExtensionUsage(UIExtensionUsage::MODAL);
294 EXPECT_EQ(UIExtensionUsage::MODAL, property->GetUIExtensionUsage());
295 property->SetUIExtensionUsage(UIExtensionUsage::EMBEDDED);
296 EXPECT_EQ(UIExtensionUsage::EMBEDDED, property->GetUIExtensionUsage());
297 }
298
299 /**
300 * @tc.name: SetParentWindowType
301 * @tc.desc: SetParentWindowType and GetParentWindowType test
302 * @tc.type: FUNC
303 */
304 HWTEST_F(WindowSessionPropertyTest, SetParentWindowType, Function | SmallTest | Level2)
305 {
306 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
307 ASSERT_NE(property, nullptr);
308 property->SetParentWindowType(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW);
309 EXPECT_EQ(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW, property->GetParentWindowType());
310 property->SetParentWindowType(WindowType::WINDOW_TYPE_TOAST);
311 EXPECT_EQ(WindowType::WINDOW_TYPE_TOAST, property->GetParentWindowType());
312 }
313
314 /**
315 * @tc.name: SetAndGetIsUIExtensionAbilityProcess
316 * @tc.desc: SetIsUIExtensionAbilityProcess and GetIsUIExtensionAbilityProcess test
317 * @tc.type: FUNC
318 */
319 HWTEST_F(WindowSessionPropertyTest, SetAndGetIsUIExtensionAbilityProcess, Function | SmallTest | Level2)
320 {
321 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
322 ASSERT_NE(property, nullptr);
323 property->SetIsUIExtensionAbilityProcess(true);
324 EXPECT_EQ(true, property->GetIsUIExtensionAbilityProcess());
325 property->SetIsUIExtensionAbilityProcess(false);
326 EXPECT_EQ(false, property->GetIsUIExtensionAbilityProcess());
327 }
328
329 /**
330 * @tc.name: AddWindowFlag
331 * @tc.desc: AddWindowFlag test
332 * @tc.type: FUNC
333 */
334 HWTEST_F(WindowSessionPropertyTest, AddWindowFlag, Function | SmallTest | Level2)
335 {
336 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
337 ASSERT_NE(nullptr, property);
338 property->AddWindowFlag(WindowFlag::WINDOW_FLAG_NEED_AVOID);
339 uint32_t windowFlags = static_cast<uint32_t>(WindowFlag::WINDOW_FLAG_NEED_AVOID);
340 ASSERT_EQ(property->GetWindowFlags(), windowFlags);
341 property->AddWindowFlag(WindowFlag::WINDOW_FLAG_PARENT_LIMIT);
342 windowFlags |= static_cast<uint32_t>(WindowFlag::WINDOW_FLAG_PARENT_LIMIT);
343 ASSERT_EQ(property->GetWindowFlags(), windowFlags);
344 }
345
346 /**
347 * @tc.name: IsTurnScreenOn
348 * @tc.desc: IsTurnScreenOn test
349 * @tc.type: FUNC
350 */
351 HWTEST_F(WindowSessionPropertyTest, IsTurnScreenOn, Function | SmallTest | Level2)
352 {
353 WindowSessionProperty windowSessionProperty;
354 windowSessionProperty.SetTurnScreenOn(false);
355 bool result = windowSessionProperty.IsTurnScreenOn();
356 ASSERT_EQ(false, result);
357 }
358
359 /**
360 * @tc.name: IsKeepScreenOn
361 * @tc.desc: IsKeepScreenOn test
362 * @tc.type: FUNC
363 */
364 HWTEST_F(WindowSessionPropertyTest, IsKeepScreenOn, Function | SmallTest | Level2)
365 {
366 WindowSessionProperty windowSessionProperty;
367 windowSessionProperty.SetKeepScreenOn(false);
368 bool result = windowSessionProperty.IsKeepScreenOn();
369 ASSERT_EQ(false, result);
370 }
371
372 /**
373 * @tc.name: GetAccessTokenId
374 * @tc.desc: GetAccessTokenId test
375 * @tc.type: FUNC
376 */
377 HWTEST_F(WindowSessionPropertyTest, GetAccessTokenId, Function | SmallTest | Level2)
378 {
379 WindowSessionProperty windowSessionProperty;
380 windowSessionProperty.SetAccessTokenId(false);
381 auto result = windowSessionProperty.GetAccessTokenId();
382 ASSERT_EQ(false, result);
383 }
384
385 /**
386 * @tc.name: SetTokenState
387 * @tc.desc: SetTokenState test
388 * @tc.type: FUNC
389 */
390 HWTEST_F(WindowSessionPropertyTest, SetTokenState, Function | SmallTest | Level2)
391 {
392 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
393 ASSERT_NE(nullptr, property);
394 property->SetTokenState(false);
395 ASSERT_EQ(property->GetTokenState(), false);
396 property->SetTokenState(true);
397 ASSERT_EQ(property->GetTokenState(), true);
398 }
399
400 /**
401 * @tc.name: SetMaximizeMode
402 * @tc.desc: SetMaximizeMode test
403 * @tc.type: FUNC
404 */
405 HWTEST_F(WindowSessionPropertyTest, SetMaximizeMode, Function | SmallTest | Level2)
406 {
407 WindowSessionProperty windowSessionProperty;
408 MaximizeMode mode = MaximizeMode::MODE_RECOVER;
409 windowSessionProperty.SetMaximizeMode(mode);
410 ASSERT_EQ(windowSessionProperty.GetMaximizeMode(), mode);
411 }
412
413 /**
414 * @tc.name: SetSystemBarProperty
415 * @tc.desc: SetSystemBarProperty test
416 * @tc.type: FUNC
417 */
418 HWTEST_F(WindowSessionPropertyTest, SetSystemBarProperty, Function | SmallTest | Level2)
419 {
420 SystemBarProperty* systemBarProperty = new SystemBarProperty();
421 ASSERT_NE(nullptr, systemBarProperty);
422 WindowType windowType = WindowType::WINDOW_TYPE_STATUS_BAR;
423 WindowSessionProperty windowSessionProperty;
424 windowSessionProperty.SetSystemBarProperty(windowType, *systemBarProperty);
425 auto sysBarPropMap = windowSessionProperty.GetSystemBarProperty();
426 auto sysBarProperty = sysBarPropMap[windowType];
427 ASSERT_EQ(sysBarProperty, *systemBarProperty);
428 delete systemBarProperty;
429 }
430
431 /**
432 * @tc.name: IsDecorEnable
433 * @tc.desc: IsDecorEnable test
434 * @tc.type: FUNC
435 */
436 HWTEST_F(WindowSessionPropertyTest, IsDecorEnable, Function | SmallTest | Level2)
437 {
438 WindowSessionProperty windowSessionProperty;
439 windowSessionProperty.SetDecorEnable(false);
440 auto result = windowSessionProperty.IsDecorEnable();
441 ASSERT_EQ(false, result);
442 }
443
444 /**
445 * @tc.name: SetWindowModeSupportType
446 * @tc.desc: SetWindowModeSupportType test
447 * @tc.type: FUNC
448 */
449 HWTEST_F(WindowSessionPropertyTest, SetWindowModeSupportType, Function | SmallTest | Level2)
450 {
451 uint32_t windowModeSupportType = static_cast<uint32_t>(WindowModeSupport::WINDOW_MODE_SUPPORT_ALL);
452 WindowSessionProperty windowSessionProperty;
453 windowSessionProperty.SetWindowModeSupportType(windowModeSupportType);
454 ASSERT_EQ(windowSessionProperty.GetWindowModeSupportType(), windowModeSupportType);
455 }
456
457 /**
458 * @tc.name: IsFloatingWindowAppType
459 * @tc.desc: IsFloatingWindowAppType test
460 * @tc.type: FUNC
461 */
462 HWTEST_F(WindowSessionPropertyTest, IsFloatingWindowAppType, Function | SmallTest | Level2)
463 {
464 WindowSessionProperty windowSessionProperty;
465 windowSessionProperty.SetFloatingWindowAppType(false);
466 auto result = windowSessionProperty.IsFloatingWindowAppType();
467 ASSERT_EQ(false, result);
468 }
469
470 /**
471 * @tc.name: SetTouchHotAreas
472 * @tc.desc: SetTouchHotAreas test
473 * @tc.type: FUNC
474 */
475 HWTEST_F(WindowSessionPropertyTest, SetTouchHotAreas, Function | SmallTest | Level2)
476 {
477 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
478 Rect rect { 4, 4, 4, 4 };
479 std::vector<Rect> vRect { rect };
480 property->SetPersistentId(0);
481 property->SetSessionPropertyChangeCallback(nullptr);
482 EXPECT_EQ(nullptr, property->touchHotAreasChangeCallback_);
483 property->SetTouchHotAreas(vRect);
484
__anon79ce56780202() 485 auto func = []() {};
486 property->SetPersistentId(1);
487 property->SetSessionPropertyChangeCallback(func);
488 property->SetTouchHotAreas(vRect);
489 EXPECT_NE(nullptr, property->touchHotAreasChangeCallback_);
490
491 Rect rect1 { 5, 5, 5, 5 };
492 vRect.emplace_back(rect1);
493 property->SetTouchHotAreas(vRect);
494 }
495
496 /**
497 * @tc.name: SetKeyboardTouchHotAreas
498 * @tc.desc: SetKeyboardTouchHotAreas test
499 * @tc.type: FUNC
500 */
501 HWTEST_F(WindowSessionPropertyTest, SetKeyboardTouchHotAreas, Function | SmallTest | Level2)
502 {
503 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
504 KeyboardTouchHotAreas hotAreas;
505 Rect rect { 4, 4, 4, 4 };
506 hotAreas.landscapeKeyboardHotAreas_.push_back(rect);
507 hotAreas.landscapePanelHotAreas_.push_back(rect);
508 hotAreas.portraitKeyboardHotAreas_.push_back(rect);
509 hotAreas.portraitPanelHotAreas_.push_back(rect);
510 property->SetPersistentId(0);
511 property->SetSessionPropertyChangeCallback(nullptr);
512 EXPECT_EQ(nullptr, property->touchHotAreasChangeCallback_);
513 property->SetKeyboardTouchHotAreas(hotAreas);
514
__anon79ce56780302() 515 auto func = []() {};
516 property->SetPersistentId(1);
517 property->SetSessionPropertyChangeCallback(func);
518 property->SetKeyboardTouchHotAreas(hotAreas);
519 EXPECT_NE(nullptr, property->touchHotAreasChangeCallback_);
520
521 Rect rect1 { 5, 5, 5, 5 };
522 hotAreas.landscapeKeyboardHotAreas_.push_back(rect1);
523 hotAreas.landscapePanelHotAreas_.push_back(rect1);
524 hotAreas.portraitKeyboardHotAreas_.push_back(rect1);
525 hotAreas.portraitPanelHotAreas_.push_back(rect1);
526 property->SetKeyboardTouchHotAreas(hotAreas);
527 }
528
529 /**
530 * @tc.name: UnmarshallingWindowLimits
531 * @tc.desc: UnmarshallingWindowLimits test
532 * @tc.type: FUNC
533 */
534 HWTEST_F(WindowSessionPropertyTest, UnmarshallingWindowLimits, Function | SmallTest | Level2)
535 {
536 Parcel parcel = Parcel();
537 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
538 ASSERT_NE(nullptr, property);
539 WindowSessionProperty windowSessionProperty;
540 windowSessionProperty.UnmarshallingWindowLimits(parcel, property);
541 }
542
543 /**
544 * @tc.name: UnMarshallingSystemBarMap
545 * @tc.desc: UnMarshallingSystemBarMap test
546 * @tc.type: FUNC
547 */
548 HWTEST_F(WindowSessionPropertyTest, UnMarshallingSystemBarMap, Function | SmallTest | Level2)
549 {
550 Parcel parcel = Parcel();
551 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
552 ASSERT_NE(nullptr, property);
553 WindowSessionProperty windowSessionProperty;
554 windowSessionProperty.MarshallingSystemBarMap(parcel);
555 windowSessionProperty.UnMarshallingSystemBarMap(parcel, property);
556 }
557
558 /**
559 * @tc.name: UnmarshallingTouchHotAreas
560 * @tc.desc: UnmarshallingTouchHotAreas test
561 * @tc.type: FUNC
562 */
563 HWTEST_F(WindowSessionPropertyTest, UnmarshallingTouchHotAreas, Function | SmallTest | Level2)
564 {
565 Parcel parcel;
566 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
567 Rect rect { 4, 4, 4, 4 };
568 std::vector<Rect> vRect { rect };
569 WindowSessionProperty windowSessionProperty;
570 windowSessionProperty.SetTouchHotAreas(vRect);
571 windowSessionProperty.MarshallingTouchHotAreas(parcel);
572 windowSessionProperty.UnmarshallingTouchHotAreas(parcel, property);
573 ASSERT_NE(0, property->touchHotAreas_.size());
574 }
575
576 /**
577 * @tc.name: UnmarshallingKeyboardTouchHotAreas
578 * @tc.desc: UnmarshallingKeyboardTouchHotAreas test
579 * @tc.type: FUNC
580 */
581 HWTEST_F(WindowSessionPropertyTest, UnmarshallingKeyboardTouchHotAreas, Function | SmallTest | Level2)
582 {
583 Parcel parcel;
584 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
585 KeyboardTouchHotAreas hotAreas;
586 Rect rect { 4, 4, 4, 4 };
587 hotAreas.landscapeKeyboardHotAreas_.push_back(rect);
588 hotAreas.landscapePanelHotAreas_.push_back(rect);
589 hotAreas.portraitKeyboardHotAreas_.push_back(rect);
590 hotAreas.portraitPanelHotAreas_.push_back(rect);
591 WindowSessionProperty windowSessionProperty;
592 windowSessionProperty.SetKeyboardTouchHotAreas(hotAreas);
593 windowSessionProperty.MarshallingKeyboardTouchHotAreas(parcel);
594 windowSessionProperty.UnmarshallingKeyboardTouchHotAreas(parcel, property);
595 ASSERT_NE(0, property->keyboardTouchHotAreas_.landscapeKeyboardHotAreas_.size());
596 }
597
598 /**
599 * @tc.name: UnmarshallingPiPTemplateInfo
600 * @tc.desc: UnmarshallingPiPTemplateInfo test
601 * @tc.type: FUNC
602 */
603 HWTEST_F(WindowSessionPropertyTest, UnmarshallingPiPTemplateInfo, Function | SmallTest | Level2)
604 {
605 Parcel parcel = Parcel();
606 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
607 EXPECT_NE(nullptr, property);
608 property->SetWindowType(WindowType::WINDOW_TYPE_PIP);
609 EXPECT_EQ(WindowType::WINDOW_TYPE_PIP, property->GetWindowType());
610 PiPTemplateInfo pipTemplateInfo;
611 pipTemplateInfo.pipTemplateType = static_cast<uint32_t>(PiPTemplateType::VIDEO_CALL);
612 property->SetPiPTemplateInfo(pipTemplateInfo);
613 property->MarshallingPiPTemplateInfo(parcel);
614 property->UnmarshallingPiPTemplateInfo(parcel, property);
615 }
616
617 /**
618 * @tc.name: CopyFrom
619 * @tc.desc: CopyFrom test
620 * @tc.type: FUNC
621 */
622 HWTEST_F(WindowSessionPropertyTest, CopyFrom, Function | SmallTest | Level2)
623 {
624 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
625 EXPECT_NE(nullptr, property);
626 std::string name = "test";
627 property->SetWindowName(name);
628 WindowSessionProperty windowSessionProperty;
629 windowSessionProperty.CopyFrom(property);
630 ASSERT_EQ(windowSessionProperty.GetWindowName(), name);
631 }
632
633 /**
634 * @tc.name: SetFocusable
635 * @tc.desc: SetFocusable and GetFocusable to check the value
636 * @tc.type: FUNC
637 */
638 HWTEST_F(WindowSessionPropertyTest, SetFocusable, Function | SmallTest | Level2)
639 {
640 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
641 ASSERT_NE(nullptr, property);
642 property->SetFocusable(true);
643 ASSERT_EQ(property->GetFocusable(), true);
644 property->SetFocusable(false);
645 ASSERT_EQ(property->GetFocusable(), false);
646 }
647
648 /**
649 * @tc.name: SetTouchable
650 * @tc.desc: SetTouchable and GetTouchable to check the value
651 * @tc.type: FUNC
652 */
653 HWTEST_F(WindowSessionPropertyTest, SetTouchable, Function | SmallTest | Level2)
654 {
655 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
656 ASSERT_NE(nullptr, property);
657 property->SetTouchable(true);
658 ASSERT_EQ(property->GetTouchable(), true);
659 property->SetTouchable(false);
660 ASSERT_EQ(property->GetTouchable(), false);
661 }
662
663 /**
664 * @tc.name: SetForceHide
665 * @tc.desc: SetForceHide and GetForceHide to check the value
666 * @tc.type: FUNC
667 */
668 HWTEST_F(WindowSessionPropertyTest, SetForceHide, Function | SmallTest | Level2)
669 {
670 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
671 ASSERT_NE(nullptr, property);
672 property->SetForceHide(false);
673 ASSERT_EQ(property->GetForceHide(), false);
674 property->SetForceHide(true);
675 ASSERT_EQ(property->GetForceHide(), true);
676 }
677
678 /**
679 * @tc.name: SetSystemCalling
680 * @tc.desc: SetSystemCalling and GetSystemCalling to check the value
681 * @tc.type: FUNC
682 */
683 HWTEST_F(WindowSessionPropertyTest, SetSystemCalling, Function | SmallTest | Level2)
684 {
685 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
686 ASSERT_NE(nullptr, property);
687 property->SetSystemCalling(false);
688 ASSERT_EQ(property->GetSystemCalling(), false);
689 property->SetSystemCalling(true);
690 ASSERT_EQ(property->GetSystemCalling(), true);
691 }
692
693 /**
694 * @tc.name: SetIsNeedUpdateWindowMode
695 * @tc.desc: SetIsNeedUpdateWindowMode and GetIsNeedUpdateWindowMode to check the value
696 * @tc.type: FUNC
697 */
698 HWTEST_F(WindowSessionPropertyTest, SetIsNeedUpdateWindowMode, Function | SmallTest | Level2)
699 {
700 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
701 ASSERT_NE(nullptr, property);
702 property->SetIsNeedUpdateWindowMode(false);
703 ASSERT_EQ(property->GetIsNeedUpdateWindowMode(), false);
704 property->SetIsNeedUpdateWindowMode(true);
705 ASSERT_EQ(property->GetIsNeedUpdateWindowMode(), true);
706 }
707
708 /**
709 * @tc.name: SetIsShaped
710 * @tc.desc: SetIsShaped and GetIsShaped to check the value
711 * @tc.type: FUNC
712 */
713 HWTEST_F(WindowSessionPropertyTest, SetIsShaped, Function | SmallTest | Level2)
714 {
715 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
716 ASSERT_NE(nullptr, property);
717 property->SetIsShaped(false);
718 ASSERT_EQ(property->GetIsShaped(), false);
719 property->SetIsShaped(true);
720 ASSERT_EQ(property->GetIsShaped(), true);
721 }
722
723 /**
724 * @tc.name: SetCollaboratorType
725 * @tc.desc: SetCollaboratorType and GetCollaboratorType to check the value
726 * @tc.type: FUNC
727 */
728 HWTEST_F(WindowSessionPropertyTest, SetCollaboratorType, Function | SmallTest | Level2)
729 {
730 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
731 ASSERT_NE(nullptr, property);
732 int32_t typeValue = static_cast<int32_t>(CollaboratorType::DEFAULT_TYPE);
733 property->SetCollaboratorType(typeValue);
734 ASSERT_EQ(property->GetCollaboratorType(), typeValue);
735 typeValue = static_cast<int32_t>(CollaboratorType::RESERVE_TYPE);
736 property->SetCollaboratorType(typeValue);
737 ASSERT_EQ(property->GetCollaboratorType(), typeValue);
738 typeValue = static_cast<int32_t>(CollaboratorType::OTHERS_TYPE);
739 property->SetCollaboratorType(typeValue);
740 ASSERT_EQ(property->GetCollaboratorType(), typeValue);
741 }
742
743 /**
744 * @tc.name: SetUserWindowLimits
745 * @tc.desc: SetUserWindowLimits and GetUserWindowLimits to check the value
746 * @tc.type: FUNC
747 */
748 HWTEST_F(WindowSessionPropertyTest, SetUserWindowLimits, Function | SmallTest | Level2)
749 {
750 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
751 ASSERT_NE(nullptr, property);
752 WindowLimits limits;
753 limits.minWidth_ = 10;
754 property->SetUserWindowLimits(limits);
755 WindowLimits result = property->GetUserWindowLimits();
756 ASSERT_EQ(result.minWidth_, limits.minWidth_);
757 }
758
759 /**
760 * @tc.name: SetConfigWindowLimitsVP
761 * @tc.desc: SetConfigWindowLimitsVP and GetConfigWindowLimitsVP to check the value
762 * @tc.type: FUNC
763 */
764 HWTEST_F(WindowSessionPropertyTest, SetConfigWindowLimitsVP, Function | SmallTest | Level2)
765 {
766 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
767 ASSERT_NE(nullptr, property);
768 WindowLimits limits;
769 limits.minWidth_ = 10;
770 property->SetConfigWindowLimitsVP(limits);
771 WindowLimits result = property->GetConfigWindowLimitsVP();
772 ASSERT_EQ(result.minWidth_, limits.minWidth_);
773 }
774
775 /**
776 * @tc.name: SetLastLimitsVpr
777 * @tc.desc: SetLastLimitsVpr and GetLastLimitsVpr to check the value
778 * @tc.type: FUNC
779 */
780 HWTEST_F(WindowSessionPropertyTest, SetLastLimitsVpr, Function | SmallTest | Level2)
781 {
782 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
783 ASSERT_NE(nullptr, property);
784 float vpr = 1.0f;
785 property->SetLastLimitsVpr(vpr);
786 auto result = property->GetLastLimitsVpr();
787 ASSERT_EQ(result, vpr);
788 }
789
790 /**
791 * @tc.name: SetFullScreenStart
792 * @tc.desc: SetFullScreenStart and GetFullScreenStart to check the value
793 * @tc.type: FUNC
794 */
795 HWTEST_F(WindowSessionPropertyTest, SetFullScreenStart, Function | SmallTest | Level2)
796 {
797 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
798 ASSERT_NE(nullptr, property);
799 property->SetFullScreenStart(true);
800 ASSERT_EQ(property->GetFullScreenStart(), true);
801 property->SetFullScreenStart(false);
802 ASSERT_EQ(property->GetFullScreenStart(), false);
803 }
804
805 /**
806 * @tc.name: SetHideNonSystemFloatingWindows
807 * @tc.desc: SetHideNonSystemFloatingWindows and GetHideNonSystemFloatingWindows to check the value
808 * @tc.type: FUNC
809 */
810 HWTEST_F(WindowSessionPropertyTest, SetHideNonSystemFloatingWindows, Function | SmallTest | Level2)
811 {
812 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
813 ASSERT_NE(nullptr, property);
814 property->SetHideNonSystemFloatingWindows(false);
815 ASSERT_EQ(property->GetHideNonSystemFloatingWindows(), false);
816 property->SetHideNonSystemFloatingWindows(true);
817 ASSERT_EQ(property->GetHideNonSystemFloatingWindows(), true);
818 }
819
820 /**
821 * @tc.name: KeepKeyboardOnFocus
822 * @tc.desc: KeepKeyboardOnFocus and GetKeepKeyboardFlag to check the value
823 * @tc.type: FUNC
824 */
825 HWTEST_F(WindowSessionPropertyTest, KeepKeyboardOnFocus, Function | SmallTest | Level2)
826 {
827 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
828 ASSERT_NE(nullptr, property);
829 property->KeepKeyboardOnFocus(false);
830 ASSERT_EQ(property->GetKeepKeyboardFlag(), false);
831 property->KeepKeyboardOnFocus(true);
832 ASSERT_EQ(property->GetKeepKeyboardFlag(), true);
833 }
834
835 /**
836 * @tc.name: SetTextFieldPositionY
837 * @tc.desc: SetTextFieldPositionY and GetTextFieldPositionY to check the value
838 * @tc.type: FUNC
839 */
840 HWTEST_F(WindowSessionPropertyTest, SetTextFieldPositionY, Function | SmallTest | Level2)
841 {
842 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
843 ASSERT_NE(nullptr, property);
844 property->SetTextFieldPositionY(5.5);
845 ASSERT_EQ(property->GetTextFieldPositionY(), 5.5);
846 }
847
848 /**
849 * @tc.name: SetTextFieldHeight
850 * @tc.desc: SetTextFieldHeight and GetTextFieldHeight to check the value
851 * @tc.type: FUNC
852 */
853 HWTEST_F(WindowSessionPropertyTest, SetTextFieldHeight, Function | SmallTest | Level2)
854 {
855 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
856 ASSERT_NE(nullptr, property);
857 property->SetTextFieldHeight(5.5);
858 ASSERT_EQ(property->GetTextFieldHeight(), 5.5);
859 }
860
861 /**
862 * @tc.name: SetIsLayoutFullScreen
863 * @tc.desc: SetIsLayoutFullScreen and IsLayoutFullScreen to check the value
864 * @tc.type: FUNC
865 */
866 HWTEST_F(WindowSessionPropertyTest, SetIsLayoutFullScreen, Function | SmallTest | Level2)
867 {
868 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
869 ASSERT_NE(nullptr, property);
870 property->SetIsLayoutFullScreen(false);
871 ASSERT_EQ(property->IsLayoutFullScreen(), false);
872 property->SetIsLayoutFullScreen(true);
873 ASSERT_EQ(property->IsLayoutFullScreen(), true);
874 }
875
876 /**
877 * @tc.name: Read
878 * @tc.desc: Read test
879 * @tc.type: FUNC
880 */
881 HWTEST_F(WindowSessionPropertyTest, Read, Function | SmallTest | Level2)
882 {
883 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
884 ASSERT_NE(property, nullptr);
885 Parcel parcel = Parcel();
886 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_RECT);
887 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_TURN_SCREEN_ON);
888 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_KEEP_SCREEN_ON);
889 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_FOCUSABLE);
890 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOUCHABLE);
891 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_SET_BRIGHTNESS);
892 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_ORIENTATION);
893 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_PRIVACY_MODE);
894 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_SYSTEM_PRIVACY_MODE);
895 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_SNAPSHOT_SKIP);
896 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_MAXIMIZE_STATE);
897 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_OTHER_PROPS);
898 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_STATUS_PROPS);
899 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_PROPS);
900 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_INDICATOR_PROPS);
901 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_FLAGS);
902 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_MODE);
903 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_ANIMATION_FLAG);
904 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOUCH_HOT_AREA);
905 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_DECOR_ENABLE);
906 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_WINDOW_LIMITS);
907 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_DRAGENABLED);
908 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_RAISEENABLED);
909 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_HIDE_NON_SYSTEM_FLOATING_WINDOWS);
910 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_TEXTFIELD_AVOID_INFO);
911 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_WINDOW_MASK);
912 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOPMOST);
913 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_SUB_WINDOW_Z_LEVEL);
914 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_MODE_SUPPORT_INFO);
915 property->Read(parcel, WSPropertyChangeAction::ACTION_UPDATE_MAIN_WINDOW_TOPMOST);
916 ASSERT_EQ(property->GetPersistentId(), INVALID_SESSION_ID);
917 }
918
919 /**
920 * @tc.name: Write
921 * @tc.desc: Write and Read to check the value
922 * @tc.type: FUNC
923 */
924 HWTEST_F(WindowSessionPropertyTest, Write, Function | SmallTest | Level2)
925 {
926 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
927 ASSERT_NE(property, nullptr);
928 Parcel parcel = Parcel();
929 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_RECT);
930 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_TURN_SCREEN_ON);
931 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_KEEP_SCREEN_ON);
932 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_FOCUSABLE);
933 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOUCHABLE);
934 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_SET_BRIGHTNESS);
935 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_ORIENTATION);
936 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_PRIVACY_MODE);
937 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_SYSTEM_PRIVACY_MODE);
938 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_SNAPSHOT_SKIP);
939 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_MAXIMIZE_STATE);
940 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_OTHER_PROPS);
941 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_STATUS_PROPS);
942 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_PROPS);
943 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_INDICATOR_PROPS);
944 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_FLAGS);
945 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_MODE);
946 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_ANIMATION_FLAG);
947 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOUCH_HOT_AREA);
948 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_DECOR_ENABLE);
949 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_WINDOW_LIMITS);
950 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_DRAGENABLED);
951 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_RAISEENABLED);
952 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_HIDE_NON_SYSTEM_FLOATING_WINDOWS);
953 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_TEXTFIELD_AVOID_INFO);
954 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_WINDOW_MASK);
955 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_TOPMOST);
956 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_SUB_WINDOW_Z_LEVEL);
957 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_MODE_SUPPORT_INFO);
958 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_MAIN_WINDOW_TOPMOST);
959 property->Write(parcel, WSPropertyChangeAction::ACTION_UPDATE_AVOID_AREA_OPTION);
960 ASSERT_EQ(property->GetPersistentId(), INVALID_SESSION_ID);
961 }
962
963 /**
964 * @tc.name: GetWindowName
965 * @tc.desc: GetWindowName
966 * @tc.type: FUNC
967 */
968 HWTEST_F(WindowSessionPropertyTest, GetWindowName, Function | SmallTest | Level2)
969 {
970 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
971 ASSERT_NE(nullptr, property);
972 std::string name = "test";
973 property->SetWindowName(name);
974 auto result = property->GetWindowName();
975 ASSERT_EQ(result, name);
976 }
977
978 /**
979 * @tc.name: GetSessionInfo
980 * @tc.desc: GetSessionInfo
981 * @tc.type: FUNC
982 */
983 HWTEST_F(WindowSessionPropertyTest, GetSessionInfo, Function | SmallTest | Level2)
984 {
985 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
986 ASSERT_NE(nullptr, property);
987 SessionInfo* info = new SessionInfo();
988 ASSERT_NE(nullptr, info);
989 info->bundleName_ = "test";
990 property->SetSessionInfo(*info);
991 auto result = property->GetSessionInfo();
992 ASSERT_EQ(result.bundleName_, info->bundleName_);
993 delete info;
994 }
995
996 /**
997 * @tc.name: EditSessionInfo
998 * @tc.desc: EditSessionInfo
999 * @tc.type: FUNC
1000 */
1001 HWTEST_F(WindowSessionPropertyTest, EditSessionInfo, Function | SmallTest | Level2)
1002 {
1003 std::string abilityName = "1234";
1004 std::string abilityNameNew = "12345";
1005 SessionInfo info;
1006 info.abilityName_ = abilityName;
1007 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1008 ASSERT_NE(nullptr, property);
1009 property->SetSessionInfo(info);
1010 property->EditSessionInfo().abilityName_ = abilityNameNew;
1011 ASSERT_EQ(property->EditSessionInfo().abilityName_, abilityNameNew);
1012 }
1013
1014 /**
1015 * @tc.name: GetWindowRect
1016 * @tc.desc: GetWindowRect
1017 * @tc.type: FUNC
1018 */
1019 HWTEST_F(WindowSessionPropertyTest, GetWindowRect, Function | SmallTest | Level2)
1020 {
1021 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1022 ASSERT_NE(nullptr, property);
1023 Rect rect = {0, 0, 0, 0};
1024 property->SetWindowRect(rect);
1025 auto result = property->GetWindowRect();
1026 ASSERT_EQ(result, rect);
1027 }
1028
1029 /**
1030 * @tc.name: GetWindowSizeLimits
1031 * @tc.desc: GetWindowSizeLimits
1032 * @tc.type: FUNC
1033 */
1034 HWTEST_F(WindowSessionPropertyTest, GetWindowSizeLimits, Function | SmallTest | Level2)
1035 {
1036 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1037 WindowSizeLimits windowSizeLimits = { 0, 0, 0, 0 };
1038 property->SetWindowSizeLimits(windowSizeLimits);
1039 auto result = property->GetWindowSizeLimits();
1040 ASSERT_EQ(result, windowSizeLimits);
1041 }
1042
1043 /**
1044 * @tc.name: GetRequestRect
1045 * @tc.desc: GetRequestRect
1046 * @tc.type: FUNC
1047 */
1048 HWTEST_F(WindowSessionPropertyTest, GetRequestRect, Function | SmallTest | Level2)
1049 {
1050 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1051 ASSERT_NE(nullptr, property);
1052 Rect requestRect = {0, 0, 0, 0};
1053 property->SetRequestRect(requestRect);
1054 auto result = property->GetRequestRect();
1055 ASSERT_EQ(result, requestRect);
1056 }
1057
1058 /**
1059 * @tc.name: GetWindowType
1060 * @tc.desc: GetWindowType
1061 * @tc.type: FUNC
1062 */
1063 HWTEST_F(WindowSessionPropertyTest, GetWindowType, Function | SmallTest | Level2)
1064 {
1065 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1066 ASSERT_NE(nullptr, property);
1067 WindowType type = WindowType::APP_WINDOW_BASE;
1068 property->SetWindowType(type);
1069 auto result = property->GetWindowType();
1070 ASSERT_EQ(result, type);
1071 }
1072
1073 /**
1074 * @tc.name: GetDisplayId
1075 * @tc.desc: GetDisplayId
1076 * @tc.type: FUNC
1077 */
1078 HWTEST_F(WindowSessionPropertyTest, GetDisplayId, Function | SmallTest | Level2)
1079 {
1080 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1081 ASSERT_NE(nullptr, property);
1082 DisplayId displayId = 1;
1083 property->SetDisplayId(displayId);
1084 auto result = property->GetDisplayId();
1085 ASSERT_EQ(result, displayId);
1086 }
1087
1088 /**
1089 * @tc.name: GetPersistentId
1090 * @tc.desc: GetPersistentId
1091 * @tc.type: FUNC
1092 */
1093 HWTEST_F(WindowSessionPropertyTest, GetPersistentId, Function | SmallTest | Level2)
1094 {
1095 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1096 ASSERT_NE(nullptr, property);
1097 int32_t persistentId = 1;
1098 property->SetPersistentId(persistentId);
1099 auto result = property->GetPersistentId();
1100 ASSERT_EQ(result, persistentId);
1101 }
1102
1103 /**
1104 * @tc.name: GetParentPersistentId
1105 * @tc.desc: GetParentPersistentId
1106 * @tc.type: FUNC
1107 */
1108 HWTEST_F(WindowSessionPropertyTest, GetParentPersistentId, Function | SmallTest | Level2)
1109 {
1110 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1111 ASSERT_NE(nullptr, property);
1112 int32_t persistentId = 1;
1113 property->SetParentPersistentId(persistentId);
1114 auto result = property->GetParentPersistentId();
1115 ASSERT_EQ(result, persistentId);
1116 }
1117
1118 /**
1119 * @tc.name: SetTurnScreenOn
1120 * @tc.desc: SetTurnScreenOn
1121 * @tc.type: FUNC
1122 */
1123 HWTEST_F(WindowSessionPropertyTest, SetTurnScreenOn, Function | SmallTest | Level2)
1124 {
1125 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1126 ASSERT_NE(nullptr, property);
1127 bool turnScreenOn = false;
1128 property->SetTurnScreenOn(turnScreenOn);
1129 ASSERT_EQ(property->IsTurnScreenOn(), turnScreenOn);
1130 }
1131
1132 /**
1133 * @tc.name: SetKeepScreenOn
1134 * @tc.desc: SetKeepScreenOn
1135 * @tc.type: FUNC
1136 */
1137 HWTEST_F(WindowSessionPropertyTest, SetKeepScreenOn, Function | SmallTest | Level2)
1138 {
1139 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1140 ASSERT_NE(nullptr, property);
1141 bool keepScreenOn = true;
1142 property->SetKeepScreenOn(keepScreenOn);
1143 ASSERT_EQ(keepScreenOn, property->IsKeepScreenOn());
1144 keepScreenOn = false;
1145 property->SetKeepScreenOn(keepScreenOn);
1146 ASSERT_EQ(keepScreenOn, property->IsKeepScreenOn());
1147 }
1148
1149 /**
1150 * @tc.name: SetViewKeepScreenOn
1151 * @tc.desc: SetViewKeepScreenOn And IsViewKeepScreenOn
1152 * @tc.type: FUNC
1153 */
1154 HWTEST_F(WindowSessionPropertyTest, SetViewKeepScreenOn, TestSize.Level1)
1155 {
1156 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1157 ASSERT_NE(nullptr, property);
1158 bool keepScreenOn = true;
1159 property->SetViewKeepScreenOn(keepScreenOn);
1160 ASSERT_EQ(keepScreenOn, property->IsViewKeepScreenOn());
1161 keepScreenOn = false;
1162 property->SetViewKeepScreenOn(keepScreenOn);
1163 ASSERT_EQ(keepScreenOn, property->IsViewKeepScreenOn());
1164 }
1165
1166 /**
1167 * @tc.name: MarshallingSessionInfo
1168 * @tc.desc: MarshallingSessionInfo test
1169 * @tc.type: FUNC
1170 */
1171 HWTEST_F(WindowSessionPropertyTest, MarshallingSessionInfo, Function | SmallTest | Level2)
1172 {
1173 Parcel parcel;
1174 SessionInfo info = { "testBundleName", "testModuleName", "testAbilityName" };
1175 info.want = std::make_shared<AAFwk::Want>();
1176 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1177 ASSERT_NE(nullptr, property);
1178 bool result = property->MarshallingSessionInfo(parcel);
1179 ASSERT_EQ(result, true);
1180 }
1181
1182 /**
1183 * @tc.name: UnMarshallingSessionInfo
1184 * @tc.desc: UnMarshallingSessionInfo test
1185 * @tc.type: FUNC
1186 */
1187 HWTEST_F(WindowSessionPropertyTest, UnMarshallingSessionInfo, Function | SmallTest | Level2)
1188 {
1189 Parcel parcel;
1190 WindowSessionProperty windowSessionProperty;
1191 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1192 ASSERT_NE(nullptr, property);
1193 SessionInfo info = { "testBundleName", "testModuleName", "testAbilityName" };
1194 info.want = std::make_shared<AAFwk::Want>();
1195 bool result = property->MarshallingSessionInfo(parcel);
1196 ASSERT_EQ(result, true);
1197 result = property->UnmarshallingSessionInfo(parcel, &windowSessionProperty);
1198 ASSERT_EQ(result, true);
1199 }
1200
1201 /**
1202 * @tc.name: SetAccessTokenId
1203 * @tc.desc: SetAccessTokenId
1204 * @tc.type: FUNC
1205 */
1206 HWTEST_F(WindowSessionPropertyTest, SetAccessTokenId, Function | SmallTest | Level2)
1207 {
1208 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1209 ASSERT_NE(nullptr, property);
1210 uint32_t accessTokenId = 1;
1211 property->SetAccessTokenId(accessTokenId);
1212 ASSERT_EQ(property->accessTokenId_, accessTokenId);
1213 }
1214
1215 /**
1216 * @tc.name: GetWindowState
1217 * @tc.desc: GetWindowState
1218 * @tc.type: FUNC
1219 */
1220 HWTEST_F(WindowSessionPropertyTest, GetWindowState, Function | SmallTest | Level2)
1221 {
1222 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1223 ASSERT_NE(nullptr, property);
1224 WindowState state = WindowState::STATE_INITIAL;
1225 property->SetWindowState(state);
1226 auto result = property->GetWindowState();
1227 ASSERT_EQ(result, state);
1228 }
1229
1230 /**
1231 * @tc.name: SetSystemPrivacyMode02
1232 * @tc.desc: SetSystemPrivacyMode
1233 * @tc.type: FUNC
1234 */
1235 HWTEST_F(WindowSessionPropertyTest, SetSystemPrivacyMode02, Function | SmallTest | Level2)
1236 {
1237 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1238 ASSERT_NE(nullptr, property);
1239 bool isSystemPrivate = false;
1240 property->SetSystemPrivacyMode(isSystemPrivate);
1241 ASSERT_EQ(property->GetSystemPrivacyMode(), isSystemPrivate);
1242 }
1243
1244 /**
1245 * @tc.name: SetTokenState02
1246 * @tc.desc: SetTokenState
1247 * @tc.type: FUNC
1248 */
1249 HWTEST_F(WindowSessionPropertyTest, SetTokenState02, Function | SmallTest | Level2)
1250 {
1251 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1252 ASSERT_NE(nullptr, property);
1253 bool hasToken = false;
1254 property->SetTokenState(hasToken);
1255 ASSERT_EQ(property->GetTokenState(), hasToken);
1256 }
1257
1258 /**
1259 * @tc.name: MarshallingTouchHotAreas
1260 * @tc.desc: MarshallingTouchHotAreas test
1261 * @tc.type: FUNC
1262 */
1263 HWTEST_F(WindowSessionPropertyTest, MarshallingTouchHotAreas, Function | SmallTest | Level2)
1264 {
1265 Parcel parcel;
1266 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1267 std::vector<Rect> rects;
1268 for (int i = 0; i < 55; i++) {
1269 Rect rect { i, i, i, i };
1270 rects.push_back(rect);
1271 }
1272 property->SetTouchHotAreas(rects);
1273 bool result = property->MarshallingTouchHotAreas(parcel);
1274 ASSERT_EQ(result, false);
1275 }
1276
1277 /**
1278 * @tc.name: MarshallingKeyboardTouchHotAreas
1279 * @tc.desc: MarshallingKeyboardTouchHotAreas test
1280 * @tc.type: FUNC
1281 */
1282 HWTEST_F(WindowSessionPropertyTest, MarshallingKeyboardTouchHotAreas, Function | SmallTest | Level2)
1283 {
1284 Parcel parcel;
1285 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1286 KeyboardTouchHotAreas hotAreas;
1287 for (int i = 0; i < 55; i++) {
1288 Rect rect { i, i, i, i };
1289 hotAreas.landscapeKeyboardHotAreas_.push_back(rect);
1290 hotAreas.landscapePanelHotAreas_.push_back(rect);
1291 hotAreas.portraitKeyboardHotAreas_.push_back(rect);
1292 hotAreas.portraitPanelHotAreas_.push_back(rect);
1293 }
1294 property->SetKeyboardTouchHotAreas(hotAreas);
1295 bool result = property->MarshallingKeyboardTouchHotAreas(parcel);
1296 ASSERT_EQ(result, false);
1297 }
1298
1299 /**
1300 * @tc.name: UnmarshallingPiPTemplateInfo02
1301 * @tc.desc: UnmarshallingPiPTemplateInfo test
1302 * @tc.type: FUNC
1303 */
1304 HWTEST_F(WindowSessionPropertyTest, UnmarshallingPiPTemplateInfo02, Function | SmallTest | Level2)
1305 {
1306 Parcel parcel = Parcel();
1307 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1308 ASSERT_NE(nullptr, property);
1309 property->SetWindowType(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW);
1310 WindowSessionProperty windowSessionProperty;
1311 windowSessionProperty.UnmarshallingPiPTemplateInfo(parcel, property);
1312 }
1313
1314 /**
1315 * @tc.name: MarshallingPiPTemplateInfo
1316 * @tc.desc: MarshallingPiPTemplateInfo test
1317 * @tc.type: FUNC
1318 */
1319 HWTEST_F(WindowSessionPropertyTest, MarshallingPiPTemplateInfo, Function | SmallTest | Level2)
1320 {
1321 Parcel parcel = Parcel();
1322 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1323 ASSERT_NE(nullptr, property);
1324 property->SetWindowType(WindowType::WINDOW_TYPE_PIP);
1325 auto info = property->GetPiPTemplateInfo();
1326 for (int i = 0; i < 10; i++) {
1327 info.controlGroup.push_back(i);
1328 }
1329 property->SetPiPTemplateInfo(info);
1330 bool result = property->MarshallingPiPTemplateInfo(parcel);
1331 ASSERT_EQ(result, false);
1332 }
1333
1334 /**
1335 * @tc.name: SetIsPcAppInPad/GetIsPcAppInPad
1336 * @tc.desc: SetIsPcAppInPad/GetIsPcAppInPad
1337 * @tc.type: FUNC
1338 */
1339 HWTEST_F(WindowSessionPropertyTest, SetIsPcAppInPad, Function | SmallTest | Level2)
1340 {
1341 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1342 ASSERT_NE(nullptr, property);
1343 bool isPcAppInPad = true;
1344 property->SetIsPcAppInPad(isPcAppInPad);
1345 auto result = property->GetIsPcAppInPad();
1346 ASSERT_EQ(result, isPcAppInPad);
1347 }
1348
1349 /**
1350 * @tc.name: SetSubWindowLevel
1351 * @tc.desc: SetSubWindowLevel Test
1352 * @tc.type: FUNC
1353 */
1354 HWTEST_F(WindowSessionPropertyTest, SetSubWindowLevel, Function | SmallTest | Level2)
1355 {
1356 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1357 EXPECT_NE(property, nullptr);
1358 uint32_t level = 4;
1359 property->SetSubWindowLevel(level);
1360 ASSERT_EQ(level, property->GetSubWindowLevel());
1361 }
1362
1363 /**
1364 * @tc.name: GetSubWindowLevel
1365 * @tc.desc: GetSubWindowLevel Test
1366 * @tc.type: FUNC
1367 */
1368 HWTEST_F(WindowSessionPropertyTest, GetSubWindowLevel, Function | SmallTest | Level2)
1369 {
1370 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1371 EXPECT_NE(property, nullptr);
1372 property->SetSubWindowLevel(1);
1373 ASSERT_EQ(1, property->GetSubWindowLevel());
1374 }
1375
1376 /**
1377 * @tc.name: GetSubWindowZLevel
1378 * @tc.desc: GetSubWindowZLevel Test
1379 * @tc.type: FUNC
1380 */
1381 HWTEST_F(WindowSessionPropertyTest, GetSubWindowZLevel, Function | SmallTest | Level2)
1382 {
1383 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1384 int32_t zLevel = 1;
1385 property->zLevel_ = zLevel;
1386 ASSERT_EQ(zLevel, property->GetSubWindowZLevel());
1387 }
1388
1389 /**
1390 * @tc.name: SetSubWindowZLevel
1391 * @tc.desc: SetSubWindowZLevel Test
1392 * @tc.type: FUNC
1393 */
1394 HWTEST_F(WindowSessionPropertyTest, SetSubWindowZLevel, Function | SmallTest | Level2)
1395 {
1396 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1397 int32_t zLevel = 1;
1398 property->SetSubWindowZLevel(zLevel);
1399 ASSERT_EQ(zLevel, property->zLevel_);
1400 }
1401
1402 /**
1403 * @tc.name: SetAndIsSystemKeyboard
1404 * @tc.desc: SetIsSystemKeyboard and IsSystemKeyboard Test
1405 * @tc.type: FUNC
1406 */
1407 HWTEST_F(WindowSessionPropertyTest, SetAndIsSystemKeyboard, Function | SmallTest | Level2)
1408 {
1409 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1410 ASSERT_EQ(false, property->IsSystemKeyboard());
1411 property->SetIsSystemKeyboard(true);
1412 ASSERT_EQ(true, property->IsSystemKeyboard());
1413 }
1414
1415 /**
1416 * @tc.name: SetAvoidAreaOption
1417 * @tc.desc: SetAvoidAreaOption Test
1418 * @tc.type: FUNC
1419 */
1420 HWTEST_F(WindowSessionPropertyTest, SetAvoidAreaOption, Function | SmallTest | Level2)
1421 {
1422 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1423 uint32_t avoidAreaOption = 0;
1424 property->SetAvoidAreaOption(avoidAreaOption);
1425 ASSERT_EQ(avoidAreaOption, property->GetAvoidAreaOption());
1426 avoidAreaOption = 2;
1427 property->SetAvoidAreaOption(avoidAreaOption);
1428 ASSERT_EQ(avoidAreaOption, property->GetAvoidAreaOption());
1429 }
1430
1431 /**
1432 * @tc.name: GetAvoidAreaOption
1433 * @tc.desc: GetAvoidAreaOption Test
1434 * @tc.type: FUNC
1435 */
1436 HWTEST_F(WindowSessionPropertyTest, GetAvoidAreaOption, Function | SmallTest | Level2)
1437 {
1438 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1439 uint32_t avoidAreaOption = 2;
1440 property->SetAvoidAreaOption(avoidAreaOption);
1441 ASSERT_EQ(2, property->GetAvoidAreaOption());
1442 }
1443
1444 /**
1445 * @tc.name: SetBackgroundAlpha
1446 * @tc.desc: SetBackgroundAlpha Test
1447 * @tc.type: FUNC
1448 */
1449 HWTEST_F(WindowSessionPropertyTest, SetBackgroundAlpha, Function | SmallTest | Level2)
1450 {
1451 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1452 uint8_t backgroundAlpha = 0;
1453 property->SetBackgroundAlpha(backgroundAlpha);
1454 ASSERT_EQ(backgroundAlpha, property->GetBackgroundAlpha());
1455 backgroundAlpha = 2;
1456 property->SetBackgroundAlpha(backgroundAlpha);
1457 ASSERT_EQ(backgroundAlpha, property->GetBackgroundAlpha());
1458 }
1459
1460 /**
1461 * @tc.name: GetBackgroundAlpha
1462 * @tc.desc: GetBackgroundAlpha Test
1463 * @tc.type: FUNC
1464 */
1465 HWTEST_F(WindowSessionPropertyTest, GetBackgroundAlpha, Function | SmallTest | Level2)
1466 {
1467 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1468 uint8_t backgroundAlpha = 2;
1469 property->SetBackgroundAlpha(backgroundAlpha);
1470 ASSERT_EQ(2, property->GetBackgroundAlpha());
1471 }
1472
1473 /**
1474 * @tc.name: SetWindowCornerRadius
1475 * @tc.desc: SetWindowCornerRadius
1476 * @tc.type: FUNC
1477 */
1478 HWTEST_F(WindowSessionPropertyTest, SetWindowCornerRadius, Function | SmallTest | Level2)
1479 {
1480 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1481 float cornerRadius = 1.0f;
1482 property->SetWindowCornerRadius(cornerRadius);
1483 ASSERT_EQ(cornerRadius, property->GetWindowCornerRadius());
1484 }
1485
1486 /**
1487 * @tc.name: GetIsAtomicService
1488 * @tc.desc: GetIsAtomicService
1489 * @tc.type: FUNC
1490 */
1491 HWTEST_F(WindowSessionPropertyTest, GetIsAtomicService, Function | SmallTest | Level2)
1492 {
1493 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1494 bool isAtomicService = true;
1495 property->SetIsAtomicService(isAtomicService);
1496 auto result = property->GetIsAtomicService();
1497 ASSERT_EQ(result, isAtomicService);
1498 }
1499
1500 /**
1501 * @tc.name: SetIsSaveBySpecifiedFlag
1502 * @tc.desc: SetIsSaveBySpecifiedFlag
1503 * @tc.type: FUNC
1504 */
1505 HWTEST_F(WindowSessionPropertyTest, SetIsSaveBySpecifiedFlag, Function | SmallTest | Level2)
1506 {
1507 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
1508 bool isSaveBySpecifiedFlag = false;
1509 property->SetIsSaveBySpecifiedFlag(isSaveBySpecifiedFlag);
1510 ASSERT_EQ(isSaveBySpecifiedFlag, property->GetIsSaveBySpecifiedFlag());
1511 }
1512 } // namespace
1513 } // namespace Rosen
1514 } // namespace OHOS
1515