1 /*
2 * Copyright (c) 2022-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <gtest/gtest.h>
17 #include "window_manager_proxy.h"
18 #include "window_manager_stub_impl.h"
19 #include "iremote_object_mocker.h"
20 #include <rs_window_animation_target.h>
21
22 using namespace testing;
23 using namespace testing::ext;
24 namespace OHOS {
25 namespace Rosen {
26 class WindowManagerProxyTest : public testing::Test {
27 public:
28 static void SetUpTestCase();
29 static void TearDownTestCase();
30 void SetUp() override;
31 void TearDown() override;
32 sptr<WindowManagerStubImpl> mockWindowManagerStub_;
33 sptr<WindowManagerProxy> windowManagerProxy_;
34 };
35
SetUpTestCase()36 void WindowManagerProxyTest::SetUpTestCase()
37 {
38 }
39
TearDownTestCase()40 void WindowManagerProxyTest::TearDownTestCase()
41 {
42 }
43
SetUp()44 void WindowManagerProxyTest::SetUp()
45 {
46 mockWindowManagerStub_ = new WindowManagerStubImpl();
47 windowManagerProxy_ = new WindowManagerProxy(mockWindowManagerStub_);
48 }
49
TearDown()50 void WindowManagerProxyTest::TearDown()
51 {
52 }
53
54 namespace {
55 /**
56 * @tc.name: RequestFocus
57 * @tc.desc: test success
58 * @tc.type: FUNC
59 */
60 HWTEST_F(WindowManagerProxyTest, RequestFocus, TestSize.Level1)
61 {
62 uint32_t windowId = 0;
63 WMError err = windowManagerProxy_->RequestFocus(windowId);
64 ASSERT_EQ(err, WMError::WM_OK);
65 }
66
67 /**
68 * @tc.name: SetWindowAnimationController
69 * @tc.desc: test failed
70 * @tc.type: FUNC
71 */
72 HWTEST_F(WindowManagerProxyTest, SetWindowAnimationController, TestSize.Level1)
73 {
74 sptr<RSIWindowAnimationController> controller = nullptr;
75 WMError err = windowManagerProxy_->SetWindowAnimationController(controller);
76 ASSERT_EQ(err, WMError::WM_ERROR_IPC_FAILED);
77 }
78
79 /**
80 * @tc.name: SetWindowAnimationController01
81 * @tc.desc: test success
82 * @tc.type: FUNC
83 */
84 HWTEST_F(WindowManagerProxyTest, SetWindowAnimationController01, TestSize.Level1)
85 {
86 sptr<IRemoteObject> iRemoteObjectMocker = new IRemoteObjectMocker();
87 sptr<RSIWindowAnimationController> controller = iface_cast<RSIWindowAnimationController>(iRemoteObjectMocker);
88 WMError err = windowManagerProxy_->SetWindowAnimationController(controller);
89 ASSERT_EQ(err, WMError::WM_OK);
90 }
91
92 /**
93 * @tc.name: ToggleShownStateForAllAppWindows
94 * @tc.desc: test success
95 * @tc.type: FUNC
96 */
97 HWTEST_F(WindowManagerProxyTest, ToggleShownStateForAllAppWindows, TestSize.Level1)
98 {
99 WMError err = windowManagerProxy_->ToggleShownStateForAllAppWindows();
100 ASSERT_EQ(err, WMError::WM_OK);
101 }
102
103 /**
104 * @tc.name: GetTopWindowId
105 * @tc.desc: test success
106 * @tc.type: FUNC
107 */
108 HWTEST_F(WindowManagerProxyTest, GetTopWindowId, TestSize.Level1)
109 {
110 uint32_t mainWinId = 0;
111 uint32_t topWinId;
112 WMError err = windowManagerProxy_->GetTopWindowId(mainWinId, topWinId);
113 ASSERT_EQ(err, WMError::WM_OK);
114 }
115
116 /**
117 * @tc.name: GetSnapshotByWindowId
118 * @tc.desc: test GetSnapshotByWindowId
119 * @tc.type: FUNC
120 */
121 HWTEST_F(WindowManagerProxyTest, GetSnapshotByWindowId, TestSize.Level1)
122 {
123 int windowId = INVALID_WINDOW_ID;
124 std::shared_ptr<Media::PixelMap> pixelMap = nullptr;
125 WMError err = windowManagerProxy_->GetSnapshotByWindowId(windowId, pixelMap);
126 ASSERT_EQ(err, WMError::WM_ERROR_NULLPTR);
127 }
128
129 /**
130 * @tc.name: NotifyWindowTransition
131 * @tc.desc: test success
132 * @tc.type: FUNC
133 */
134 HWTEST_F(WindowManagerProxyTest, NotifyWindowTransition, TestSize.Level1)
135 {
136 sptr<WindowTransitionInfo> from = new WindowTransitionInfo();
137 sptr<WindowTransitionInfo> to = new WindowTransitionInfo();
138 bool isFromClient = false;
139 WMError err = windowManagerProxy_->NotifyWindowTransition(from, to, isFromClient);
140 ASSERT_EQ(err, WMError::WM_OK);
141 }
142
143 /**
144 * @tc.name: GetModeChangeHotZones
145 * @tc.desc: test success
146 * @tc.type: FUNC
147 */
148 HWTEST_F(WindowManagerProxyTest, GetModeChangeHotZones, TestSize.Level1)
149 {
150 DisplayId displayId = 10;
151 ModeChangeHotZones hotZones;
152 WMError err = windowManagerProxy_->GetModeChangeHotZones(displayId, hotZones);
153 ASSERT_EQ(err, WMError::WM_OK);
154 }
155
156 /**
157 * @tc.name: MinimizeWindowsByLauncher
158 * @tc.desc: test success
159 * @tc.type: FUNC
160 */
161 HWTEST_F(WindowManagerProxyTest, MinimizeWindowsByLauncher, TestSize.Level1)
162 {
163 std::vector<uint32_t> windowIds;
164 bool isAnimated = false;
165 sptr<RSIWindowAnimationFinishedCallback> finishCallback;
166 windowManagerProxy_->MinimizeWindowsByLauncher(windowIds, isAnimated, finishCallback);
167 ASSERT_EQ(finishCallback, nullptr);
168 }
169
170 /**
171 * @tc.name: MinimizeWindowsByLauncher01
172 * @tc.desc: test success
173 * @tc.type: FUNC
174 */
175 HWTEST_F(WindowManagerProxyTest, MinimizeWindowsByLauncher01, TestSize.Level1)
176 {
177 std::vector<uint32_t> windowIds;
178 windowIds.push_back(0);
179 windowIds.push_back(1);
180 bool isAnimated = false;
181 sptr<RSIWindowAnimationFinishedCallback> finishCallback;
182 windowManagerProxy_->MinimizeWindowsByLauncher(windowIds, isAnimated, finishCallback);
183 ASSERT_EQ(finishCallback, nullptr);
184 }
185
186 /**
187 * @tc.name: UpdateRsTree
188 * @tc.desc: test success
189 * @tc.type: FUNC
190 */
191 HWTEST_F(WindowManagerProxyTest, UpdateRsTree, TestSize.Level1)
192 {
193 uint32_t windowId = 0;
194 bool isAdd = false;
195 WMError err = windowManagerProxy_->UpdateRsTree(windowId, isAdd);
196 ASSERT_EQ(err, WMError::WM_OK);
197 }
198
199 /**
200 * @tc.name: BindDialogTarget
201 * @tc.desc: test success
202 * @tc.type: FUNC
203 */
204 HWTEST_F(WindowManagerProxyTest, BindDialogTarget, TestSize.Level1)
205 {
206 uint32_t windowId = 0;
207 sptr<IRemoteObject> targetToken = nullptr;
208 WMError err = windowManagerProxy_->BindDialogTarget(windowId, targetToken);
209 ASSERT_EQ(err, WMError::WM_ERROR_IPC_FAILED);
210 }
211
212 /**
213 * @tc.name: BindDialogTarget01
214 * @tc.desc: test success
215 * @tc.type: FUNC
216 */
217 HWTEST_F(WindowManagerProxyTest, BindDialogTarget01, TestSize.Level1)
218 {
219 uint32_t windowId = 0;
220 sptr<IRemoteObject> targetToken = nullptr;
221 WMError err = windowManagerProxy_->BindDialogTarget(windowId, targetToken);
222 ASSERT_EQ(err, WMError::WM_ERROR_IPC_FAILED);
223 }
224
225 /**
226 * @tc.name: GetVisibilityWindowInfo01
227 * @tc.desc: test success
228 * @tc.type: FUNC
229 */
230 HWTEST_F(WindowManagerProxyTest, GetVisibilityWindowInfo01, TestSize.Level1)
231 {
232 std::vector<sptr<WindowVisibilityInfo>> infos;
233 WMError err = windowManagerProxy_->GetVisibilityWindowInfo(infos);
234 ASSERT_EQ(err, WMError::WM_OK);
235 }
236
237 /**
238 * @tc.name: GetUnreliableWindowInfo01
239 * @tc.desc: test success
240 * @tc.type: FUNC
241 */
242 HWTEST_F(WindowManagerProxyTest, GetUnreliableWindowInfo01, TestSize.Level1)
243 {
244 std::vector<sptr<UnreliableWindowInfo>> infos;
245 int32_t windowId = 0;
246 WMError err = windowManagerProxy_->GetUnreliableWindowInfo(windowId, infos);
247 ASSERT_EQ(err, WMError::WM_OK);
248 }
249
250 /**
251 * @tc.name: GetWindowAnimationTargets01
252 * @tc.desc: test success
253 * @tc.type: FUNC
254 */
255 HWTEST_F(WindowManagerProxyTest, GetWindowAnimationTargets01, TestSize.Level1)
256 {
257 std::vector<uint32_t> missionIds;
258 missionIds.push_back(0);
259 missionIds.push_back(1);
260 std::vector<sptr<RSWindowAnimationTarget>> targets;
261 WMError err = windowManagerProxy_->GetWindowAnimationTargets(missionIds, targets);
262 ASSERT_EQ(err, WMError::WM_OK);
263 }
264
265 /**
266 * @tc.name: RemoveWindow
267 * @tc.desc: test success
268 * @tc.type: FUNC
269 */
270 HWTEST_F(WindowManagerProxyTest, RemoveWindow, TestSize.Level1)
271 {
272 uint32_t windowId = 0;
273 bool isFromInnerkits = true;
274 WMError err = windowManagerProxy_->RemoveWindow(windowId, isFromInnerkits);
275 EXPECT_NE(err, static_cast<WMError>(1));
276 }
277
278 /**
279 * @tc.name: DestroyWindow
280 * @tc.desc: test success
281 * @tc.type: FUNC
282 */
283 HWTEST_F(WindowManagerProxyTest, DestroyWindow, TestSize.Level1)
284 {
285 uint32_t windowId = 0;
286 bool isFromInnerkits = true;
287 WMError err = windowManagerProxy_->DestroyWindow(windowId, isFromInnerkits);
288 EXPECT_NE(err, static_cast<WMError>(1));
289 }
290
291 /**
292 * @tc.name: GetAvoidAreaByType
293 * @tc.desc: test success
294 * @tc.type: FUNC
295 */
296 HWTEST_F(WindowManagerProxyTest, GetAvoidAreaByType, TestSize.Level1)
297 {
298 uint32_t windowId = 0;
299 AvoidAreaType type = AvoidAreaType::TYPE_SYSTEM;
300 AvoidArea avoidArea;
301 AvoidArea err = windowManagerProxy_->GetAvoidAreaByType(windowId, type);
302 EXPECT_EQ(err, avoidArea);
303 }
304
305 /**
306 * @tc.name: RegisterWindowManagerAgent
307 * @tc.desc: test success
308 * @tc.type: FUNC
309 */
310 HWTEST_F(WindowManagerProxyTest, RegisterWindowManagerAgent, TestSize.Level1)
311 {
312 MessageParcel reply;
313 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
314 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
315 WMError err = windowManagerProxy_->RegisterWindowManagerAgent(type, windowManagerAgent);
316 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
317 }
318
319 /**
320 * @tc.name: UnregisterWindowManagerAgent
321 * @tc.desc: test success
322 * @tc.type: FUNC
323 */
324 HWTEST_F(WindowManagerProxyTest, UnregisterWindowManagerAgent, TestSize.Level1)
325 {
326 MessageParcel reply;
327 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
328 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
329 WMError err = windowManagerProxy_->UnregisterWindowManagerAgent(type, windowManagerAgent);
330 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
331 }
332
333 /**
334 * @tc.name: NotifyServerReadyToMoveOrDrag
335 * @tc.desc: test success
336 * @tc.type: FUNC
337 */
338 HWTEST_F(WindowManagerProxyTest, NotifyServerReadyToMoveOrDrag, TestSize.Level1)
339 {
340 uint32_t windowId = 0;
341 sptr<WindowProperty> windowProperty;
342 sptr<MoveDragProperty> moveDragProperty;
343 MessageParcel reply;
344 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
345 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
346 windowManagerProxy_->NotifyServerReadyToMoveOrDrag(windowId, windowProperty, moveDragProperty);
347 WMError err = windowManagerProxy_->UnregisterWindowManagerAgent(type, windowManagerAgent);
348 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
349 }
350
351 /**
352 * @tc.name: ProcessPointDown
353 * @tc.desc: test success
354 * @tc.type: FUNC
355 */
356 HWTEST_F(WindowManagerProxyTest, ProcessPointDown, TestSize.Level1)
357 {
358 uint32_t windowId = 0;
359 bool isPointDown = true;
360 MessageParcel reply;
361 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
362 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
363 windowManagerProxy_->ProcessPointDown(windowId, isPointDown);
364 WMError err = windowManagerProxy_->UnregisterWindowManagerAgent(type, windowManagerAgent);
365 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
366 }
367
368 /**
369 * @tc.name: ProcessPointUp
370 * @tc.desc: test success
371 * @tc.type: FUNC
372 */
373 HWTEST_F(WindowManagerProxyTest, ProcessPointUp, TestSize.Level1)
374 {
375 uint32_t windowId = 0;
376 MessageParcel reply;
377 sptr<IWindowManagerAgent> windowManagerAgent = new WindowManagerAgent();
378 WindowManagerAgentType type = WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS;
379 windowManagerProxy_->ProcessPointUp(windowId);
380 WMError err = windowManagerProxy_->UnregisterWindowManagerAgent(type, windowManagerAgent);
381 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
382 }
383
384 /**
385 * @tc.name: MinimizeAllAppWindows
386 * @tc.desc: test success
387 * @tc.type: FUNC
388 */
389 HWTEST_F(WindowManagerProxyTest, MinimizeAllAppWindows, TestSize.Level1)
390 {
391 DisplayId displayId = 0;
392 WMError err = windowManagerProxy_->MinimizeAllAppWindows(displayId);
393 EXPECT_EQ(err, WMError::WM_OK);
394 }
395
396 /**
397 * @tc.name: SetWindowLayoutMode
398 * @tc.desc: test success
399 * @tc.type: FUNC
400 */
401 HWTEST_F(WindowManagerProxyTest, SetWindowLayoutMode, TestSize.Level1)
402 {
403 WindowLayoutMode mode = WindowLayoutMode::BASE;
404 MessageParcel reply;
405 WMError err = windowManagerProxy_->SetWindowLayoutMode(mode);
406 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
407 }
408
409 /**
410 * @tc.name: NotifyScreenshotEvent
411 * @tc.desc: test success
412 * @tc.type: FUNC
413 */
414 HWTEST_F(WindowManagerProxyTest, NotifyScreenshotEvent, TestSize.Level1)
415 {
416 ScreenshotEventType type = ScreenshotEventType::SCROLL_SHOT_START;
417 MessageParcel reply;
418 WMError err = windowManagerProxy_->NotifyScreenshotEvent(type);
419 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
420 }
421
422 /**
423 * @tc.name: UpdateProperty
424 * @tc.desc: test success
425 * @tc.type: FUNC
426 */
427 HWTEST_F(WindowManagerProxyTest, UpdateProperty, TestSize.Level1)
428 {
429 sptr<WindowProperty> windowProperty = new WindowProperty();
430 PropertyChangeAction action = PropertyChangeAction::ACTION_UPDATE_RECT;
431 bool isAsyncTask = true;
432 MessageParcel reply;
433 WMError err = windowManagerProxy_->UpdateProperty(windowProperty, action, isAsyncTask);
434 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
435 }
436
437 /**
438 * @tc.name: SetWindowGravity
439 * @tc.desc: test success
440 * @tc.type: FUNC
441 */
442 HWTEST_F(WindowManagerProxyTest, SetWindowGravity, TestSize.Level1)
443 {
444 uint32_t windowId = 1;
445 WindowGravity gravity = WindowGravity::WINDOW_GRAVITY_FLOAT;
446 uint32_t percent = 1;
447 MessageParcel reply;
448 WMError err = windowManagerProxy_->SetWindowGravity(windowId, gravity, percent);
449 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
450 }
451
452 /**
453 * @tc.name: GetSystemConfig
454 * @tc.desc: test success
455 * @tc.type: FUNC
456 */
457 HWTEST_F(WindowManagerProxyTest, GetSystemConfig, TestSize.Level1)
458 {
459 SystemConfig systemConfig;
460 MessageParcel reply;
461 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
462 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
463 }
464
465 /**
466 * @tc.name: UpdateAvoidAreaListener
467 * @tc.desc: test success
468 * @tc.type: FUNC
469 */
470 HWTEST_F(WindowManagerProxyTest, UpdateAvoidAreaListener, TestSize.Level1)
471 {
472 uint32_t windowId = 0;
473 bool haveListener = true;
474 MessageParcel reply;
475 WMError err = windowManagerProxy_->UpdateAvoidAreaListener(windowId, haveListener);
476 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
477 }
478
479 /**
480 * @tc.name: SetAnchorAndScale
481 * @tc.desc: test success
482 * @tc.type: FUNC
483 */
484 HWTEST_F(WindowManagerProxyTest, SetAnchorAndScale, TestSize.Level1)
485 {
486 int32_t x = 0;
487 int32_t y = 1;
488 float scale = 1.1;
489 MessageParcel reply;
490 SystemConfig systemConfig;
491 windowManagerProxy_->SetAnchorAndScale(x, y, scale);
492 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
493 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
494 }
495
496 /**
497 * @tc.name: SetAnchorOffset
498 * @tc.desc: test success
499 * @tc.type: FUNC
500 */
501 HWTEST_F(WindowManagerProxyTest, SetAnchorOffset, TestSize.Level1)
502 {
503 int32_t deltaX = 0;
504 int32_t deltaY = 1;
505 SystemConfig systemConfig;
506 MessageParcel reply;
507 windowManagerProxy_->SetAnchorOffset(deltaX, deltaY);
508 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
509 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
510 }
511
512 /**
513 * @tc.name: OffWindowZoom
514 * @tc.desc: test success
515 * @tc.type: FUNC
516 */
517 HWTEST_F(WindowManagerProxyTest, OffWindowZoom, TestSize.Level1)
518 {
519 SystemConfig systemConfig;
520 MessageParcel reply;
521 windowManagerProxy_->OffWindowZoom();
522 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
523 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
524 }
525
526 /**
527 * @tc.name: RaiseToAppTop
528 * @tc.desc: test success
529 * @tc.type: FUNC
530 */
531 HWTEST_F(WindowManagerProxyTest, RaiseToAppTop, TestSize.Level1)
532 {
533 uint32_t windowId = 0;
534 WMError err = windowManagerProxy_->RaiseToAppTop(windowId);
535 EXPECT_EQ(err, WMError::WM_OK);
536 }
537
538 /**
539 * @tc.name: GetSnapshot
540 * @tc.desc: test success
541 * @tc.type: FUNC
542 */
543 HWTEST_F(WindowManagerProxyTest, GetSnapshot, TestSize.Level1)
544 {
545 uint32_t windowId = 0;
546 Media::InitializationOptions opts;
547 opts.size.width = 200;
548 opts.size.height = 300;
549 std::shared_ptr<Media::PixelMap> pixelMap(Media::PixelMap::Create(opts).release());
550 auto res = windowManagerProxy_->GetSnapshot(windowId);
551 EXPECT_NE(res, pixelMap);
552 }
553
554 /**
555 * @tc.name: SetGestureNavigationEnabled
556 * @tc.desc: test success
557 * @tc.type: FUNC
558 */
559 HWTEST_F(WindowManagerProxyTest, SetGestureNavigationEnabled, TestSize.Level1)
560 {
561 bool enable = true;
562 MessageParcel reply;
563 WMError err = windowManagerProxy_->SetGestureNavigationEnabled(enable);
564 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
565 }
566
567 /**
568 * @tc.name: DispatchKeyEvent
569 * @tc.desc: test success
570 * @tc.type: FUNC
571 */
572 HWTEST_F(WindowManagerProxyTest, DispatchKeyEvent, TestSize.Level1)
573 {
574 uint32_t windowId = 0;
575 std::shared_ptr<MMI::KeyEvent> event = MMI::KeyEvent::Create();
576 SystemConfig systemConfig;
577 MessageParcel reply;
578 windowManagerProxy_->DispatchKeyEvent(windowId, event);
579 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
580 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
581 }
582
583 /**
584 * @tc.name: NotifyDumpInfoResult
585 * @tc.desc: test success
586 * @tc.type: FUNC
587 */
588 HWTEST_F(WindowManagerProxyTest, NotifyDumpInfoResult, TestSize.Level1)
589 {
590 std::vector<std::string> info;
591 string windowName = "windowName";
592 info.push_back(windowName);
593 SystemConfig systemConfig;
594 MessageParcel reply;
595 windowManagerProxy_->NotifyDumpInfoResult(info);
596 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
597 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
598 }
599
600 /**
601 * @tc.name: SetMaximizeMode
602 * @tc.desc: test success
603 * @tc.type: FUNC
604 */
605 HWTEST_F(WindowManagerProxyTest, SetMaximizeMode, TestSize.Level1)
606 {
607 MaximizeMode maximizeMode = MaximizeMode::MODE_FULL_FILL;
608 SystemConfig systemConfig;
609 MessageParcel reply;
610 windowManagerProxy_->SetMaximizeMode(maximizeMode);
611 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
612 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
613 }
614
615 /**
616 * @tc.name: GetMaximizeMode
617 * @tc.desc: test success
618 * @tc.type: FUNC
619 */
620 HWTEST_F(WindowManagerProxyTest, GetMaximizeMode, TestSize.Level1)
621 {
622 MessageParcel reply;
623 MaximizeMode mode = windowManagerProxy_->GetMaximizeMode();
624 EXPECT_NE(mode, static_cast<MaximizeMode>(reply.ReadInt32()));
625 }
626
627 /**
628 * @tc.name: GetFocusWindowInfo
629 * @tc.desc: test success
630 * @tc.type: FUNC
631 */
632 HWTEST_F(WindowManagerProxyTest, GetFocusWindowInfo, TestSize.Level1)
633 {
634 FocusChangeInfo focusInfo;
635 SystemConfig systemConfig;
636 MessageParcel reply;
637 windowManagerProxy_->GetFocusWindowInfo(focusInfo);
638 WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
639 EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
640 }
641 }
642 }
643 }
644