• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2025 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 <common/rs_rect.h>
17 #include <gtest/gtest.h>
18 #include <iremote_broker.h>
19 #include <transaction/rs_marshalling_helper.h>
20 
21 #include "display_manager_adapter.h"
22 #include "display_manager_agent_default.h"
23 #include "fold_screen_state_internel.h"
24 #include "scene_board_judgement.h"
25 #include "screen_session_manager/include/screen_session_manager.h"
26 #include "session_manager/include/scene_session_manager.h"
27 #include "zidl/screen_session_manager_proxy.h"
28 
29 using namespace testing;
30 using namespace testing::ext;
31 
32 namespace OHOS::Rosen {
33 class ScreenSessionManagerProxyUtTest : public testing::Test {
34 public:
35     static void SetUpTestSuite();
36     void SetUp() override;
37     sptr<ScreenSessionManagerProxy> screenSessionManagerProxy;
38 };
39 
SetUpTestSuite()40 void ScreenSessionManagerProxyUtTest::SetUpTestSuite()
41 {
42     ASSERT_TRUE(SingletonContainer::Get<ScreenManagerAdapter>().InitDMSProxy());
43 }
44 
SetUp()45 void ScreenSessionManagerProxyUtTest::SetUp()
46 {
47     if (screenSessionManagerProxy) {
48         return;
49     }
50 
51     sptr<IRemoteObject> impl;
52     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
53         ASSERT_NE(SingletonContainer::Get<ScreenManagerAdapter>().screenSessionManagerServiceProxy_, nullptr);
54         impl = SingletonContainer::Get<ScreenManagerAdapter>().screenSessionManagerServiceProxy_->AsObject();
55     } else {
56         ASSERT_NE(SingletonContainer::Get<ScreenManagerAdapter>().displayManagerServiceProxy_, nullptr);
57         impl = SingletonContainer::Get<ScreenManagerAdapter>().displayManagerServiceProxy_->AsObject();
58     }
59 
60     screenSessionManagerProxy = new (std::nothrow) ScreenSessionManagerProxy(impl);
61     ASSERT_NE(screenSessionManagerProxy, nullptr);
62 }
63 
64 namespace {
65 /**
66  * @tc.name: SetPrivacyStateByDisplayId
67  * @tc.desc: SetPrivacyStateByDisplayId
68  * @tc.type: FUNC
69  */
70 HWTEST_F(ScreenSessionManagerProxyUtTest, SetPrivacyStateByDisplayId, TestSize.Level1)
71 {
72     DisplayId id = 0;
73     bool hasPrivate = false;
74 
75     int resultValue = 0;
76     std::function<void()> func = [&]()
__anon527cffe40202() 77     {
78         screenSessionManagerProxy->SetPrivacyStateByDisplayId(id, hasPrivate);
79         resultValue = 1;
80     };
81     func();
82     ASSERT_EQ(resultValue, 1);
83 }
84 
85 /**
86  * @tc.name: SetScreenPrivacyWindowList
87  * @tc.desc: SetScreenPrivacyWindowList
88  * @tc.type: FUNC
89  */
90 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenPrivacyWindowList, TestSize.Level1)
91 {
92     DisplayId id = 0;
93     std::vector<std::string> privacyWindowList{"win0", "win1"};
94 
95     int resultValue = 0;
96     std::function<void()> func = [&]()
__anon527cffe40302() 97     {
98         screenSessionManagerProxy->SetScreenPrivacyWindowList(id, privacyWindowList);
99         resultValue = 1;
100     };
101     func();
102     ASSERT_EQ(resultValue, 1);
103 }
104 
105 /**
106  * @tc.name: SetVirtualScreenBlackList
107  * @tc.desc: SetVirtualScreenBlackList
108  * @tc.type: FUNC
109  */
110 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualScreenBlackList, TestSize.Level1)
111 {
112     ScreenId id = 1001;
113     std::vector<uint64_t> windowIdList{10, 20, 30};
114 
115     int resultValue = 0;
116     std::function<void()> func = [&]()
__anon527cffe40402() 117     {
118         screenSessionManagerProxy->SetVirtualScreenBlackList(id, windowIdList);
119         resultValue = 1;
120     };
121     func();
122     ASSERT_EQ(resultValue, 1);
123 }
124 
125 /**
126  * @tc.name: SetVirtualDisplayMuteFlag
127  * @tc.desc: SetVirtualDisplayMuteFlag
128  * @tc.type: FUNC
129  */
130 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualDisplayMuteFlag, Function | SmallTest | Level1)
131 {
132     ScreenId id = 1001;
133     bool muteFlag = false;
134     screenSessionManagerProxy->SetVirtualDisplayMuteFlag(id, muteFlag);
135     auto screenSession = ScreenSessionManager::GetInstance().GetScreenSession(2000);
136     EXPECT_EQ(screenSession, nullptr);
137 }
138 
139 /**
140  * @tc.name: ProxyForFreeze
141  * @tc.desc: ProxyForFreeze
142  * @tc.type: FUNC
143  */
144 HWTEST_F(ScreenSessionManagerProxyUtTest, ProxyForFreeze, TestSize.Level1)
145 {
146     const std::set<int32_t>& pidList = {1, 2, 3};
147     bool isProxy = true;
148 
149     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
150         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
151                 screenSessionManagerProxy->ProxyForFreeze(pidList, isProxy));
152     } else {
153         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
154                 screenSessionManagerProxy->ProxyForFreeze(pidList, isProxy));
155     }
156 }
157 
158 /**
159  * @tc.name: SetVirtualScreenStatus
160  * @tc.desc: SetVirtualScreenStatus
161  * @tc.type: FUNC
162  */
163 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualScreenStatus, TestSize.Level1)
164 {
165     ScreenId id = 1001;
166     VirtualScreenStatus screenStatus = VirtualScreenStatus::VIRTUAL_SCREEN_PAUSE;
167 
168     bool expectation = true;
169     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
170         EXPECT_NE(expectation, screenSessionManagerProxy->SetVirtualScreenStatus(id, screenStatus));
171     } else {
172         EXPECT_NE(expectation, screenSessionManagerProxy->SetVirtualScreenStatus(id, screenStatus));
173     }
174 }
175 
176 /**
177  * @tc.name: SetVirtualScreenSecurityExemption
178  * @tc.desc: SetVirtualScreenSecurityExemption
179  * @tc.type: FUNC
180  */
181 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualScreenSecurityExemption, TestSize.Level1)
182 {
183     ScreenId id = 1001;
184     uint32_t pid = 1;
185     std::vector<uint64_t> windowIdList{10, 20, 30};
186 
187     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
188         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
189                 screenSessionManagerProxy->SetVirtualScreenSecurityExemption(id, pid, windowIdList));
190     } else {
191         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
192                 screenSessionManagerProxy->SetVirtualScreenSecurityExemption(id, pid, windowIdList));
193     }
194 }
195 
196 /**
197  * @tc.name: GetAllDisplayPhysicalResolution
198  * @tc.desc: GetAllDisplayPhysicalResolution
199  * @tc.type: FUNC
200  */
201 HWTEST_F(ScreenSessionManagerProxyUtTest, GetAllDisplayPhysicalResolution, TestSize.Level1)
202 {
203     std::vector<DisplayPhysicalResolution> allSize {};
204     std::function<void()> func = [&]()
__anon527cffe40502() 205     {
206         allSize = screenSessionManagerProxy->GetAllDisplayPhysicalResolution();
207     };
208     func();
209     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
210         ASSERT_TRUE(!allSize.empty());
211     } else {
212         ASSERT_FALSE(!allSize.empty());
213     }
214 }
215 
216 /**
217  * @tc.name: GetDefaultDisplayInfo
218  * @tc.desc: GetDefaultDisplayInfo
219  * @tc.type: FUNC
220  */
221 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDefaultDisplayInfo, TestSize.Level1)
222 {
223     sptr<DisplayInfo> expectation = nullptr;
224     sptr<DisplayInfo> res = nullptr;
225     std::function<void()> func = [&]()
__anon527cffe40602() 226     {
227         res = screenSessionManagerProxy->GetDefaultDisplayInfo();
228     };
229     func();
230     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
231         ASSERT_NE(res, expectation);
232     } else {
233         ASSERT_EQ(res, expectation);
234     }
235 }
236 
237 /**
238  * @tc.name: SetScreenActiveMode
239  * @tc.desc: SetScreenActiveMode
240  * @tc.type: FUNC
241  */
242 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenActiveMode, TestSize.Level1)
243 {
244     ScreenId id = 1001;
245     uint32_t modeId = 1;
246 
247 
248     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
249     std::function<void()> func = [&]()
__anon527cffe40702() 250     {
251         res = screenSessionManagerProxy->SetScreenActiveMode(id, modeId);
252     };
253     func();
254     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
255         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
256     } else {
257         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
258     }
259 }
260 
261 /**
262  * @tc.name: SetVirtualPixelRatio
263  * @tc.desc: SetVirtualPixelRatio
264  * @tc.type: FUNC
265  */
266 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualPixelRatio, TestSize.Level1)
267 {
268     ScreenId id = 1001;
269     float virtualPixelRatio = 1.0;
270 
271 
272     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
273     std::function<void()> func = [&]()
__anon527cffe40802() 274     {
275         res = screenSessionManagerProxy->SetVirtualPixelRatio(id, virtualPixelRatio);
276     };
277     func();
278     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
279         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
280     } else {
281         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
282     }
283 }
284 
285 /**
286  * @tc.name: SetVirtualPixelRatioSystem
287  * @tc.desc: SetVirtualPixelRatioSystem
288  * @tc.type: FUNC
289  */
290 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualPixelRatioSystem, TestSize.Level1)
291 {
292     ScreenId id = 1001;
293     float virtualPixelRatio = 1.0;
294 
295 
296     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
297     std::function<void()> func = [&]()
__anon527cffe40902() 298     {
299         res = screenSessionManagerProxy->SetVirtualPixelRatioSystem(id, virtualPixelRatio);
300     };
301     func();
302     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
303         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
304     } else {
305         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
306     }
307 }
308 
309 /**
310  * @tc.name: SetDefaultDensityDpi
311  * @tc.desc: SetDefaultDensityDpi
312  * @tc.type: FUNC
313  */
314 HWTEST_F(ScreenSessionManagerProxyUtTest, SetDefaultDensityDpi, TestSize.Level1)
315 {
316     ScreenId id = 1001;
317     float virtualPixelRatio = 1.0;
318 
319 
320     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
321     std::function<void()> func = [&]()
__anon527cffe40a02() 322     {
323         res = screenSessionManagerProxy->SetDefaultDensityDpi(id, virtualPixelRatio);
324     };
325     func();
326     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
327         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
328     } else {
329         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
330     }
331 }
332 
333 /**
334  * @tc.name: SetResolution
335  * @tc.desc: SetResolution
336  * @tc.type: FUNC
337  */
338 HWTEST_F(ScreenSessionManagerProxyUtTest, SetResolution, TestSize.Level1)
339 {
340     ScreenId id = 1001;
341     uint32_t width = 1024;
342     uint32_t height = 1024;
343     float virtualPixelRatio = 1.0;
344 
345 
346     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
347     std::function<void()> func = [&]()
__anon527cffe40b02() 348     {
349         res = screenSessionManagerProxy->SetResolution(id, width, height, virtualPixelRatio);
350     };
351     func();
352     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
353         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
354     } else {
355         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
356     }
357 }
358 
359 /**
360  * @tc.name: GetDensityInCurResolution
361  * @tc.desc: GetDensityInCurResolution
362  * @tc.type: FUNC
363  */
364 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDensityInCurResolution, TestSize.Level1)
365 {
366     ScreenId id = 1001;
367     float virtualPixelRatio = 1.0;
368 
369 
370     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
371     std::function<void()> func = [&]()
__anon527cffe40c02() 372     {
373         res = screenSessionManagerProxy->GetDensityInCurResolution(id, virtualPixelRatio);
374     };
375     func();
376     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
377         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
378     } else {
379         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
380     }
381 }
382 
383 /**
384  * @tc.name: GetScreenColorGamut
385  * @tc.desc: GetScreenColorGamut
386  * @tc.type: FUNC
387  */
388 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenColorGamut, TestSize.Level1)
389 {
390     ScreenId id = 1001;
391     ScreenColorGamut colorGamut {0};
392 
393 
394     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
395     std::function<void()> func = [&]()
__anon527cffe40d02() 396     {
397         res = screenSessionManagerProxy->GetScreenColorGamut(id, colorGamut);
398     };
399     func();
400     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
401         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
402     } else {
403         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
404     }
405 }
406 
407 /**
408  * @tc.name: SetScreenColorGamut
409  * @tc.desc: SetScreenColorGamut
410  * @tc.type: FUNC
411  */
412 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenColorGamut, TestSize.Level1)
413 {
414     ScreenId id = 1001;
415     uint32_t colorGamut = 0;
416 
417 
418     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
419     std::function<void()> func = [&]()
__anon527cffe40e02() 420     {
421         res = screenSessionManagerProxy->SetScreenColorGamut(id, colorGamut);
422     };
423     func();
424     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
425         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
426     } else {
427         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
428     }
429 }
430 
431 /**
432  * @tc.name: GetScreenGamutMap
433  * @tc.desc: GetScreenGamutMap
434  * @tc.type: FUNC
435  */
436 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenGamutMap, TestSize.Level1)
437 {
438     ScreenId id = 1001;
439     ScreenGamutMap colorGamut;
440 
441 
442     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
443     std::function<void()> func = [&]()
__anon527cffe40f02() 444     {
445         res = screenSessionManagerProxy->GetScreenGamutMap(id, colorGamut);
446     };
447     func();
448     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
449         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
450     } else {
451         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
452     }
453 }
454 
455 /**
456  * @tc.name: SetScreenGamutMap
457  * @tc.desc: SetScreenGamutMap
458  * @tc.type: FUNC
459  */
460 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenGamutMap, TestSize.Level1)
461 {
462     ScreenId id = 1001;
463     ScreenGamutMap colorGamut {0};
464 
465 
466     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
467     std::function<void()> func = [&]()
__anon527cffe41002() 468     {
469         res = screenSessionManagerProxy->SetScreenGamutMap(id, colorGamut);
470     };
471     func();
472     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
473         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
474     } else {
475         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
476     }
477 }
478 
479 /**
480  * @tc.name: SetScreenColorTransform
481  * @tc.desc: SetScreenColorTransform
482  * @tc.type: FUNC
483  */
484 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenColorTransform, TestSize.Level1)
485 {
486     ScreenId id = 1001;
487 
488 
489     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
490     std::function<void()> func = [&]()
__anon527cffe41102() 491     {
492         res = screenSessionManagerProxy->SetScreenColorTransform(id);
493     };
494     func();
495     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
496         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
497     } else {
498         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
499     }
500 }
501 
502 /**
503  * @tc.name: GetPixelFormat
504  * @tc.desc: GetPixelFormat
505  * @tc.type: FUNC
506  */
507 HWTEST_F(ScreenSessionManagerProxyUtTest, GetPixelFormat, TestSize.Level1)
508 {
509     ScreenId id = 1001;
510     GraphicPixelFormat pixelFormat = GraphicPixelFormat {GRAPHIC_PIXEL_FMT_CLUT8};
511 
512 
513     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
514     std::function<void()> func = [&]()
__anon527cffe41202() 515     {
516         res = screenSessionManagerProxy->GetPixelFormat(id, pixelFormat);
517     };
518     func();
519     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
520         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
521     } else {
522         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
523     }
524 }
525 
526 /**
527  * @tc.name: SetPixelFormat
528  * @tc.desc: SetPixelFormat
529  * @tc.type: FUNC
530  */
531 HWTEST_F(ScreenSessionManagerProxyUtTest, SetPixelFormat, TestSize.Level1)
532 {
533     ScreenId id = 1001;
534     GraphicPixelFormat pixelFormat = GraphicPixelFormat {GRAPHIC_PIXEL_FMT_CLUT8};
535 
536 
537     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
538     std::function<void()> func = [&]()
__anon527cffe41302() 539     {
540         res = screenSessionManagerProxy->SetPixelFormat(id, pixelFormat);
541     };
542     func();
543     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
544         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
545     } else {
546         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
547     }
548 }
549 
550 /**
551  * @tc.name: GetSupportedHDRFormats
552  * @tc.desc: GetSupportedHDRFormats
553  * @tc.type: FUNC
554  */
555 HWTEST_F(ScreenSessionManagerProxyUtTest, GetSupportedHDRFormats, TestSize.Level1)
556 {
557     ScreenId id = 1001;
558     vector<ScreenHDRFormat> hdrFormats;
559 
560 
561     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
562     std::function<void()> func = [&]()
__anon527cffe41402() 563     {
564         res = screenSessionManagerProxy->GetSupportedHDRFormats(id, hdrFormats);
565     };
566     func();
567     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
568         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
569     } else {
570         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
571     }
572 }
573 
574 /**
575  * @tc.name: GetScreenHDRFormat
576  * @tc.desc: GetScreenHDRFormat
577  * @tc.type: FUNC
578  */
579 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenHDRFormat, TestSize.Level1)
580 {
581     ScreenId id = 1001;
582     ScreenHDRFormat hdrFormatS {0};
583 
584 
585     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
586     std::function<void()> func = [&]()
__anon527cffe41502() 587     {
588         res = screenSessionManagerProxy->GetScreenHDRFormat(id, hdrFormatS);
589     };
590     func();
591     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
592         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
593     } else {
594         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
595     }
596 }
597 
598 /**
599  * @tc.name: SetScreenHDRFormat
600  * @tc.desc: SetScreenHDRFormat
601  * @tc.type: FUNC
602  */
603 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenHDRFormat, TestSize.Level1)
604 {
605     ScreenId id = 1001;
606     ScreenHDRFormat hdrFormatS {0};
607 
608 
609     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
610     std::function<void()> func = [&]()
__anon527cffe41602() 611     {
612         res = screenSessionManagerProxy->SetScreenHDRFormat(id, hdrFormatS);
613     };
614     func();
615     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
616         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
617     } else {
618         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
619     }
620 }
621 
622 /**
623  * @tc.name: RegisterDisplayManagerAgent
624  * @tc.desc: RegisterDisplayManagerAgent
625  * @tc.type: FUNC
626  */
627 HWTEST_F(ScreenSessionManagerProxyUtTest, RegisterDisplayManagerAgent, TestSize.Level1)
628 {
629     sptr<IDisplayManagerAgent> displayManagerAgent = new DisplayManagerAgentDefault();
630     DisplayManagerAgentType type = DisplayManagerAgentType::SCREEN_EVENT_LISTENER;
631     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
632         EXPECT_EQ(DMError::DM_OK, screenSessionManagerProxy->RegisterDisplayManagerAgent(displayManagerAgent, type));
633     } else {
634         EXPECT_NE(DMError::DM_OK, screenSessionManagerProxy->RegisterDisplayManagerAgent(displayManagerAgent, type));
635     }
636     displayManagerAgent = nullptr;
637     EXPECT_EQ(DMError::DM_ERROR_INVALID_PARAM,
638               screenSessionManagerProxy->RegisterDisplayManagerAgent(displayManagerAgent, type));
639 }
640 
641 /**
642  * @tc.name: UnregisterDisplayManagerAgent
643  * @tc.desc: UnregisterDisplayManagerAgent
644  * @tc.type: FUNC
645  */
646 HWTEST_F(ScreenSessionManagerProxyUtTest, UnregisterDisplayManagerAgent, TestSize.Level1)
647 {
648     sptr<IDisplayManagerAgent> displayManagerAgent = new DisplayManagerAgentDefault();
649     DisplayManagerAgentType type = DisplayManagerAgentType::SCREEN_EVENT_LISTENER;
650     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
651         EXPECT_EQ(DMError::DM_OK, screenSessionManagerProxy->UnregisterDisplayManagerAgent(displayManagerAgent, type));
652     } else {
653         EXPECT_NE(DMError::DM_OK, screenSessionManagerProxy->UnregisterDisplayManagerAgent(displayManagerAgent, type));
654     }
655     displayManagerAgent = nullptr;
656     EXPECT_EQ(DMError::DM_ERROR_INVALID_PARAM,
657               screenSessionManagerProxy->UnregisterDisplayManagerAgent(displayManagerAgent, type));
658 }
659 
660 /**
661  * @tc.name: WakeUpBegin
662  * @tc.desc: WakeUpBegin
663  * @tc.type: FUNC
664  */
665 HWTEST_F(ScreenSessionManagerProxyUtTest, WakeUpBegin, TestSize.Level1)
666 {
667     PowerStateChangeReason reason {0};
668     bool expectation = true;
669     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
670         EXPECT_EQ(expectation, screenSessionManagerProxy->WakeUpBegin(reason));
671     } else {
672         EXPECT_NE(expectation, screenSessionManagerProxy->WakeUpBegin(reason));
673     }
674 }
675 
676 /**
677  * @tc.name: WakeUpEnd
678  * @tc.desc: WakeUpEnd
679  * @tc.type: FUNC
680  */
681 HWTEST_F(ScreenSessionManagerProxyUtTest, WakeUpEnd, TestSize.Level1)
682 {
683     bool expectation = true;
684     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
685         EXPECT_EQ(expectation, screenSessionManagerProxy->WakeUpEnd());
686     } else {
687         EXPECT_NE(expectation, screenSessionManagerProxy->WakeUpEnd());
688     }
689 }
690 
691 /**
692  * @tc.name: SuspendBegin
693  * @tc.desc: SuspendBegin
694  * @tc.type: FUNC
695  */
696 HWTEST_F(ScreenSessionManagerProxyUtTest, SuspendBegin, TestSize.Level1)
697 {
698     PowerStateChangeReason reason {0};
699     bool expectation = true;
700     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
701         EXPECT_EQ(expectation, screenSessionManagerProxy->SuspendBegin(reason));
702     } else {
703         EXPECT_NE(expectation, screenSessionManagerProxy->SuspendBegin(reason));
704     }
705 }
706 
707 /**
708  * @tc.name: SuspendEnd
709  * @tc.desc: SuspendEnd
710  * @tc.type: FUNC
711  */
712 HWTEST_F(ScreenSessionManagerProxyUtTest, SuspendEnd, TestSize.Level1)
713 {
714     bool expectation = true;
715     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
716         EXPECT_EQ(expectation, screenSessionManagerProxy->SuspendEnd());
717     } else {
718         EXPECT_NE(expectation, screenSessionManagerProxy->SuspendEnd());
719     }
720 }
721 
722 /**
723  * @tc.name: SetScreenPowerById
724  * @tc.desc: SetScreenPowerById
725  * @tc.type: FUNC
726  */
727 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenPowerById, TestSize.Level1)
728 {
729     ScreenPowerState state {0};
730     ScreenId id = 1001;
731     PowerStateChangeReason reason {1};
732 
733     bool expectation = true;
734     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
735         EXPECT_EQ(expectation, screenSessionManagerProxy->SetScreenPowerById(id, state, reason));
736     } else {
737         EXPECT_NE(expectation, screenSessionManagerProxy->SetScreenPowerById(id, state, reason));
738     }
739 }
740 
741 /**
742  * @tc.name: SetDisplayState
743  * @tc.desc: SetDisplayState
744  * @tc.type: FUNC
745  */
746 HWTEST_F(ScreenSessionManagerProxyUtTest, SetDisplayState, TestSize.Level1)
747 {
748     DisplayState state {1};
749     screenSessionManagerProxy->SetDisplayState(state);
750     int resultValue = 0;
751     ASSERT_EQ(resultValue, 0);
752 }
753 
754 /**
755  * @tc.name: SetSpecifiedScreenPower
756  * @tc.desc: SetSpecifiedScreenPower
757  * @tc.type: FUNC
758  */
759 HWTEST_F(ScreenSessionManagerProxyUtTest, SetSpecifiedScreenPower, TestSize.Level1)
760 {
761     ScreenPowerState state {0};
762     ScreenId id = 1001;
763     PowerStateChangeReason reason {1};
764     bool expectation = true;
765     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
766         EXPECT_EQ(expectation, screenSessionManagerProxy->SetSpecifiedScreenPower(id, state, reason));
767     } else {
768         EXPECT_NE(expectation, screenSessionManagerProxy->SetSpecifiedScreenPower(id, state, reason));
769     }
770 }
771 
772 /**
773  * @tc.name: SetScreenPowerForAll
774  * @tc.desc: SetScreenPowerForAll
775  * @tc.type: FUNC
776  */
777 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenPowerForAll, TestSize.Level1)
778 {
779     ScreenPowerState state {0};
780     PowerStateChangeReason reason {1};
781     bool expectation = true;
782     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
783         EXPECT_EQ(expectation, screenSessionManagerProxy->SetScreenPowerForAll(state, reason));
784     } else {
785         EXPECT_NE(expectation, screenSessionManagerProxy->SetScreenPowerForAll(state, reason));
786     }
787 }
788 
789 /**
790  * @tc.name: GetDisplayState
791  * @tc.desc: GetDisplayState
792  * @tc.type: FUNC
793  */
794 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplayState, TestSize.Level1)
795 {
796     DisplayId displayId {0};
797     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
798         EXPECT_NE(DisplayState::UNKNOWN, screenSessionManagerProxy->GetDisplayState(displayId));
799     } else {
800         EXPECT_EQ(DisplayState::UNKNOWN, screenSessionManagerProxy->GetDisplayState(displayId));
801     }
802 }
803 
804 /**
805  * @tc.name: TryToCancelScreenOff
806  * @tc.desc: TryToCancelScreenOff
807  * @tc.type: FUNC
808  */
809 HWTEST_F(ScreenSessionManagerProxyUtTest, TryToCancelScreenOff, TestSize.Level1)
810 {
811     bool expectation = true;
812     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
813         EXPECT_NE(expectation, screenSessionManagerProxy->TryToCancelScreenOff());
814     } else {
815         EXPECT_NE(expectation, screenSessionManagerProxy->TryToCancelScreenOff());
816     }
817 }
818 
819 /**
820  * @tc.name: NotifyDisplayEvent
821  * @tc.desc: NotifyDisplayEvent
822  * @tc.type: FUNC
823  */
824 HWTEST_F(ScreenSessionManagerProxyUtTest, NotifyDisplayEvent, TestSize.Level1)
825 {
826     DisplayEvent event {0};
827     int resultValue = 0;
828     std::function<void()> func = [&]()
__anon527cffe41702() 829     {
830         screenSessionManagerProxy->NotifyDisplayEvent(event);
831         resultValue = 1;
832     };
833     func();
834     ASSERT_EQ(resultValue, 1);
835 }
836 
837 /**
838  * @tc.name: GetScreenPower
839  * @tc.desc: GetScreenPower
840  * @tc.type: FUNC
841  */
842 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenPower, TestSize.Level1)
843 {
844     ScreenId dmsScreenId = 1001;
845     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
846         EXPECT_NE(ScreenPowerState::INVALID_STATE, screenSessionManagerProxy->GetScreenPower(dmsScreenId));
847     } else {
848         EXPECT_EQ(ScreenPowerState::INVALID_STATE, screenSessionManagerProxy->GetScreenPower(dmsScreenId));
849     }
850 }
851 
852 /**
853  * @tc.name: AddVirtualScreenBlockList
854  * @tc.desc: AddVirtualScreenBlockList
855  * @tc.type: FUNC
856  */
857 HWTEST_F(ScreenSessionManagerProxyUtTest, AddVirtualScreenBlockList, TestSize.Level1)
858 {
859     std::vector<int32_t> persistentIds {0, 1, 2};
860     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
861         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->AddVirtualScreenBlockList(persistentIds));
862     } else {
863         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->AddVirtualScreenBlockList(persistentIds));
864     }
865 }
866 
867 /**
868  * @tc.name: RemoveVirtualScreenBlockList
869  * @tc.desc: RemoveVirtualScreenBlockList
870  * @tc.type: FUNC
871  */
872 HWTEST_F(ScreenSessionManagerProxyUtTest, RemoveVirtualScreenBlockList, TestSize.Level1)
873 {
874     std::vector<int32_t> persistentIds {0, 1, 2};
875     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
876         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->RemoveVirtualScreenBlockList(persistentIds));
877     } else {
878         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->RemoveVirtualScreenBlockList(persistentIds));
879     }
880 }
881 
882 /**
883  * @tc.name: SetVirtualMirrorScreenCanvasRotation
884  * @tc.desc: SetVirtualMirrorScreenCanvasRotation
885  * @tc.type: FUNC
886  */
887 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualMirrorScreenCanvasRotation, TestSize.Level1)
888 {
889     ScreenId ScreenId = 1001;
890     bool canvasRotation = true;
891     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
892         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
893             screenSessionManagerProxy->SetVirtualMirrorScreenCanvasRotation(ScreenId, canvasRotation));
894     } else {
895         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
896             screenSessionManagerProxy->SetVirtualMirrorScreenCanvasRotation(ScreenId, canvasRotation));
897     }
898 }
899 
900 /**
901  * @tc.name: SetVirtualMirrorScreenScaleMode
902  * @tc.desc: SetVirtualMirrorScreenScaleMode
903  * @tc.type: FUNC
904  */
905 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualMirrorScreenScaleMode, TestSize.Level1)
906 {
907     ScreenId ScreenId = 1001;
908     ScreenScaleMode scaleMode {0};
909     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
910         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
911                 screenSessionManagerProxy->SetVirtualMirrorScreenScaleMode(ScreenId, scaleMode));
912     } else {
913         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
914                 screenSessionManagerProxy->SetVirtualMirrorScreenScaleMode(ScreenId, scaleMode));
915     }
916 }
917 
918 /**
919  * @tc.name: ResizeVirtualScreen
920  * @tc.desc: ResizeVirtualScreen
921  * @tc.type: FUNC
922  */
923 HWTEST_F(ScreenSessionManagerProxyUtTest, ResizeVirtualScreen, TestSize.Level1)
924 {
925     ScreenId ScreenId = 1001;
926     uint32_t width = 1024;
927     uint32_t height = 1024;
928     EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
929               screenSessionManagerProxy->ResizeVirtualScreen(ScreenId, width, height));
930 }
931 
932 /**
933  * @tc.name: DestroyVirtualScreen
934  * @tc.desc: DestroyVirtualScreen
935  * @tc.type: FUNC
936  */
937 HWTEST_F(ScreenSessionManagerProxyUtTest, DestroyVirtualScreen, TestSize.Level1)
938 {
939     ScreenId ScreenId = 1001;
940     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
941         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
942                 screenSessionManagerProxy->DestroyVirtualScreen(ScreenId));
943     } else {
944         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
945                 screenSessionManagerProxy->DestroyVirtualScreen(ScreenId));
946     }
947 }
948 
949 /**
950  * @tc.name: MakeMirror
951  * @tc.desc: MakeMirror
952  * @tc.type: FUNC
953  */
954 HWTEST_F(ScreenSessionManagerProxyUtTest, MakeMirror, TestSize.Level1)
955 {
956     ScreenId Id = 1001;
957     std::vector<ScreenId> mirrorScreenIds = {1003, 1004, 1005};
958     ScreenId screenGroupId = 1002;
959     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
960         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
961                 screenSessionManagerProxy->MakeMirror(Id, mirrorScreenIds, screenGroupId));
962     } else {
963         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
964                 screenSessionManagerProxy->MakeMirror(Id, mirrorScreenIds, screenGroupId));
965     }
966 }
967 
968 /**
969  * @tc.name: StopMirror
970  * @tc.desc: StopMirror
971  * @tc.type: FUNC
972  */
973 HWTEST_F(ScreenSessionManagerProxyUtTest, StopMirror, TestSize.Level1)
974 {
975     const std::vector<ScreenId> mirrorScreenIds = {1003, 1004, 1005};
976     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
977         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->StopMirror(mirrorScreenIds));
978     } else {
979         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->StopMirror(mirrorScreenIds));
980     }
981 }
982 
983 /**
984  * @tc.name: DisableMirror
985  * @tc.desc: DisableMirror
986  * @tc.type: FUNC
987  */
988 HWTEST_F(ScreenSessionManagerProxyUtTest, DisableMirror, TestSize.Level1)
989 {
990     bool disableOrNot = true;
991     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
992         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->DisableMirror(disableOrNot));
993     } else {
994         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->DisableMirror(disableOrNot));
995     }
996 }
997 
998 /**
999  * @tc.name: MakeExpand
1000  * @tc.desc: MakeExpand
1001  * @tc.type: FUNC
1002  */
1003 HWTEST_F(ScreenSessionManagerProxyUtTest, MakeExpand, TestSize.Level1)
1004 {
1005     std::vector<ScreenId> screenId = {1003, 1004, 1005};
1006     std::vector<Point> startPoint {};
1007     ScreenId screenGroupId = 1001;
1008     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1009         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
1010                 screenSessionManagerProxy->MakeExpand(screenId, startPoint, screenGroupId));
1011     } else {
1012         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
1013                 screenSessionManagerProxy->MakeExpand(screenId, startPoint, screenGroupId));
1014     }
1015 }
1016 
1017 /**
1018  * @tc.name: StopExpand
1019  * @tc.desc: StopExpand
1020  * @tc.type: FUNC
1021  */
1022 HWTEST_F(ScreenSessionManagerProxyUtTest, StopExpand, TestSize.Level1)
1023 {
1024     const std::vector<ScreenId> expandScreenIds = {1003, 1004, 1005};
1025     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1026         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->StopExpand(expandScreenIds));
1027     } else {
1028         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->StopExpand(expandScreenIds));
1029     }
1030 }
1031 
1032 /**
1033  * @tc.name: GetScreenGroupInfoById
1034  * @tc.desc: GetScreenGroupInfoById
1035  * @tc.type: FUNC
1036  */
1037 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenGroupInfoById, TestSize.Level1)
1038 {
1039     sptr<ScreenGroupInfo> expectation = nullptr;
1040     sptr<ScreenGroupInfo> res = nullptr;
1041     ScreenId Id {0};
1042     std::function<void()> func = [&]()
__anon527cffe41802() 1043     {
1044         res = screenSessionManagerProxy->GetScreenGroupInfoById(Id);
1045     };
1046     func();
1047     ASSERT_EQ(res, expectation);
1048 }
1049 
1050 /**
1051  * @tc.name: RemoveVirtualScreenFromGroup
1052  * @tc.desc: RemoveVirtualScreenFromGroup
1053  * @tc.type: FUNC
1054  */
1055 HWTEST_F(ScreenSessionManagerProxyUtTest, RemoveVirtualScreenFromGroup, TestSize.Level1)
1056 {
1057     std::vector<ScreenId> screens = {1002, 1003, 1004};
1058     screenSessionManagerProxy->RemoveVirtualScreenFromGroup(screens);
1059     auto screenSession = ScreenSessionManager::GetInstance().GetScreenSession(2000);
1060     EXPECT_EQ(screenSession, nullptr);
1061 }
1062 
1063 /**
1064  * @tc.name: GetDisplaySnapshot
1065  * @tc.desc: GetDisplaySnapshot
1066  * @tc.type: FUNC
1067  */
1068 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplaySnapshot, TestSize.Level1)
1069 {
1070     std::shared_ptr<Media::PixelMap> expectation = nullptr;
1071     std::shared_ptr<Media::PixelMap> res = nullptr;
1072     DisplayId displayId {0};
1073     DmErrorCode* errorCode = nullptr;
1074     std::function<void()> func = [&]()
__anon527cffe41902() 1075     {
1076         res = screenSessionManagerProxy->GetDisplaySnapshot(displayId, errorCode, false, false);
1077     };
1078     func();
1079     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1080         ASSERT_NE(res, expectation);
1081     } else {
1082         ASSERT_EQ(res, expectation);
1083     }
1084 }
1085 
1086 /**
1087  * @tc.name: GetDisplayInfoById
1088  * @tc.desc: GetDisplayInfoById
1089  * @tc.type: FUNC
1090  */
1091 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplayInfoById, TestSize.Level1)
1092 {
1093     sptr<DisplayInfo> expectation = nullptr;
1094     sptr<DisplayInfo> res = nullptr;
1095     DisplayId displayId {0};
1096     std::function<void()> func = [&]()
__anon527cffe41a02() 1097     {
1098         res = screenSessionManagerProxy->GetDisplayInfoById(displayId);
1099     };
1100     func();
1101     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1102         ASSERT_NE(res, expectation);
1103     } else {
1104         ASSERT_EQ(res, expectation);
1105     }
1106 }
1107 
1108 /**
1109  * @tc.name: GetDisplayInfoByScreen
1110  * @tc.desc: GetDisplayInfoByScreen
1111  * @tc.type: FUNC
1112  */
1113 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplayInfoByScreen, TestSize.Level1)
1114 {
1115     sptr<DisplayInfo> expectation = nullptr;
1116     sptr<DisplayInfo> res = nullptr;
1117     ScreenId screenId {0};
1118     std::function<void()> func = [&]()
__anon527cffe41b02() 1119     {
1120         res = screenSessionManagerProxy->GetDisplayInfoByScreen(screenId);
1121     };
1122     func();
1123     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1124         ASSERT_NE(res, expectation);
1125     } else {
1126         ASSERT_EQ(res, expectation);
1127     }
1128 }
1129 
1130 /**
1131  * @tc.name: GetAllDisplayIds
1132  * @tc.desc: GetAllDisplayIds
1133  * @tc.type: FUNC
1134  */
1135 HWTEST_F(ScreenSessionManagerProxyUtTest, GetAllDisplayIds, TestSize.Level1)
1136 {
1137     int resultValue = 0;
1138     std::function<void()> func = [&]()
__anon527cffe41c02() 1139     {
1140         screenSessionManagerProxy->GetAllDisplayIds();
1141         resultValue = 1;
1142     };
1143     func();
1144     ASSERT_EQ(resultValue, 1);
1145 }
1146 
1147 /**
1148  * @tc.name: GetScreenInfoById
1149  * @tc.desc: GetScreenInfoById
1150  * @tc.type: FUNC
1151  */
1152 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenInfoById, TestSize.Level1)
1153 {
1154     sptr<ScreenInfo> expectation = nullptr;
1155     sptr<ScreenInfo> res = nullptr;
1156     ScreenId Id {0};
1157     std::function<void()> func = [&]()
__anon527cffe41d02() 1158     {
1159         res = screenSessionManagerProxy->GetScreenInfoById(Id);
1160     };
1161     func();
1162     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1163         ASSERT_NE(res, expectation);
1164     } else {
1165         ASSERT_EQ(res, expectation);
1166     }
1167 }
1168 
1169 /**
1170  * @tc.name: GetAllScreenInfos
1171  * @tc.desc: GetAllScreenInfos
1172  * @tc.type: FUNC
1173  */
1174 HWTEST_F(ScreenSessionManagerProxyUtTest, GetAllScreenInfos, TestSize.Level1)
1175 {
1176     std::vector<sptr<ScreenInfo>> screenInfos {};
1177     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1178         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
1179                 screenSessionManagerProxy->GetAllScreenInfos(screenInfos));
1180     } else {
1181         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
1182                 screenSessionManagerProxy->GetAllScreenInfos(screenInfos));
1183     }
1184 }
1185 
1186 /**
1187  * @tc.name: GetScreenSupportedColorGamuts
1188  * @tc.desc: GetScreenSupportedColorGamuts
1189  * @tc.type: FUNC
1190  */
1191 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenSupportedColorGamuts, TestSize.Level1)
1192 {
1193     ScreenId screenId = 1001;
1194     std::vector<ScreenColorGamut> colorGamuts {};
1195     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1196         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
1197                 screenSessionManagerProxy->GetScreenSupportedColorGamuts(screenId, colorGamuts));
1198     } else {
1199         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
1200                 screenSessionManagerProxy->GetScreenSupportedColorGamuts(screenId, colorGamuts));
1201     }
1202 }
1203 
1204 /**
1205  * @tc.name: SetOrientation
1206  * @tc.desc: SetOrientation
1207  * @tc.type: FUNC
1208  */
1209 HWTEST_F(ScreenSessionManagerProxyUtTest, SetOrientation, TestSize.Level1)
1210 {
1211     ScreenId screenId = 1001;
1212     Orientation orientation = Orientation::BEGIN;
1213     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1214         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
1215                 screenSessionManagerProxy->SetOrientation(screenId, orientation));
1216     } else {
1217         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
1218                 screenSessionManagerProxy->SetOrientation(screenId, orientation));
1219     }
1220 }
1221 
1222 /**
1223  * @tc.name: SetScreenRotationLocked
1224  * @tc.desc: SetScreenRotationLocked
1225  * @tc.type: FUNC
1226  */
1227 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenRotationLocked, TestSize.Level1)
1228 {
1229     bool isLocked = true;
1230     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1231         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
1232                 screenSessionManagerProxy->SetScreenRotationLocked(isLocked));
1233     } else {
1234         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
1235                 screenSessionManagerProxy->SetScreenRotationLocked(isLocked));
1236     }
1237 }
1238 
1239 /**
1240  * @tc.name: SetScreenRotationLockedFromJs
1241  * @tc.desc: SetScreenRotationLockedFromJs
1242  * @tc.type: FUNC
1243  */
1244 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenRotationLockedFromJs, TestSize.Level1)
1245 {
1246     bool isLocked = true;
1247     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1248         ASSERT_NE(DMError::DM_ERROR_IPC_FAILED,
1249                 screenSessionManagerProxy->SetScreenRotationLockedFromJs(isLocked));
1250     } else {
1251         ASSERT_EQ(DMError::DM_ERROR_IPC_FAILED,
1252                 screenSessionManagerProxy->SetScreenRotationLockedFromJs(isLocked));
1253     }
1254 }
1255 
1256 /**
1257  * @tc.name: SetMultiScreenMode
1258  * @tc.desc: SetMultiScreenMode
1259  * @tc.type: FUNC
1260  */
1261 HWTEST_F(ScreenSessionManagerProxyUtTest, SetMultiScreenMode, TestSize.Level1)
1262 {
1263     ScreenId mainScreenId = 0;
1264     ScreenId secondaryScreenId = 1;
1265     MultiScreenMode screenMode = MultiScreenMode::SCREEN_EXTEND;
1266 
1267     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
1268     std::function<void()> func = [&]()
__anon527cffe41e02() 1269     {
1270         res = screenSessionManagerProxy->SetMultiScreenMode(mainScreenId, secondaryScreenId, screenMode);
1271     };
1272     func();
1273     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1274         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
1275     } else {
1276         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
1277     }
1278 }
1279 
1280 /**
1281  * @tc.name: SetMultiScreenRelativePosition
1282  * @tc.desc: SetMultiScreenRelativePosition
1283  * @tc.type: FUNC
1284  */
1285 HWTEST_F(ScreenSessionManagerProxyUtTest, SetMultiScreenRelativePosition, TestSize.Level1)
1286 {
1287     ScreenId testId = 2060;
1288     ScreenId testId1 = 3060;
1289     MultiScreenPositionOptions mainScreenOptions = {testId, 100, 100};
1290     MultiScreenPositionOptions secondScreenOption = {testId1, 100, 100};
1291 
1292     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
1293     std::function<void()> func = [&]()
__anon527cffe41f02() 1294     {
1295         res = screenSessionManagerProxy->SetMultiScreenRelativePosition(mainScreenOptions, secondScreenOption);
1296     };
1297     func();
1298     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1299         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
1300     } else {
1301         ASSERT_EQ(res, DMError::DM_ERROR_IPC_FAILED);
1302     }
1303 }
1304 
1305 /**
1306  * @tc.name: SetVirtualScreenMaxRefreshRate
1307  * @tc.desc: SetVirtualScreenMaxRefreshRate
1308  * @tc.type: FUNC
1309  */
1310 HWTEST_F(ScreenSessionManagerProxyUtTest, SetVirtualScreenMaxRefreshRate, TestSize.Level1)
1311 {
1312     ScreenId id = 0;
1313     uint32_t refreshRate = 12;
1314     uint32_t actualRefreshRate = 0;
1315 
1316     DMError res = DMError::DM_ERROR_NOT_SYSTEM_APP;
1317     std::function<void()> func = [&]()
__anon527cffe42002() 1318     {
1319         res = screenSessionManagerProxy->SetVirtualScreenMaxRefreshRate(id, refreshRate, actualRefreshRate);
1320     };
1321     func();
1322     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1323         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
1324     } else {
1325         ASSERT_NE(res, DMError::DM_ERROR_IPC_FAILED);
1326     }
1327 }
1328 
1329 /**
1330  * @tc.name: IsScreenRotationLocked
1331  * @tc.desc: IsScreenRotationLocked
1332  * @tc.type: FUNC
1333  */
1334 HWTEST_F(ScreenSessionManagerProxyUtTest, IsScreenRotationLocked, TestSize.Level1)
1335 {
1336     bool isLocked = true;
1337     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1338         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
1339                 screenSessionManagerProxy->IsScreenRotationLocked(isLocked));
1340     } else {
1341         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
1342                 screenSessionManagerProxy->IsScreenRotationLocked(isLocked));
1343     }
1344 }
1345 
1346 /**
1347  * @tc.name: GetCutoutInfo
1348  * @tc.desc: GetCutoutInfo
1349  * @tc.type: FUNC
1350  */
1351 HWTEST_F(ScreenSessionManagerProxyUtTest, GetCutoutInfo, TestSize.Level1)
1352 {
1353     sptr<CutoutInfo> expectation = nullptr;
1354     sptr<CutoutInfo> res = nullptr;
1355     DisplayId displayId = 0;
1356     std::function<void()> func = [&]()
__anon527cffe42102() 1357     {
1358         res = screenSessionManagerProxy->GetCutoutInfo(displayId);
1359     };
1360     func();
1361     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1362         ASSERT_NE(res, expectation);
1363     } else {
1364         ASSERT_EQ(res, expectation);
1365     }
1366 }
1367 
1368 /**
1369  * @tc.name: HasImmersiveWindow
1370  * @tc.desc: HasImmersiveWindow
1371  * @tc.type: FUNC
1372  */
1373 HWTEST_F(ScreenSessionManagerProxyUtTest, HasImmersiveWindow, TestSize.Level1)
1374 {
1375     bool immersive = true;
1376     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1377         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->HasImmersiveWindow(0u, immersive));
1378     } else {
1379         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->HasImmersiveWindow(0u, immersive));
1380     }
1381 }
1382 
1383 /**
1384  * @tc.name: ConvertScreenIdToRsScreenId
1385  * @tc.desc: ConvertScreenIdToRsScreenId
1386  * @tc.type: FUNC
1387  */
1388 HWTEST_F(ScreenSessionManagerProxyUtTest, ConvertScreenIdToRsScreenId, TestSize.Level1)
1389 {
1390     ScreenId screenId = 1001;
1391     ScreenId rsScreenId = 1002;
1392     auto ret = screenSessionManagerProxy->ConvertScreenIdToRsScreenId(screenId, rsScreenId);
1393     EXPECT_EQ(ret, false);
1394 }
1395 
1396 /**
1397  * @tc.name: HasPrivateWindow
1398  * @tc.desc: HasPrivateWindow
1399  * @tc.type: FUNC
1400  */
1401 HWTEST_F(ScreenSessionManagerProxyUtTest, HasPrivateWindow, TestSize.Level1)
1402 {
1403     bool hasPrivateWindow = true;
1404     DisplayId displayId = 0;
1405     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1406         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
1407                 screenSessionManagerProxy->HasPrivateWindow(displayId, hasPrivateWindow));
1408     } else {
1409         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
1410                 screenSessionManagerProxy->HasPrivateWindow(displayId, hasPrivateWindow));
1411     }
1412 }
1413 
1414 /**
1415  * @tc.name: DumpAllScreensInfo
1416  * @tc.desc: DumpAllScreensInfo
1417  * @tc.type: FUNC
1418  */
1419 HWTEST_F(ScreenSessionManagerProxyUtTest, DumpAllScreensInfo, TestSize.Level1)
1420 {
1421     std::string dumpInfo;
1422     screenSessionManagerProxy->DumpAllScreensInfo(dumpInfo);
1423     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1424         EXPECT_NE(dumpInfo, "");
1425     } else {
1426         EXPECT_EQ(dumpInfo, "");
1427     }
1428 }
1429 
1430 /**
1431  * @tc.name: DumpSpecialScreenInfo
1432  * @tc.desc: DumpSpecialScreenInfo
1433  * @tc.type: FUNC
1434  */
1435 HWTEST_F(ScreenSessionManagerProxyUtTest, DumpSpecialScreenInfo, TestSize.Level1)
1436 {
1437     ScreenId id = 1001;
1438     std::string dumpInfo;
1439     screenSessionManagerProxy->DumpSpecialScreenInfo(id, dumpInfo);
1440     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1441         EXPECT_NE(dumpInfo, "");
1442     } else {
1443         EXPECT_EQ(dumpInfo, "");
1444     }
1445 }
1446 
1447 /**
1448  * @tc.name: SetFoldDisplayMode
1449  * @tc.desc: SetFoldDisplayMode
1450  * @tc.type: FUNC
1451  */
1452 HWTEST_F(ScreenSessionManagerProxyUtTest, SetFoldDisplayMode, TestSize.Level1)
1453 {
1454     FoldDisplayMode displayMode = FoldDisplayMode::UNKNOWN;
1455     screenSessionManagerProxy->SetFoldDisplayMode(displayMode);
1456     if (screenSessionManagerProxy->IsFoldable() && !FoldScreenStateInternel::IsSuperFoldDisplayDevice()) {
1457         EXPECT_NE(ScreenSessionManager::GetInstance().foldScreenController_, nullptr);
1458     } else {
1459         EXPECT_EQ(ScreenSessionManager::GetInstance().foldScreenController_, nullptr);
1460     }
1461 }
1462 
1463 /**
1464  * @tc.name: SetFoldDisplayModeFromJs
1465  * @tc.desc: SetFoldDisplayModeFromJs
1466  * @tc.type: FUNC
1467  */
1468 HWTEST_F(ScreenSessionManagerProxyUtTest, SetFoldDisplayModeFromJs, TestSize.Level1)
1469 {
1470     FoldDisplayMode displayMode = FoldDisplayMode::UNKNOWN;
1471     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1472         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->SetFoldDisplayModeFromJs(displayMode));
1473     } else {
1474         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED, screenSessionManagerProxy->SetFoldDisplayModeFromJs(displayMode));
1475     }
1476 }
1477 
1478 /**
1479  * @tc.name: SetFoldStatusLocked
1480  * @tc.desc: SetFoldStatusLocked
1481  * @tc.type: FUNC
1482  */
1483 HWTEST_F(ScreenSessionManagerProxyUtTest, SetFoldStatusLocked, TestSize.Level1)
1484 {
1485     bool locked = true;
1486     screenSessionManagerProxy->SetFoldStatusLocked(locked);
1487     if (screenSessionManagerProxy->IsFoldable() && !FoldScreenStateInternel::IsSuperFoldDisplayDevice()) {
1488         EXPECT_NE(ScreenSessionManager::GetInstance().foldScreenController_, nullptr);
1489     } else {
1490         EXPECT_EQ(ScreenSessionManager::GetInstance().foldScreenController_, nullptr);
1491     }
1492 }
1493 
1494 /**
1495  * @tc.name: GetFoldDisplayMode
1496  * @tc.desc: GetFoldDisplayMode
1497  * @tc.type: FUNC
1498  */
1499 HWTEST_F(ScreenSessionManagerProxyUtTest, GetFoldDisplayMode, TestSize.Level1)
1500 {
1501     EXPECT_EQ(FoldDisplayMode::UNKNOWN, screenSessionManagerProxy->GetFoldDisplayMode());
1502 }
1503 
1504 /**
1505  * @tc.name: IsFoldable
1506  * @tc.desc: IsFoldable
1507  * @tc.type: FUNC
1508  */
1509 HWTEST_F(ScreenSessionManagerProxyUtTest, IsFoldable, TestSize.Level1)
1510 {
1511     screenSessionManagerProxy->IsFoldable();
1512     auto screenSession = ScreenSessionManager::GetInstance().GetScreenSession(2000);
1513     EXPECT_EQ(screenSession, nullptr);
1514 }
1515 
1516 /**
1517  * @tc.name: IsCaptured
1518  * @tc.desc: IsCaptured
1519  * @tc.type: FUNC
1520  */
1521 HWTEST_F(ScreenSessionManagerProxyUtTest, IsCaptured, TestSize.Level1)
1522 {
1523     auto ret = screenSessionManagerProxy->IsCaptured();
1524     EXPECT_EQ(ret, false);
1525 }
1526 
1527 /**
1528  * @tc.name: GetFoldStatus
1529  * @tc.desc: GetFoldStatus
1530  * @tc.type: FUNC
1531  */
1532 HWTEST_F(ScreenSessionManagerProxyUtTest, GetFoldStatus, TestSize.Level1)
1533 {
1534     auto foldStatus = screenSessionManagerProxy->GetFoldStatus();
1535     EXPECT_EQ(foldStatus, FoldStatus::UNKNOWN);
1536 }
1537 
1538 /**
1539  * @tc.name: GetSuperFoldStatus
1540  * @tc.desc: GetSuperFoldStatus
1541  * @tc.type: FUNC
1542  */
1543 HWTEST_F(ScreenSessionManagerProxyUtTest, GetSuperFoldStatus, TestSize.Level1)
1544 {
1545     auto superFoldStatus = screenSessionManagerProxy->GetSuperFoldStatus();
1546     EXPECT_EQ(superFoldStatus, SuperFoldStatus::UNKNOWN);
1547 }
1548 
1549 /**
1550  * @tc.name: SetLandscapeLockStatus
1551  * @tc.desc: SetLandscapeLockStatus
1552  * @tc.type: FUNC
1553  */
1554 HWTEST_F(ScreenSessionManagerProxyUtTest, SetLandscapeLockStatus, Function | SmallTest | Level1)
1555 {
1556     bool isLocked = false;
1557     screenSessionManagerProxy->SetLandscapeLockStatus(isLocked);
1558     EXPECT_EQ(isLocked, false);
1559 }
1560 
1561 /**
1562  * @tc.name: GetCurrentFoldCreaseRegion
1563  * @tc.desc: GetCurrentFoldCreaseRegion
1564  * @tc.type: FUNC
1565  */
1566 HWTEST_F(ScreenSessionManagerProxyUtTest, GetCurrentFoldCreaseRegion, TestSize.Level1)
1567 {
1568     auto foldCreaseRegion = screenSessionManagerProxy->GetCurrentFoldCreaseRegion();
1569     EXPECT_EQ(foldCreaseRegion, nullptr);
1570 }
1571 
1572 /**
1573  * @tc.name: MakeUniqueScreen
1574  * @tc.desc: MakeUniqueScreen
1575  * @tc.type: FUNC
1576  */
1577 HWTEST_F(ScreenSessionManagerProxyUtTest, MakeUniqueScreen, TestSize.Level1)
1578 {
1579     const std::vector<ScreenId> screenIds {1001, 1002, 1003};
1580     std::vector<DisplayId> displayIds;
1581     EXPECT_EQ(DMError::DM_ERROR_NULLPTR, screenSessionManagerProxy->MakeUniqueScreen(screenIds, displayIds));
1582 }
1583 
1584 /**
1585  * @tc.name: SetClient
1586  * @tc.desc: SetClient
1587  * @tc.type: FUNC
1588  */
1589 HWTEST_F(ScreenSessionManagerProxyUtTest, SetClient, TestSize.Level1)
1590 {
1591     const sptr<IScreenSessionManagerClient> client = nullptr;
1592     screenSessionManagerProxy->SetClient(client);
1593     EXPECT_EQ(client, nullptr);
1594 }
1595 
1596 /**
1597  * @tc.name: SwitchUser
1598  * @tc.desc: SwitchUser
1599  * @tc.type: FUNC
1600  */
1601 HWTEST_F(ScreenSessionManagerProxyUtTest, SwitchUser, TestSize.Level1)
1602 {
1603     screenSessionManagerProxy->SwitchUser();
1604     auto screenSession = ScreenSessionManager::GetInstance().GetScreenSession(2000);
1605     EXPECT_EQ(screenSession, nullptr);
1606 }
1607 
1608 /**
1609  * @tc.name: GetScreenProperty
1610  * @tc.desc: GetScreenProperty
1611  * @tc.type: FUNC
1612  */
1613 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenProperty, TestSize.Level1)
1614 {
1615     ScreenId screenId = 1001;
1616     screenSessionManagerProxy->GetScreenProperty(screenId);
1617     auto screenSession = ScreenSessionManager::GetInstance().GetScreenSession(2000);
1618     EXPECT_EQ(screenSession, nullptr);
1619 }
1620 
1621 /**
1622  * @tc.name: GetDisplayHookInfo
1623  * @tc.desc: GetDisplayHookInfo
1624  * @tc.type: FUNC
1625  */
1626 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplayHookInfo, Function | SmallTest | Level1)
1627 {
1628     int32_t uid = 0;
1629     DMHookInfo hookInfo;
1630     hookInfo.height_ = 1344;
1631     hookInfo.width_ = 2772;
1632     std::function<void()> func = [&]()
__anon527cffe42202() 1633     {
1634         screenSessionManagerProxy->GetDisplayHookInfo(uid, hookInfo);
1635     };
1636     func();
1637 
1638     EXPECT_EQ(hookInfo.height_, 1344);
1639     EXPECT_EQ(hookInfo.width_, 2772);
1640 }
1641 
1642 /**
1643  * @tc.name: GetScreenCapture
1644  * @tc.desc: GetScreenCapture test
1645  * @tc.type: FUNC
1646  */
1647 HWTEST_F(ScreenSessionManagerProxyUtTest, GetScreenCapture, TestSize.Level1)
1648 {
1649     ASSERT_TRUE(screenSessionManagerProxy != nullptr);
1650 
1651     std::shared_ptr<Media::PixelMap> res = nullptr;
1652     CaptureOption option;
1653     option.displayId_ = 0;
1654     DmErrorCode errorCode = DmErrorCode::DM_OK;
__anon527cffe42302() 1655     std::function<void()> func = [&]() {
1656         res = screenSessionManagerProxy->GetScreenCapture(option, &errorCode);
1657     };
1658     func();
1659     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1660         if (errorCode == DmErrorCode::DM_OK) {
1661             ASSERT_NE(res, nullptr);
1662         } else {
1663             ASSERT_EQ(res, nullptr);
1664         }
1665     } else {
1666         ASSERT_EQ(res, nullptr);
1667     }
1668 }
1669 
1670 /**
1671  * @tc.name: GetPrimaryDisplayInfo
1672  * @tc.desc: GetPrimaryDisplayInfo test
1673  * @tc.type: FUNC
1674  */
1675 HWTEST_F(ScreenSessionManagerProxyUtTest, GetPrimaryDisplayInfo, TestSize.Level1)
1676 {
1677     ASSERT_TRUE(screenSessionManagerProxy != nullptr);
1678 
1679     sptr<DisplayInfo> res = nullptr;
__anon527cffe42402() 1680     std::function<void()> func = [&]() {
1681         res = screenSessionManagerProxy->GetPrimaryDisplayInfo();
1682     };
1683     func();
1684     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1685         ASSERT_NE(res, nullptr);
1686     } else {
1687         ASSERT_EQ(res, nullptr);
1688     }
1689 }
1690 
1691 /**
1692  * @tc.name: SetScreenSkipProtectedWindow
1693  * @tc.desc: SetScreenSkipProtectedWindow test
1694  * @tc.type: FUNC
1695  */
1696 HWTEST_F(ScreenSessionManagerProxyUtTest, SetScreenSkipProtectedWindow, TestSize.Level1)
1697 {
1698     ASSERT_TRUE(screenSessionManagerProxy != nullptr);
1699 
1700     const std::vector<ScreenId> screenIds = {1001, 1002};
1701     bool isEnable = true;
1702     int resultValue = 0;
__anon527cffe42502() 1703     std::function<void()> func = [&]() {
1704         screenSessionManagerProxy->SetScreenSkipProtectedWindow(screenIds, isEnable);
1705         resultValue = 1;
1706     };
1707     func();
1708     ASSERT_EQ(resultValue, 1);
1709 }
1710 
1711 /**
1712  * @tc.name: GetDisplayCapability
1713  * @tc.desc: GetDisplayCapability test
1714  * @tc.type: FUNC
1715  */
1716 HWTEST_F(ScreenSessionManagerProxyUtTest, GetDisplayCapability, TestSize.Level1)
1717 {
1718     ASSERT_TRUE(screenSessionManagerProxy != nullptr);
1719     std::string capabilitInfo;
1720     if (SceneBoardJudgement::IsSceneBoardEnabled()) {
1721         EXPECT_NE(DMError::DM_ERROR_IPC_FAILED,
1722                 screenSessionManagerProxy->GetDisplayCapability(capabilitInfo));
1723     } else {
1724         EXPECT_EQ(DMError::DM_ERROR_IPC_FAILED,
1725                 screenSessionManagerProxy->GetDisplayCapability(capabilitInfo));
1726     }
1727 }
1728 }
1729 }
1730