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 <message_option.h>
18 #include <message_parcel.h>
19 #include <common/rs_rect.h>
20 #include <transaction/rs_marshalling_helper.h>
21
22 #include "session_manager/include/scene_session_manager.h"
23 #include "session_manager/include/zidl/scene_session_manager_interface.h"
24 #include "window_manager_agent.h"
25 #include "zidl/screen_session_manager_stub.h"
26 #include "zidl/window_manager_agent_interface.h"
27
28 using namespace testing;
29 using namespace testing::ext;
30 namespace OHOS {
31 namespace Rosen {
32 namespace {
33 constexpr uint32_t SLEEP_TIME_IN_US = 100000; // 100ms
34 }
35 class ScreenSessionManagerStubTest : public testing::Test {
36 public:
37 static void SetUpTestCase();
38 static void TearDownTestCase();
39 void SetUp() override;
40 void TearDown() override;
41 sptr<ScreenSessionManagerStub> stub_;
42 };
43
SetUpTestCase()44 void ScreenSessionManagerStubTest::SetUpTestCase()
45 {
46 }
47
TearDownTestCase()48 void ScreenSessionManagerStubTest::TearDownTestCase()
49 {
50 usleep(SLEEP_TIME_IN_US);
51 }
52
SetUp()53 void ScreenSessionManagerStubTest::SetUp()
54 {
55 stub_ = new ScreenSessionManagerStub();
56 }
57
TearDown()58 void ScreenSessionManagerStubTest::TearDown()
59 {
60 }
61
62 namespace {
63 /**
64 * @tc.name: OnRemoteRequest01
65 * @tc.desc: normal function
66 * @tc.type: FUNC
67 */
68 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest01, Function | SmallTest | Level2)
69 {
70 MessageParcel data;
71 MessageParcel reply;
72 MessageOption option;
73
74 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
75 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
76 data.WriteUint32(static_cast<uint32_t>(type));
77 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
78 data.WriteRemoteObject(windowManagerAgent->AsObject());
79
80 uint32_t code = static_cast<uint32_t>(
81 DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO);
82
83 int res = stub_->OnRemoteRequest(code, data, reply, option);
84 EXPECT_EQ(res, 0);
85 }
86
87 /**
88 * @tc.name: OnRemoteRequest02
89 * @tc.desc: normal function
90 * @tc.type: FUNC
91 */
92 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest02, Function | SmallTest | Level2)
93 {
94 MessageParcel data;
95 MessageParcel reply;
96 MessageOption option;
97
98 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
99 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
100 data.WriteUint32(static_cast<uint32_t>(type));
101 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
102 data.WriteRemoteObject(windowManagerAgent->AsObject());
103
104 uint32_t code = static_cast<uint32_t>(
105 DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT);
106
107 int res = stub_->OnRemoteRequest(code, data, reply, option);
108 EXPECT_EQ(res, -1);
109 }
110
111 /**
112 * @tc.name: OnRemoteRequest03
113 * @tc.desc: normal function
114 * @tc.type: FUNC
115 */
116 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest03, Function | SmallTest | Level2)
117 {
118 MessageParcel data;
119 MessageParcel reply;
120 MessageOption option;
121
122 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
123 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
124 data.WriteUint32(static_cast<uint32_t>(type));
125 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
126 data.WriteRemoteObject(windowManagerAgent->AsObject());
127
128 uint32_t code = static_cast<uint32_t>(
129 DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT);
130
131 int res = stub_->OnRemoteRequest(code, data, reply, option);
132 EXPECT_EQ(res, -1);
133 }
134
135 /**
136 * @tc.name: OnRemoteRequest04
137 * @tc.desc: normal function
138 * @tc.type: FUNC
139 */
140 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest04, Function | SmallTest | Level2)
141 {
142 MessageParcel data;
143 MessageParcel reply;
144 MessageOption option;
145
146 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
147 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
148 data.WriteUint32(static_cast<uint32_t>(type));
149 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
150 data.WriteRemoteObject(windowManagerAgent->AsObject());
151
152 uint32_t code = static_cast<uint32_t>(
153 DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN);
154
155 int res = stub_->OnRemoteRequest(code, data, reply, option);
156 EXPECT_EQ(res, 0);
157 }
158
159 /**
160 * @tc.name: OnRemoteRequest05
161 * @tc.desc: normal function
162 * @tc.type: FUNC
163 */
164 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest05, Function | SmallTest | Level2)
165 {
166 MessageParcel data;
167 MessageParcel reply;
168 MessageOption option;
169
170 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
171 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
172 data.WriteUint32(static_cast<uint32_t>(type));
173 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
174 data.WriteRemoteObject(windowManagerAgent->AsObject());
175
176 uint32_t code = static_cast<uint32_t>(
177 DisplayManagerMessage::TRANS_ID_WAKE_UP_END);
178
179 int res = stub_->OnRemoteRequest(code, data, reply, option);
180 EXPECT_EQ(res, 0);
181 }
182
183 /**
184 * @tc.name: OnRemoteRequest06
185 * @tc.desc: normal function
186 * @tc.type: FUNC
187 */
188 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest06, Function | SmallTest | Level2)
189 {
190 MessageParcel data;
191 MessageParcel reply;
192 MessageOption option;
193
194 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
195 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
196 data.WriteUint32(static_cast<uint32_t>(type));
197 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
198 data.WriteRemoteObject(windowManagerAgent->AsObject());
199
200 uint32_t code = static_cast<uint32_t>(
201 DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN);
202
203 int res = stub_->OnRemoteRequest(code, data, reply, option);
204 EXPECT_EQ(res, 0);
205 }
206
207 /**
208 * @tc.name: OnRemoteRequest07
209 * @tc.desc: normal function
210 * @tc.type: FUNC
211 */
212 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest07, Function | SmallTest | Level2)
213 {
214 MessageParcel data;
215 MessageParcel reply;
216 MessageOption option;
217
218 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
219 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
220 data.WriteUint32(static_cast<uint32_t>(type));
221 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
222 data.WriteRemoteObject(windowManagerAgent->AsObject());
223
224 uint32_t code = static_cast<uint32_t>(
225 DisplayManagerMessage::TRANS_ID_SUSPEND_END);
226
227 int res = stub_->OnRemoteRequest(code, data, reply, option);
228 EXPECT_EQ(res, 0);
229 }
230
231 /**
232 * @tc.name: OnRemoteRequest08
233 * @tc.desc: normal function
234 * @tc.type: FUNC
235 */
236 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest08, Function | SmallTest | Level2)
237 {
238 MessageParcel data;
239 MessageParcel reply;
240 MessageOption option;
241
242 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
243 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
244 data.WriteUint32(static_cast<uint32_t>(type));
245 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
246 data.WriteRemoteObject(windowManagerAgent->AsObject());
247
248 uint32_t code = static_cast<uint32_t>(
249 DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE);
250
251 int res = stub_->OnRemoteRequest(code, data, reply, option);
252 EXPECT_EQ(res, 0);
253 }
254
255 /**
256 * @tc.name: OnRemoteRequest09
257 * @tc.desc: normal function
258 * @tc.type: FUNC
259 */
260 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest09, Function | SmallTest | Level2)
261 {
262 MessageParcel data;
263 MessageParcel reply;
264 MessageOption option;
265
266 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
267 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
268 data.WriteUint32(static_cast<uint32_t>(type));
269 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
270 data.WriteRemoteObject(windowManagerAgent->AsObject());
271
272 uint32_t code = static_cast<uint32_t>(
273 DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL);
274
275 int res = stub_->OnRemoteRequest(code, data, reply, option);
276 EXPECT_EQ(res, 0);
277 }
278
279 /**
280 * @tc.name: OnRemoteRequest10
281 * @tc.desc: normal function
282 * @tc.type: FUNC
283 */
284 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest10, Function | SmallTest | Level2)
285 {
286 MessageParcel data;
287 MessageParcel reply;
288 MessageOption option;
289
290 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
291 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
292 data.WriteUint32(static_cast<uint32_t>(type));
293 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
294 data.WriteRemoteObject(windowManagerAgent->AsObject());
295
296 uint32_t code = static_cast<uint32_t>(
297 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE);
298
299 int res = stub_->OnRemoteRequest(code, data, reply, option);
300 EXPECT_EQ(res, 0);
301 }
302
303 /**
304 * @tc.name: OnRemoteRequest11
305 * @tc.desc: normal function
306 * @tc.type: FUNC
307 */
308 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest11, Function | SmallTest | Level2)
309 {
310 MessageParcel data;
311 MessageParcel reply;
312 MessageOption option;
313
314 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
315 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
316 data.WriteUint32(static_cast<uint32_t>(type));
317 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
318 data.WriteRemoteObject(windowManagerAgent->AsObject());
319
320 uint32_t code = static_cast<uint32_t>(
321 DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT);
322
323 int res = stub_->OnRemoteRequest(code, data, reply, option);
324 EXPECT_EQ(res, 0);
325 }
326
327 /**
328 * @tc.name: OnRemoteRequest12
329 * @tc.desc: normal function
330 * @tc.type: FUNC
331 */
332 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest12, Function | SmallTest | Level2)
333 {
334 MessageParcel data;
335 MessageParcel reply;
336 MessageOption option;
337
338 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
339 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
340 data.WriteUint32(static_cast<uint32_t>(type));
341 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
342 data.WriteRemoteObject(windowManagerAgent->AsObject());
343
344 uint32_t code = static_cast<uint32_t>(
345 DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
346
347 int res = stub_->OnRemoteRequest(code, data, reply, option);
348 EXPECT_EQ(res, -1);
349 }
350
351 /**
352 * @tc.name: OnRemoteRequest13
353 * @tc.desc: normal function
354 * @tc.type: FUNC
355 */
356 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest13, Function | SmallTest | Level2)
357 {
358 MessageParcel data;
359 MessageParcel reply;
360 MessageOption option;
361
362 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
363 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
364 data.WriteUint32(static_cast<uint32_t>(type));
365 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
366 data.WriteRemoteObject(windowManagerAgent->AsObject());
367
368 uint32_t code = static_cast<uint32_t>(
369 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID);
370
371 int res = stub_->OnRemoteRequest(code, data, reply, option);
372 EXPECT_EQ(res, 0);
373 }
374
375 /**
376 * @tc.name: OnRemoteRequest14
377 * @tc.desc: normal function
378 * @tc.type: FUNC
379 */
380 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest14, Function | SmallTest | Level2)
381 {
382 MessageParcel data;
383 MessageParcel reply;
384 MessageOption option;
385
386 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
387 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
388 data.WriteUint32(static_cast<uint32_t>(type));
389 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
390 data.WriteRemoteObject(windowManagerAgent->AsObject());
391
392 uint32_t code = static_cast<uint32_t>(
393 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN);
394
395 int res = stub_->OnRemoteRequest(code, data, reply, option);
396 EXPECT_EQ(res, 0);
397 }
398
399 /**
400 * @tc.name: OnRemoteRequest15
401 * @tc.desc: normal function
402 * @tc.type: FUNC
403 */
404 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest15, Function | SmallTest | Level2)
405 {
406 MessageParcel data;
407 MessageParcel reply;
408 MessageOption option;
409
410 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
411 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
412 data.WriteUint32(static_cast<uint32_t>(type));
413 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
414 data.WriteRemoteObject(windowManagerAgent->AsObject());
415
416 uint32_t code = static_cast<uint32_t>(
417 DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS);
418
419 int res = stub_->OnRemoteRequest(code, data, reply, option);
420 EXPECT_EQ(res, 0);
421 }
422
423 /**
424 * @tc.name: OnRemoteRequest16
425 * @tc.desc: normal function
426 * @tc.type: FUNC
427 */
428 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest16, Function | SmallTest | Level2)
429 {
430 MessageParcel data;
431 MessageParcel reply;
432 MessageOption option;
433
434 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
435 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
436 data.WriteUint32(static_cast<uint32_t>(type));
437 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
438 data.WriteRemoteObject(windowManagerAgent->AsObject());
439
440 uint32_t code = static_cast<uint32_t>(
441 DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID);
442
443 int res = stub_->OnRemoteRequest(code, data, reply, option);
444 EXPECT_EQ(res, 0);
445 }
446
447 /**
448 * @tc.name: OnRemoteRequest17
449 * @tc.desc: normal function
450 * @tc.type: FUNC
451 */
452 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest17, Function | SmallTest | Level2)
453 {
454 MessageParcel data;
455 MessageParcel reply;
456 MessageOption option;
457
458 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
459 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
460 data.WriteUint32(static_cast<uint32_t>(type));
461 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
462 data.WriteRemoteObject(windowManagerAgent->AsObject());
463
464 uint32_t code = static_cast<uint32_t>(
465 DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS);
466
467 int res = stub_->OnRemoteRequest(code, data, reply, option);
468 EXPECT_EQ(res, 0);
469 }
470
471 /**
472 * @tc.name: OnRemoteRequest18
473 * @tc.desc: normal function
474 * @tc.type: FUNC
475 */
476 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest18, Function | SmallTest | Level2)
477 {
478 MessageParcel data;
479 MessageParcel reply;
480 MessageOption option;
481
482 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
483 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
484 data.WriteUint32(static_cast<uint32_t>(type));
485 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
486 data.WriteRemoteObject(windowManagerAgent->AsObject());
487
488 uint32_t code = static_cast<uint32_t>(
489 DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS);
490
491 int res = stub_->OnRemoteRequest(code, data, reply, option);
492 EXPECT_EQ(res, 0);
493 }
494
495 /**
496 * @tc.name: OnRemoteRequest19
497 * @tc.desc: normal function
498 * @tc.type: FUNC
499 */
500 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest19, Function | SmallTest | Level2)
501 {
502 MessageParcel data;
503 MessageParcel reply;
504 MessageOption option;
505
506 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
507 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
508 data.WriteUint32(static_cast<uint32_t>(type));
509 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
510 data.WriteRemoteObject(windowManagerAgent->AsObject());
511
512 uint32_t code = static_cast<uint32_t>(
513 DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN);
514
515 int res = stub_->OnRemoteRequest(code, data, reply, option);
516 EXPECT_EQ(res, 0);
517 }
518
519 /**
520 * @tc.name: OnRemoteRequest20
521 * @tc.desc: normal function
522 * @tc.type: FUNC
523 */
524 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest20, Function | SmallTest | Level2)
525 {
526 MessageParcel data;
527 MessageParcel reply;
528 MessageOption option;
529
530 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
531 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
532 data.WriteUint32(static_cast<uint32_t>(type));
533 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
534 data.WriteRemoteObject(windowManagerAgent->AsObject());
535
536 uint32_t code = static_cast<uint32_t>(
537 DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
538
539 int res = stub_->OnRemoteRequest(code, data, reply, option);
540 EXPECT_EQ(res, 0);
541 }
542
543 /**
544 * @tc.name: OnRemoteRequest21
545 * @tc.desc: normal function
546 * @tc.type: FUNC
547 */
548 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest21, Function | SmallTest | Level2)
549 {
550 MessageParcel data;
551 MessageParcel reply;
552 MessageOption option;
553
554 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
555 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
556 data.WriteUint32(static_cast<uint32_t>(type));
557 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
558 data.WriteRemoteObject(windowManagerAgent->AsObject());
559
560 uint32_t code = static_cast<uint32_t>(
561 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO);
562
563 int res = stub_->OnRemoteRequest(code, data, reply, option);
564 EXPECT_EQ(res, 0);
565 }
566
567 /**
568 * @tc.name: OnRemoteRequest22
569 * @tc.desc: normal function
570 * @tc.type: FUNC
571 */
572 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest22, Function | SmallTest | Level2)
573 {
574 MessageParcel data;
575 MessageParcel reply;
576 MessageOption option;
577
578 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
579 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
580 data.WriteUint32(static_cast<uint32_t>(type));
581 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
582 data.WriteRemoteObject(windowManagerAgent->AsObject());
583
584 uint32_t code = static_cast<uint32_t>(
585 DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
586
587 int res = stub_->OnRemoteRequest(code, data, reply, option);
588 EXPECT_EQ(res, 0);
589 }
590
591 /**
592 * @tc.name: OnRemoteRequest23
593 * @tc.desc: normal function
594 * @tc.type: FUNC
595 */
596 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest23, Function | SmallTest | Level2)
597 {
598 MessageParcel data;
599 MessageParcel reply;
600 MessageOption option;
601
602 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
603 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
604 data.WriteUint32(static_cast<uint32_t>(type));
605 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
606 data.WriteRemoteObject(windowManagerAgent->AsObject());
607
608 uint32_t code = static_cast<uint32_t>(
609 DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR);
610
611 int res = stub_->OnRemoteRequest(code, data, reply, option);
612 EXPECT_EQ(res, 0);
613 }
614
615 /**
616 * @tc.name: OnRemoteRequest24
617 * @tc.desc: normal function
618 * @tc.type: FUNC
619 */
620 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest24, Function | SmallTest | Level2)
621 {
622 MessageParcel data;
623 MessageParcel reply;
624 MessageOption option;
625
626 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
627 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
628 data.WriteUint32(static_cast<uint32_t>(type));
629 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
630 data.WriteRemoteObject(windowManagerAgent->AsObject());
631
632 uint32_t code = static_cast<uint32_t>(
633 DisplayManagerMessage::TRANS_ID_SCREEN_STOP_MIRROR);
634
635 int res = stub_->OnRemoteRequest(code, data, reply, option);
636 EXPECT_EQ(res, 0);
637 }
638
639 /**
640 * @tc.name: OnRemoteRequest25
641 * @tc.desc: normal function
642 * @tc.type: FUNC
643 */
644 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest25, Function | SmallTest | Level2)
645 {
646 MessageParcel data;
647 MessageParcel reply;
648 MessageOption option;
649
650 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
651 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
652 data.WriteUint32(static_cast<uint32_t>(type));
653 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
654 data.WriteRemoteObject(windowManagerAgent->AsObject());
655
656 uint32_t code = static_cast<uint32_t>(
657 DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND);
658
659 int res = stub_->OnRemoteRequest(code, data, reply, option);
660 EXPECT_EQ(res, 0);
661 }
662
663 /**
664 * @tc.name: OnRemoteRequest26
665 * @tc.desc: normal function
666 * @tc.type: FUNC
667 */
668 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest26, Function | SmallTest | Level2)
669 {
670 MessageParcel data;
671 MessageParcel reply;
672 MessageOption option;
673
674 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
675 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
676 data.WriteUint32(static_cast<uint32_t>(type));
677 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
678 data.WriteRemoteObject(windowManagerAgent->AsObject());
679
680 uint32_t code = static_cast<uint32_t>(
681 DisplayManagerMessage::TRANS_ID_SCREEN_STOP_EXPAND);
682
683 int res = stub_->OnRemoteRequest(code, data, reply, option);
684 EXPECT_EQ(res, 0);
685 }
686
687 /**
688 * @tc.name: OnRemoteRequest27
689 * @tc.desc: normal function
690 * @tc.type: FUNC
691 */
692 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest27, Function | SmallTest | Level2)
693 {
694 MessageParcel data;
695 MessageParcel reply;
696 MessageOption option;
697
698 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
699 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
700 data.WriteUint32(static_cast<uint32_t>(type));
701 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
702 data.WriteRemoteObject(windowManagerAgent->AsObject());
703
704 uint32_t code = static_cast<uint32_t>(
705 DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID);
706
707 int res = stub_->OnRemoteRequest(code, data, reply, option);
708 EXPECT_EQ(res, 0);
709 }
710
711 /**
712 * @tc.name: OnRemoteRequest28
713 * @tc.desc: normal function
714 * @tc.type: FUNC
715 */
716 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest28, Function | SmallTest | Level2)
717 {
718 MessageParcel data;
719 MessageParcel reply;
720 MessageOption option;
721
722 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
723 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
724 data.WriteUint32(static_cast<uint32_t>(type));
725 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
726 data.WriteRemoteObject(windowManagerAgent->AsObject());
727
728 uint32_t code = static_cast<uint32_t>(
729 DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP);
730
731 int res = stub_->OnRemoteRequest(code, data, reply, option);
732 EXPECT_EQ(res, 0);
733 }
734
735 /**
736 * @tc.name: OnRemoteRequest29
737 * @tc.desc: normal function
738 * @tc.type: FUNC
739 */
740 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest29, Function | SmallTest | Level2)
741 {
742 MessageParcel data;
743 MessageParcel reply;
744 MessageOption option;
745
746 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
747 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
748 data.WriteUint32(static_cast<uint32_t>(type));
749 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
750 data.WriteRemoteObject(windowManagerAgent->AsObject());
751
752 uint32_t code = static_cast<uint32_t>(
753 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT);
754
755 int res = stub_->OnRemoteRequest(code, data, reply, option);
756 EXPECT_EQ(res, 0);
757 }
758
759 /**
760 * @tc.name: OnRemoteRequest30
761 * @tc.desc: normal function
762 * @tc.type: FUNC
763 */
764 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest30, Function | SmallTest | Level2)
765 {
766 MessageParcel data;
767 MessageParcel reply;
768 MessageOption option;
769
770 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
771 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
772 data.WriteUint32(static_cast<uint32_t>(type));
773 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
774 data.WriteRemoteObject(windowManagerAgent->AsObject());
775
776 uint32_t code = static_cast<uint32_t>(
777 DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE);
778
779 int res = stub_->OnRemoteRequest(code, data, reply, option);
780 EXPECT_EQ(res, 0);
781 }
782
783 /**
784 * @tc.name: OnRemoteRequest32
785 * @tc.desc: normal function
786 * @tc.type: FUNC
787 */
788 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest32, Function | SmallTest | Level2)
789 {
790 MessageParcel data;
791 MessageParcel reply;
792 MessageOption option;
793
794 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
795 data.WriteBool(false);
796 uint32_t code = static_cast<uint32_t>(
797 DisplayManagerMessage::TRANS_ID_SCREEN_DISABLE_MIRROR);
798 int res = stub_->OnRemoteRequest(code, data, reply, option);
799 EXPECT_EQ(res, 0);
800 }
801
802 /**
803 * @tc.name: OnRemoteRequest33
804 * @tc.desc: normal function
805 * @tc.type: FUNC
806 */
807 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest33, Function | SmallTest | Level2)
808 {
809 MessageParcel data;
810 MessageParcel reply;
811 MessageOption option;
812
813 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
814 data.WriteRemoteObject(nullptr);
815 uint32_t code = static_cast<uint32_t>(
816 DisplayManagerMessage::TRANS_ID_SET_CLIENT);
817 int res = stub_->OnRemoteRequest(code, data, reply, option);
818 EXPECT_EQ(res, 0);
819 }
820
821 /**
822 * @tc.name: OnRemoteRequest34
823 * @tc.desc: normal function
824 * @tc.type: FUNC
825 */
826 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest34, Function | SmallTest | Level2)
827 {
828 MessageParcel data;
829 MessageParcel reply;
830 MessageOption option;
831
832 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
833 data.WriteUint64(0);
834 uint32_t code = static_cast<uint32_t>(
835 DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
836 int res = stub_->OnRemoteRequest(code, data, reply, option);
837 EXPECT_EQ(res, 0);
838 }
839
840 /**
841 * @tc.name: OnRemoteRequest35
842 * @tc.desc: normal function
843 * @tc.type: FUNC
844 */
845 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest35, Function | SmallTest | Level2)
846 {
847 MessageParcel data;
848 MessageParcel reply;
849 MessageOption option;
850
851 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
852 data.WriteUint64(0);
853 uint32_t code = static_cast<uint32_t>(
854 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
855 int res = stub_->OnRemoteRequest(code, data, reply, option);
856 EXPECT_EQ(res, 0);
857 }
858
859 /**
860 * @tc.name: OnRemoteRequest36
861 * @tc.desc: normal function
862 * @tc.type: FUNC
863 */
864 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest36, Function | SmallTest | Level2)
865 {
866 MessageParcel data;
867 MessageParcel reply;
868 MessageOption option;
869
870 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
871 data.WriteUint64(0);
872 RRect bounds;
873 RSMarshallingHelper::Marshalling(data, bounds);
874 data.WriteFloat(0);
875 uint32_t code = static_cast<uint32_t>(
876 DisplayManagerMessage::TRANS_ID_UPDATE_SCREEN_ROTATION_PROPERTY);
877 int res = stub_->OnRemoteRequest(code, data, reply, option);
878 EXPECT_EQ(res, 0);
879 }
880
881 /**
882 * @tc.name: OnRemoteRequest37
883 * @tc.desc: normal function
884 * @tc.type: FUNC
885 */
886 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest37, Function | SmallTest | Level2)
887 {
888 MessageParcel data;
889 MessageParcel reply;
890 MessageOption option;
891
892 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
893 uint32_t code = static_cast<uint32_t>(
894 DisplayManagerMessage::TRANS_ID_GET_CURVED_SCREEN_COMPRESSION_AREA);
895 int res = stub_->OnRemoteRequest(code, data, reply, option);
896 EXPECT_EQ(res, 0);
897 }
898
899 /**
900 * @tc.name: OnRemoteRequest38
901 * @tc.desc: normal function
902 * @tc.type: FUNC
903 */
904 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest38, Function | SmallTest | Level2)
905 {
906 MessageParcel data;
907 MessageParcel reply;
908 MessageOption option;
909
910 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
911 data.WriteUint64(0);
912 uint32_t code = static_cast<uint32_t>(
913 DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
914 int res = stub_->OnRemoteRequest(code, data, reply, option);
915 EXPECT_EQ(res, 0);
916 }
917
918 /**
919 * @tc.name: OnRemoteRequest39
920 * @tc.desc: normal function
921 * @tc.type: FUNC
922 */
923 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest39, Function | SmallTest | Level2)
924 {
925 MessageParcel data;
926 MessageParcel reply;
927 MessageOption option;
928
929 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
930 data.WriteBool(false);
931 uint32_t code = static_cast<uint32_t>(
932 DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_STATE);
933 int res = stub_->OnRemoteRequest(code, data, reply, option);
934 EXPECT_EQ(res, 0);
935 }
936
937 /**
938 * @tc.name: OnRemoteRequest40
939 * @tc.desc: normal function, TRANS_ID_SET_SCREENID_PRIVACY_STATE test
940 * @tc.type: FUNC
941 */
942 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest40, Function | SmallTest | Level2)
943 {
944 MessageParcel data;
945 MessageParcel reply;
946 MessageOption option;
947
948 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
949 DisplayId displayId = 0;
950 data.WriteUint64(displayId);
951 data.WriteBool(false);
952 uint32_t code = static_cast<uint32_t>(
953 DisplayManagerMessage::TRANS_ID_SET_SCREENID_PRIVACY_STATE);
954 int res = stub_->OnRemoteRequest(code, data, reply, option);
955 EXPECT_EQ(res, 0);
956 }
957
958 /**
959 * @tc.name: OnRemoteRequest41
960 * @tc.desc: normal function, TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST test
961 * @tc.type: FUNC
962 */
963 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest41, Function | SmallTest | Level2)
964 {
965 MessageParcel data;
966 MessageParcel reply;
967 MessageOption option;
968
969 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
970 DisplayId displayId = 0;
971 data.WriteUint64(displayId);
972 std::vector<std::string> privacyWindowList{"win0", "win1"};
973 data.WriteStringVector(privacyWindowList);
974 uint32_t code = static_cast<uint32_t>(
975 DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST);
976 int res = stub_->OnRemoteRequest(code, data, reply, option);
977 EXPECT_EQ(res, 0);
978 }
979
980 /**
981 * @tc.name: OnRemoteRequest057
982 * @tc.desc: normal function
983 * @tc.type: FUNC
984 */
985 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest057, Function | SmallTest | Level2)
986 {
987 MessageParcel data;
988 MessageParcel reply;
989 MessageOption option;
990
991 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
992 uint32_t code = static_cast<uint32_t>(
993 DisplayManagerMessage::TRANS_ID_GET_DEVICE_SCREEN_CONFIG);
994 int res = stub_->OnRemoteRequest(code, data, reply, option);
995 EXPECT_EQ(res, 0);
996 }
997
998 /**
999 * @tc.name: OnRemoteRequest60
1000 * @tc.desc: normal function, TRANS_ID_SET_SCREEN_OFF_DELAY_TIME test
1001 * @tc.type: FUNC
1002 */
1003 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest60, Function | SmallTest | Level2)
1004 {
1005 MessageParcel data;
1006 MessageParcel reply;
1007 MessageOption option;
1008
1009 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1010 data.WriteInt32(2000);
1011 uint32_t code = static_cast<uint32_t>(
1012 DisplayManagerMessage::TRANS_ID_SET_SCREEN_OFF_DELAY_TIME);
1013 int res = stub_->OnRemoteRequest(code, data, reply, option);
1014 EXPECT_EQ(res, 0);
1015 }
1016
1017 /**
1018 * @tc.name: OnRemoteRequest61
1019 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST test
1020 * @tc.type: FUNC
1021 */
1022 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest61, Function | SmallTest | Level2)
1023 {
1024 MessageParcel data;
1025 MessageParcel reply;
1026 MessageOption option;
1027
1028 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1029 ScreenId id = 1001;
1030 std::vector<uint64_t> windowIdList{10, 20, 30};
1031 data.WriteUint64(static_cast<uint64_t>(id));
1032 data.WriteUInt64Vector(windowIdList);
1033 uint32_t code = static_cast<uint32_t>(
1034 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
1035 int res = stub_->OnRemoteRequest(code, data, reply, option);
1036 EXPECT_EQ(res, 0);
1037 }
1038
1039 /**
1040 * @tc.name: OnRemoteRequest62
1041 * @tc.desc: normal function, TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO test
1042 * @tc.type: FUNC
1043 */
1044 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest62, Function | SmallTest | Level2)
1045 {
1046 MessageParcel data;
1047 MessageParcel reply;
1048 MessageOption option;
1049
1050 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1051
1052 data.WriteInt32(200);
1053 data.WriteBool(true);
1054 data.WriteUint32(1062);
1055 data.WriteUint32(1062);
1056 data.WriteFloat(1.5);
1057 uint32_t code = static_cast<uint32_t>(
1058 DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO);
1059 int res = stub_->OnRemoteRequest(code, data, reply, option);
1060 EXPECT_EQ(res, 0);
1061 }
1062
1063 /**
1064 * @tc.name: OnRemoteRequest63
1065 * @tc.desc: normal function, TRANS_ID_RESET_ALL_FREEZE_STATUS test
1066 * @tc.type: FUNC
1067 */
1068 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest63, Function | SmallTest | Level2)
1069 {
1070 MessageParcel data;
1071 MessageParcel reply;
1072 MessageOption option;
1073
1074 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1075
1076 uint32_t code = static_cast<uint32_t>(
1077 DisplayManagerMessage::TRANS_ID_RESET_ALL_FREEZE_STATUS);
1078 int res = stub_->OnRemoteRequest(code, data, reply, option);
1079 EXPECT_EQ(res, 0);
1080 }
1081
1082 /**
1083 * @tc.name: OnRemoteRequest64
1084 * @tc.desc: normal function, TRANS_ID_PROXY_FOR_FREEZE test
1085 * @tc.type: FUNC
1086 */
1087 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest64, Function | SmallTest | Level2)
1088 {
1089 MessageParcel data;
1090 MessageParcel reply;
1091 MessageOption option;
1092
1093 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1094
1095 int32_t size = 10;
1096 data.WriteInt32(size);
1097 for (int32_t i = 0; i < size; i++) {
1098 data.WriteInt32(i);
1099 }
1100 data.WriteBool(true);
1101 uint32_t code = static_cast<uint32_t>(
1102 DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
1103 int res = stub_->OnRemoteRequest(code, data, reply, option);
1104 EXPECT_EQ(res, 0);
1105 }
1106
1107 /**
1108 * @tc.name: OnRemoteRequest65
1109 * @tc.desc: normal function, TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL test
1110 * @tc.type: FUNC
1111 */
1112 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest65, Function | SmallTest | Level2)
1113 {
1114 MessageParcel data;
1115 MessageParcel reply;
1116 MessageOption option;
1117
1118 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1119
1120 data.WriteUint64(1065);
1121 uint32_t code = static_cast<uint32_t>(
1122 DisplayManagerMessage::TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL);
1123 int res = stub_->OnRemoteRequest(code, data, reply, option);
1124 EXPECT_EQ(res, 0);
1125 }
1126
1127
1128 /**
1129 * @tc.name: OnRemoteRequest66
1130 * @tc.desc: normal function, TRANS_ID_SWITCH_USER test
1131 * @tc.type: FUNC
1132 */
1133 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest66, Function | SmallTest | Level2)
1134 {
1135 MessageParcel data;
1136 MessageParcel reply;
1137 MessageOption option;
1138
1139 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1140
1141 uint32_t code = static_cast<uint32_t>(
1142 DisplayManagerMessage::TRANS_ID_SWITCH_USER);
1143 int res = stub_->OnRemoteRequest(code, data, reply, option);
1144 EXPECT_EQ(res, 0);
1145 }
1146
1147 /**
1148 * @tc.name: OnRemoteRequest67
1149 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE test
1150 * @tc.type: FUNC
1151 */
1152 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest67, Function | SmallTest | Level2)
1153 {
1154 MessageParcel data;
1155 MessageParcel reply;
1156 MessageOption option;
1157
1158 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1159
1160 data.WriteUint64(1067);
1161 data.WriteUint32(120);
1162 uint32_t code = static_cast<uint32_t>(
1163 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE);
1164 int res = stub_->OnRemoteRequest(code, data, reply, option);
1165 EXPECT_EQ(res, 0);
1166 }
1167
1168 /**
1169 * @tc.name: OnRemoteRequest68
1170 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_FLAG test
1171 * @tc.type: FUNC
1172 */
1173 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest68, Function | SmallTest | Level2)
1174 {
1175 MessageParcel data;
1176 MessageParcel reply;
1177 MessageOption option;
1178
1179 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1180
1181 data.WriteUint64(1068);
1182 data.WriteUint32(100);
1183 uint32_t code = static_cast<uint32_t>(
1184 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_FLAG);
1185 int res = stub_->OnRemoteRequest(code, data, reply, option);
1186 EXPECT_EQ(res, 0);
1187 }
1188
1189 /**
1190 * @tc.name: OnRemoteRequest69
1191 * @tc.desc: normal function, TRANS_ID_GET_VIRTUAL_SCREEN_FLAG test
1192 * @tc.type: FUNC
1193 */
1194 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest69, Function | SmallTest | Level2)
1195 {
1196 MessageParcel data;
1197 MessageParcel reply;
1198 MessageOption option;
1199
1200 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1201
1202 data.WriteUint64(1069);
1203 uint32_t code = static_cast<uint32_t>(
1204 DisplayManagerMessage::TRANS_ID_GET_VIRTUAL_SCREEN_FLAG);
1205 int res = stub_->OnRemoteRequest(code, data, reply, option);
1206 EXPECT_EQ(res, 0);
1207 }
1208
1209 /**
1210 * @tc.name: OnRemoteRequest70
1211 * @tc.desc: normal function, TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION test
1212 * @tc.type: FUNC
1213 */
1214 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest70, Function | SmallTest | Level2)
1215 {
1216 MessageParcel data;
1217 MessageParcel reply;
1218 MessageOption option;
1219
1220 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1221
1222 data.WriteBool(true);
1223 uint32_t code = static_cast<uint32_t>(
1224 DisplayManagerMessage::TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION);
1225 int res = stub_->OnRemoteRequest(code, data, reply, option);
1226 EXPECT_EQ(res, 0);
1227 }
1228
1229 /**
1230 * @tc.name: OnRemoteRequest71
1231 * @tc.desc: normal function, TRANS_ID_GET_AVAILABLE_AREA test
1232 * @tc.type: FUNC
1233 */
1234 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest71, Function | SmallTest | Level2)
1235 {
1236 MessageParcel data;
1237 MessageParcel reply;
1238 MessageOption option;
1239
1240 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1241
1242 data.WriteUint64(1071);
1243 uint32_t code = static_cast<uint32_t>(
1244 DisplayManagerMessage::TRANS_ID_GET_AVAILABLE_AREA);
1245 int res = stub_->OnRemoteRequest(code, data, reply, option);
1246 EXPECT_EQ(res, 0);
1247 }
1248
1249 /**
1250 * @tc.name: OnRemoteRequest72
1251 * @tc.desc: normal function, TRANS_ID_UPDATE_AVAILABLE_AREA test
1252 * @tc.type: FUNC
1253 */
1254 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest72, Function | SmallTest | Level2)
1255 {
1256 MessageParcel data;
1257 MessageParcel reply;
1258 MessageOption option;
1259
1260 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1261
1262 data.WriteUint64(1072);
1263 data.WriteInt32(100);
1264 data.WriteInt32(200);
1265 data.WriteUint32(150);
1266 data.WriteInt32(250);
1267 uint32_t code = static_cast<uint32_t>(
1268 DisplayManagerMessage::TRANS_ID_UPDATE_AVAILABLE_AREA);
1269 int res = stub_->OnRemoteRequest(code, data, reply, option);
1270 EXPECT_EQ(res, 0);
1271 }
1272
1273 /**
1274 * @tc.name: OnRemoteRequest73
1275 * @tc.desc: normal function, TRANS_ID_RESIZE_VIRTUAL_SCREEN test
1276 * @tc.type: FUNC
1277 */
1278 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest73, Function | SmallTest | Level2)
1279 {
1280 MessageParcel data;
1281 MessageParcel reply;
1282 MessageOption option;
1283
1284 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1285
1286 data.WriteUint64(1073);
1287 data.WriteUint32(1080);
1288 data.WriteUint32(1440);
1289 uint32_t code = static_cast<uint32_t>(
1290 DisplayManagerMessage::TRANS_ID_RESIZE_VIRTUAL_SCREEN);
1291 int res = stub_->OnRemoteRequest(code, data, reply, option);
1292 EXPECT_EQ(res, 0);
1293 }
1294
1295 /**
1296 * @tc.name: OnRemoteRequest74
1297 * @tc.desc: normal function, TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO test
1298 * @tc.type: FUNC
1299 */
1300 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest74, Function | SmallTest | Level2)
1301 {
1302 MessageParcel data;
1303 MessageParcel reply;
1304 MessageOption option;
1305
1306 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1307
1308 sptr<DisplayChangeInfo> info = new DisplayChangeInfo();
1309 info->action_ = ActionType::SINGLE_START;
1310 ScreenId toScreenId = SCREEN_ID_INVALID;
1311 info->toScreenId_ = toScreenId;
1312 ScreenId fromScreenId = SCREEN_ID_INVALID;
1313 info->fromScreenId_ = fromScreenId;
1314 std::string abilityName = "11";
1315 std::string bundleName = "22";
1316 info->abilityName_ = abilityName;
1317 info->bundleName_ = bundleName;
1318 info->Marshalling(data);
1319 uint32_t code = static_cast<uint32_t>(
1320 DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
1321 int res = stub_->OnRemoteRequest(code, data, reply, option);
1322 EXPECT_EQ(res, 0);
1323 }
1324
1325 /**
1326 * @tc.name: OnRemoteRequest75
1327 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN test
1328 * @tc.type: FUNC
1329 */
1330 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest75, Function | SmallTest | Level2)
1331 {
1332 MessageParcel data;
1333 MessageParcel reply;
1334 MessageOption option;
1335
1336 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1337
1338 std::vector<ScreenId> uniqueScreenIds = {1008, 2008, 3008};
1339 data.WriteUint32(uniqueScreenIds.size());
1340 data.WriteUInt64Vector(uniqueScreenIds);
1341 uint32_t code = static_cast<uint32_t>(
1342 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
1343 int res = stub_->OnRemoteRequest(code, data, reply, option);
1344 EXPECT_EQ(res, 0);
1345 }
1346
1347 /**
1348 * @tc.name: OnRemoteRequest76
1349 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION test
1350 * @tc.type: FUNC
1351 */
1352 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest76, Function | SmallTest | Level2)
1353 {
1354 MessageParcel data;
1355 MessageParcel reply;
1356 MessageOption option;
1357
1358 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1359
1360 uint32_t code = static_cast<uint32_t>(
1361 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION);
1362 int res = stub_->OnRemoteRequest(code, data, reply, option);
1363 EXPECT_EQ(res, 0);
1364 }
1365
1366 /**
1367 * @tc.name: OnRemoteRequest77
1368 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS test
1369 * @tc.type: FUNC
1370 */
1371 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest77, Function | SmallTest | Level2)
1372 {
1373 MessageParcel data;
1374 MessageParcel reply;
1375 MessageOption option;
1376
1377 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1378
1379 uint32_t code = static_cast<uint32_t>(
1380 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS);
1381 int res = stub_->OnRemoteRequest(code, data, reply, option);
1382 EXPECT_EQ(res, 0);
1383 }
1384
1385 /**
1386 * @tc.name: OnRemoteRequest78
1387 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_IS_FOLDABLE test
1388 * @tc.type: FUNC
1389 */
1390 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest78, Function | SmallTest | Level2)
1391 {
1392 MessageParcel data;
1393 MessageParcel reply;
1394 MessageOption option;
1395
1396 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1397
1398 uint32_t code = static_cast<uint32_t>(
1399 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE);
1400 int res = stub_->OnRemoteRequest(code, data, reply, option);
1401 EXPECT_EQ(res, 0);
1402 }
1403
1404 /**
1405 * @tc.name: OnRemoteRequest79
1406 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE test
1407 * @tc.type: FUNC
1408 */
1409 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest79, Function | SmallTest | Level2)
1410 {
1411 MessageParcel data;
1412 MessageParcel reply;
1413 MessageOption option;
1414
1415 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1416
1417 uint32_t code = static_cast<uint32_t>(
1418 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE);
1419 int res = stub_->OnRemoteRequest(code, data, reply, option);
1420 EXPECT_EQ(res, 0);
1421 }
1422
1423 /**
1424 * @tc.name: OnRemoteRequest80
1425 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS test
1426 * @tc.type: FUNC
1427 */
1428 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest80, Function | SmallTest | Level2)
1429 {
1430 MessageParcel data;
1431 MessageParcel reply;
1432 MessageOption option;
1433
1434 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1435
1436 uint32_t code = static_cast<uint32_t>(
1437 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS);
1438 int res = stub_->OnRemoteRequest(code, data, reply, option);
1439 EXPECT_EQ(res, 0);
1440 }
1441
1442 /**
1443 * @tc.name: OnRemoteRequest81
1444 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE test
1445 * @tc.type: FUNC
1446 */
1447 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest81, Function | SmallTest | Level2)
1448 {
1449 MessageParcel data;
1450 MessageParcel reply;
1451 MessageOption option;
1452
1453 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1454
1455 uint32_t code = static_cast<uint32_t>(
1456 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE);
1457 int res = stub_->OnRemoteRequest(code, data, reply, option);
1458 EXPECT_EQ(res, 0);
1459 }
1460
1461 /**
1462 * @tc.name: OnRemoteRequest82
1463 * @tc.desc: normal function, TRANS_ID_DEVICE_IS_CAPTURE test
1464 * @tc.type: FUNC
1465 */
1466 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest82, Function | SmallTest | Level2)
1467 {
1468 MessageParcel data;
1469 MessageParcel reply;
1470 MessageOption option;
1471
1472 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1473
1474 uint32_t code = static_cast<uint32_t>(
1475 DisplayManagerMessage::TRANS_ID_DEVICE_IS_CAPTURE);
1476 int res = stub_->OnRemoteRequest(code, data, reply, option);
1477 EXPECT_EQ(res, 0);
1478 }
1479
1480 /**
1481 * @tc.name: OnRemoteRequest83
1482 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN test
1483 * @tc.type: FUNC
1484 */
1485 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest83, Function | SmallTest | Level2)
1486 {
1487 MessageParcel data;
1488 MessageParcel reply;
1489 MessageOption option;
1490
1491 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1492
1493 uint32_t code = static_cast<uint32_t>(
1494 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN);
1495 int res = stub_->OnRemoteRequest(code, data, reply, option);
1496 EXPECT_EQ(res, 0);
1497 }
1498
1499 /**
1500 * @tc.name: OnRemoteRequest84
1501 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN test
1502 * @tc.type: FUNC
1503 */
1504 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest84, Function | SmallTest | Level2)
1505 {
1506 MessageParcel data;
1507 MessageParcel reply;
1508 MessageOption option;
1509
1510 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1511
1512 uint32_t code = static_cast<uint32_t>(
1513 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN);
1514 int res = stub_->OnRemoteRequest(code, data, reply, option);
1515 EXPECT_EQ(res, 0);
1516 }
1517
1518 /**
1519 * @tc.name: OnRemoteRequest85
1520 * @tc.desc: normal function, TRANS_ID_HAS_IMMERSIVE_WINDOW test
1521 * @tc.type: FUNC
1522 */
1523 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest85, Function | SmallTest | Level2)
1524 {
1525 MessageParcel data;
1526 MessageParcel reply;
1527 MessageOption option;
1528
1529 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1530
1531 uint32_t code = static_cast<uint32_t>(
1532 DisplayManagerMessage::TRANS_ID_HAS_IMMERSIVE_WINDOW);
1533 int res = stub_->OnRemoteRequest(code, data, reply, option);
1534 EXPECT_EQ(res, 0);
1535 }
1536
1537 /**
1538 * @tc.name: OnRemoteRequest86
1539 * @tc.desc: normal function, TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID test
1540 * @tc.type: FUNC
1541 */
1542 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest86, Function | SmallTest | Level2)
1543 {
1544 MessageParcel data;
1545 MessageParcel reply;
1546 MessageOption option;
1547
1548 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1549
1550 data.WriteUint64(1086);
1551 uint32_t code = static_cast<uint32_t>(
1552 DisplayManagerMessage::TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID);
1553 int res = stub_->OnRemoteRequest(code, data, reply, option);
1554 EXPECT_EQ(res, 0);
1555 }
1556
1557 /**
1558 * @tc.name: OnRemoteRequest87
1559 * @tc.desc: normal function, TRANS_ID_HAS_PRIVATE_WINDOW test
1560 * @tc.type: FUNC
1561 */
1562 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest87, Function | SmallTest | Level2)
1563 {
1564 MessageParcel data;
1565 MessageParcel reply;
1566 MessageOption option;
1567
1568 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1569
1570 data.WriteUint64(1087);
1571 uint32_t code = static_cast<uint32_t>(
1572 DisplayManagerMessage::TRANS_ID_HAS_PRIVATE_WINDOW);
1573 int res = stub_->OnRemoteRequest(code, data, reply, option);
1574 EXPECT_EQ(res, 0);
1575 }
1576
1577 /**
1578 * @tc.name: OnRemoteRequest88
1579 * @tc.desc: normal function, TRANS_ID_GET_CUTOUT_INFO test
1580 * @tc.type: FUNC
1581 */
1582 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest88, Function | SmallTest | Level2)
1583 {
1584 MessageParcel data;
1585 MessageParcel reply;
1586 MessageOption option;
1587
1588 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1589
1590 data.WriteUint64(1088);
1591 uint32_t code = static_cast<uint32_t>(
1592 DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO);
1593 int res = stub_->OnRemoteRequest(code, data, reply, option);
1594 EXPECT_EQ(res, 0);
1595 }
1596
1597 /**
1598 * @tc.name: OnRemoteRequest89
1599 * @tc.desc: normal function, TRANS_ID_IS_SCREEN_ROTATION_LOCKED test
1600 * @tc.type: FUNC
1601 */
1602 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest89, Function | SmallTest | Level2)
1603 {
1604 MessageParcel data;
1605 MessageParcel reply;
1606 MessageOption option;
1607
1608 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1609
1610 uint32_t code = static_cast<uint32_t>(
1611 DisplayManagerMessage::TRANS_ID_IS_SCREEN_ROTATION_LOCKED);
1612 int res = stub_->OnRemoteRequest(code, data, reply, option);
1613 EXPECT_EQ(res, 0);
1614 }
1615
1616 /**
1617 * @tc.name: OnRemoteRequest90
1618 * @tc.desc: normal function, TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS test
1619 * @tc.type: FUNC
1620 */
1621 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest90, Function | SmallTest | Level2)
1622 {
1623 MessageParcel data;
1624 MessageParcel reply;
1625 MessageOption option;
1626
1627 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1628
1629 data.WriteBool(true);
1630 uint32_t code = static_cast<uint32_t>(
1631 DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS);
1632 int res = stub_->OnRemoteRequest(code, data, reply, option);
1633 EXPECT_EQ(res, 0);
1634 }
1635
1636 /**
1637 * @tc.name: OnRemoteRequest91
1638 * @tc.desc: normal function, TRANS_ID_SET_SCREEN_ROTATION_LOCKED test
1639 * @tc.type: FUNC
1640 */
1641 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest91, Function | SmallTest | Level2)
1642 {
1643 MessageParcel data;
1644 MessageParcel reply;
1645 MessageOption option;
1646
1647 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1648
1649 data.WriteBool(true);
1650 uint32_t code = static_cast<uint32_t>(
1651 DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED);
1652 int res = stub_->OnRemoteRequest(code, data, reply, option);
1653 EXPECT_EQ(res, 0);
1654 }
1655
1656 /**
1657 * @tc.name: OnRemoteRequest92
1658 * @tc.desc: normal function, TRANS_ID_SET_ORIENTATION test
1659 * @tc.type: FUNC
1660 */
1661 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest92, Function | SmallTest | Level2)
1662 {
1663 MessageParcel data;
1664 MessageParcel reply;
1665 MessageOption option;
1666
1667 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1668
1669 data.WriteUint64(1092);
1670 data.WriteUint32(270);
1671 uint32_t code = static_cast<uint32_t>(
1672 DisplayManagerMessage::TRANS_ID_SET_ORIENTATION);
1673 int res = stub_->OnRemoteRequest(code, data, reply, option);
1674 EXPECT_EQ(res, 0);
1675 }
1676
1677 /**
1678 * @tc.name: OnRemoteRequest93
1679 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM test
1680 * @tc.type: FUNC
1681 */
1682 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest93, Function | SmallTest | Level2)
1683 {
1684 MessageParcel data;
1685 MessageParcel reply;
1686 MessageOption option;
1687
1688 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1689
1690 data.WriteUint64(1093);
1691 data.WriteFloat(2.5);
1692 uint32_t code = static_cast<uint32_t>(
1693 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM);
1694 int res = stub_->OnRemoteRequest(code, data, reply, option);
1695 EXPECT_EQ(res, 0);
1696 }
1697
1698 /**
1699 * @tc.name: OnRemoteRequest94
1700 * @tc.desc: normal function, TRANS_ID_GET_SNAPSHOT_BY_PICKER test
1701 * @tc.type: FUNC
1702 */
1703 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest94, Function | SmallTest | Level2)
1704 {
1705 MessageParcel data;
1706 MessageParcel reply;
1707 MessageOption option;
1708
1709 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1710
1711 uint32_t code = static_cast<uint32_t>(
1712 DisplayManagerMessage::TRANS_ID_GET_SNAPSHOT_BY_PICKER);
1713 int res = stub_->OnRemoteRequest(code, data, reply, option);
1714 EXPECT_EQ(res, 0);
1715 }
1716
1717 /**
1718 * @tc.name: OnRemoteRequest95
1719 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE test
1720 * @tc.type: FUNC
1721 */
1722 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest95, Function | SmallTest | Level2)
1723 {
1724 MessageParcel data;
1725 MessageParcel reply;
1726 MessageOption option;
1727
1728 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1729
1730 data.WriteUint64(1095);
1731 data.WriteUint32(25);
1732 uint32_t code = static_cast<uint32_t>(
1733 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE);
1734 int res = stub_->OnRemoteRequest(code, data, reply, option);
1735 EXPECT_EQ(res, 0);
1736 }
1737
1738 /**
1739 * @tc.name: OnRemoteRequest96
1740 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE test
1741 * @tc.type: FUNC
1742 */
1743 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest96, Function | SmallTest | Level2)
1744 {
1745 MessageParcel data;
1746 MessageParcel reply;
1747 MessageOption option;
1748
1749 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1750
1751 uint32_t code = static_cast<uint32_t>(
1752 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE);
1753 int res = stub_->OnRemoteRequest(code, data, reply, option);
1754 EXPECT_EQ(res, 0);
1755 }
1756
1757 /**
1758 * @tc.name: OnRemoteRequest97
1759 * @tc.desc: normal function, TRANS_ID_SET_SPECIFIED_SCREEN_POWER test
1760 * @tc.type: FUNC
1761 */
1762 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest97, Function | SmallTest | Level2)
1763 {
1764 MessageParcel data;
1765 MessageParcel reply;
1766 MessageOption option;
1767
1768 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1769
1770 data.WriteUint32(1097);
1771 data.WriteUint32(1);
1772 data.WriteUint32(12);
1773 uint32_t code = static_cast<uint32_t>(
1774 DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER);
1775 int res = stub_->OnRemoteRequest(code, data, reply, option);
1776 EXPECT_EQ(res, 0);
1777 }
1778
1779 /**
1780 * @tc.name: OnRemoteRequest98
1781 * @tc.desc: normal function, TRANS_ID_PROXY_FOR_FREEZE test
1782 * @tc.type: FUNC
1783 */
1784 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest98, Function | SmallTest | Level2)
1785 {
1786 MessageParcel data;
1787 MessageParcel reply;
1788 MessageOption option;
1789
1790 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1791
1792 int32_t size = 200;
1793 data.WriteInt32(size);
1794 for (int32_t i = 0; i < size; i++) {
1795 data.WriteInt32(i);
1796 }
1797 data.WriteBool(true);
1798 uint32_t code = static_cast<uint32_t>(
1799 DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
1800 int res = stub_->OnRemoteRequest(code, data, reply, option);
1801 EXPECT_EQ(res, 0);
1802 }
1803
1804 /**
1805 * @tc.name: OnRemoteRequest99
1806 * @tc.desc: normal function, invalid TRANS_ID test
1807 * @tc.type: FUNC
1808 */
1809 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest99, Function | SmallTest | Level2)
1810 {
1811 MessageParcel data;
1812 MessageParcel reply;
1813 MessageOption option;
1814
1815 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1816
1817 uint32_t code = static_cast<uint32_t>(3500);
1818 int res = stub_->OnRemoteRequest(code, data, reply, option);
1819 EXPECT_NE(res, 0);
1820 }
1821
1822 /**
1823 * @tc.name: OnRemoteRequest100
1824 * @tc.desc: normal function, TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST test
1825 * @tc.type: FUNC
1826 */
1827 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest100, Function | SmallTest | Level2)
1828 {
1829 MessageParcel data;
1830 MessageParcel reply;
1831 MessageOption option;
1832
1833 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1834 ScreenId id = 1100;
1835 std::vector<uint64_t> windowIdList{};
1836 data.WriteUint64(static_cast<uint64_t>(id));
1837 data.WriteUInt64Vector(windowIdList);
1838 uint32_t code = static_cast<uint32_t>(
1839 DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
1840 int res = stub_->OnRemoteRequest(code, data, reply, option);
1841 EXPECT_EQ(res, 0);
1842 }
1843
1844 /**
1845 * @tc.name: OnRemoteRequest101
1846 * @tc.desc: normal function, TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO test
1847 * @tc.type: FUNC
1848 */
1849 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest101, Function | SmallTest | Level2)
1850 {
1851 MessageParcel data;
1852 MessageParcel reply;
1853 MessageOption option;
1854
1855 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1856
1857 sptr<DisplayChangeInfo> info = new DisplayChangeInfo();
1858 info->Marshalling(data);
1859 uint32_t code = static_cast<uint32_t>(
1860 DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
1861 int res = stub_->OnRemoteRequest(code, data, reply, option);
1862 EXPECT_EQ(res, 0);
1863 }
1864
1865 /**
1866 * @tc.name: OnRemoteRequest102
1867 * @tc.desc: normal function
1868 * @tc.type: FUNC
1869 */
1870 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest102, Function | SmallTest | Level2)
1871 {
1872 MessageParcel data;
1873 MessageParcel reply;
1874 MessageOption option;
1875
1876 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1877 data.WriteUint64(1102);
1878 uint32_t code = static_cast<uint32_t>(
1879 DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
1880 int res = stub_->OnRemoteRequest(code, data, reply, option);
1881 EXPECT_EQ(res, 0);
1882 }
1883
1884 /**
1885 * @tc.name: OnRemoteRequest103
1886 * @tc.desc: normal function
1887 * @tc.type: FUNC
1888 */
1889 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest103, Function | SmallTest | Level2)
1890 {
1891 MessageParcel data;
1892 MessageParcel reply;
1893 MessageOption option;
1894
1895 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1896 data.WriteUint64(1103);
1897 uint32_t code = static_cast<uint32_t>(
1898 DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
1899 int res = stub_->OnRemoteRequest(code, data, reply, option);
1900 EXPECT_EQ(res, 0);
1901 }
1902
1903 /**
1904 * @tc.name: OnRemoteRequest104
1905 * @tc.desc: normal function
1906 * @tc.type: FUNC
1907 */
1908 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest104, Function | SmallTest | Level2)
1909 {
1910 MessageParcel data;
1911 MessageParcel reply;
1912 MessageOption option;
1913
1914 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1915 data.WriteUint64(1104);
1916 uint32_t code = static_cast<uint32_t>(
1917 DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
1918 int res = stub_->OnRemoteRequest(code, data, reply, option);
1919 EXPECT_EQ(res, 0);
1920 }
1921
1922 /**
1923 * @tc.name: OnRemoteRequest105
1924 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN test
1925 * @tc.type: FUNC
1926 */
1927 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest105, Function | SmallTest | Level2)
1928 {
1929 MessageParcel data;
1930 MessageParcel reply;
1931 MessageOption option;
1932
1933 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1934
1935 uint32_t size = 50;
1936 std::vector<ScreenId> uniqueScreenIds;
1937 for (uint32_t i = 0; i < size; i++) {
1938 uniqueScreenIds.push_back(i);
1939 }
1940 data.WriteUint32(size);
1941 data.WriteUInt64Vector(uniqueScreenIds);
1942 uint32_t code = static_cast<uint32_t>(
1943 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
1944 int res = stub_->OnRemoteRequest(code, data, reply, option);
1945 EXPECT_EQ(res, 0);
1946 }
1947
1948 /**
1949 * @tc.name: OnRemoteRequest106
1950 * @tc.desc: normal function, TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN test
1951 * @tc.type: FUNC
1952 */
1953 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest106, Function | SmallTest | Level2)
1954 {
1955 MessageParcel data;
1956 MessageParcel reply;
1957 MessageOption option;
1958
1959 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1960
1961 uint32_t size = 0;
1962 std::vector<ScreenId> uniqueScreenIds {};
1963 data.WriteUint32(size);
1964 data.WriteUInt64Vector(uniqueScreenIds);
1965 uint32_t code = static_cast<uint32_t>(
1966 DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
1967 int res = stub_->OnRemoteRequest(code, data, reply, option);
1968 EXPECT_EQ(res, 0);
1969 }
1970
1971 /**
1972 * @tc.name: OnRemoteRequest107
1973 * @tc.desc: normal function
1974 * @tc.type: FUNC
1975 */
1976 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest107, Function | SmallTest | Level2)
1977 {
1978 MessageParcel data;
1979 MessageParcel reply;
1980 MessageOption option;
1981
1982 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
1983 data.WriteUint64(1107);
1984 uint32_t code = static_cast<uint32_t>(
1985 DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_SPACE);
1986 int res = stub_->OnRemoteRequest(code, data, reply, option);
1987 EXPECT_EQ(res, 0);
1988 }
1989
1990 /**
1991 * @tc.name: OnRemoteRequest108
1992 * @tc.desc: normal function
1993 * @tc.type: FUNC
1994 */
1995 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest108, Function | SmallTest | Level2)
1996 {
1997 MessageParcel data;
1998 MessageParcel reply;
1999 MessageOption option;
2000
2001 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2002 data.WriteUint64(1108);
2003 uint32_t code = static_cast<uint32_t>(
2004 DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE);
2005 int res = stub_->OnRemoteRequest(code, data, reply, option);
2006 EXPECT_EQ(res, 0);
2007 }
2008
2009 /**
2010 * @tc.name: OnRemoteRequest109
2011 * @tc.desc: normal function
2012 * @tc.type: FUNC
2013 */
2014 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest109, Function | SmallTest | Level2)
2015 {
2016 MessageParcel data;
2017 MessageParcel reply;
2018 MessageOption option;
2019
2020 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2021 data.WriteUint64(1109);
2022 uint32_t code = static_cast<uint32_t>(
2023 DisplayManagerMessage::TRANS_ID_SCREEN_GET_HDR_FORMAT);
2024 int res = stub_->OnRemoteRequest(code, data, reply, option);
2025 EXPECT_EQ(res, 0);
2026 }
2027
2028 /**
2029 * @tc.name: OnRemoteRequest110
2030 * @tc.desc: normal function
2031 * @tc.type: FUNC
2032 */
2033 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest110, Function | SmallTest | Level2)
2034 {
2035 MessageParcel data;
2036 MessageParcel reply;
2037 MessageOption option;
2038
2039 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2040 data.WriteUint64(1100);
2041 uint32_t code = static_cast<uint32_t>(
2042 DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT);
2043 int res = stub_->OnRemoteRequest(code, data, reply, option);
2044 EXPECT_EQ(res, 0);
2045 }
2046
2047 /**
2048 * @tc.name: OnRemoteRequest111
2049 * @tc.desc: normal function
2050 * @tc.type: FUNC
2051 */
2052 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest111, Function | SmallTest | Level2)
2053 {
2054 MessageParcel data;
2055 MessageParcel reply;
2056 MessageOption option;
2057
2058 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2059 data.WriteUint64(1111);
2060 uint32_t code = static_cast<uint32_t>(
2061 DisplayManagerMessage::TRANS_ID_SCREEN_GET_PIXEL_FORMAT);
2062 int res = stub_->OnRemoteRequest(code, data, reply, option);
2063 EXPECT_EQ(res, 0);
2064 }
2065
2066 /**
2067 * @tc.name: OnRemoteRequest112
2068 * @tc.desc: normal function
2069 * @tc.type: FUNC
2070 */
2071 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest112, Function | SmallTest | Level2)
2072 {
2073 MessageParcel data;
2074 MessageParcel reply;
2075 MessageOption option;
2076
2077 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2078 data.WriteUint64(1112);
2079 uint32_t code = static_cast<uint32_t>(
2080 DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
2081 int res = stub_->OnRemoteRequest(code, data, reply, option);
2082 EXPECT_EQ(res, 0);
2083 }
2084
2085 /**
2086 * @tc.name: OnRemoteRequest113
2087 * @tc.desc: normal function
2088 * @tc.type: FUNC
2089 */
2090 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest113, Function | SmallTest | Level2)
2091 {
2092 MessageParcel data;
2093 MessageParcel reply;
2094 MessageOption option;
2095
2096 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2097 data.WriteUint64(1113);
2098 uint32_t code = static_cast<uint32_t>(
2099 DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
2100 int res = stub_->OnRemoteRequest(code, data, reply, option);
2101 EXPECT_EQ(res, 0);
2102 }
2103
2104 /**
2105 * @tc.name: OnRemoteRequest114
2106 * @tc.desc: normal function, TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION test
2107 * @tc.type: FUNC
2108 */
2109 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest114, Function | SmallTest | Level2)
2110 {
2111 MessageParcel data;
2112 MessageParcel reply;
2113 MessageOption option;
2114
2115 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2116 uint32_t code = static_cast<uint32_t>(
2117 DisplayManagerMessage::TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION);
2118 int res = stub_->OnRemoteRequest(code, data, reply, option);
2119 EXPECT_EQ(res, 0);
2120 }
2121
2122 /**
2123 * @tc.name: OnRemoteRequest135
2124 * @tc.desc: normal function
2125 * @tc.type: FUNC
2126 */
2127 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest135, Function | SmallTest | Level2)
2128 {
2129 MessageParcel data;
2130 MessageParcel reply;
2131 MessageOption option;
2132
2133 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2134 data.WriteUint64(0);
2135 data.WriteFloat(0);
2136 data.WriteFloat(0);
2137 uint32_t code = static_cast<uint32_t>(
2138 DisplayManagerMessage::TRANS_ID_UPDATE_SCREEN_DIRECTION_INFO);
2139 int res = stub_->OnRemoteRequest(code, data, reply, option);
2140 EXPECT_EQ(res, 0);
2141 }
2142
2143 /**
2144 * @tc.name: OnRemoteRequest133
2145 * @tc.desc: normal function
2146 * @tc.type: FUNC
2147 */
2148 HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest133, Function | SmallTest | Level2)
2149 {
2150 MessageParcel data;
2151 MessageParcel reply;
2152 MessageOption option;
2153
2154 data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
2155 ScreenId id = 0;
2156 data.WriteUint64(static_cast<uint64_t>(id));
2157 data.WriteBool(true);
2158 data.WriteBool(true);
2159 uint32_t code = static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_CAPTURE);
2160 int res = stub_->OnRemoteRequest(code, data, reply, option);
2161 EXPECT_EQ(res, 0);
2162 }
2163 }
2164 }
2165 }