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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
205 {
206     uint32_t windowId = 0;
207     sptr<IRemoteObject> targetToken = nullptr;
208     WMError err = windowManagerProxy_->BindDialogTarget(windowId, targetToken);
209     ASSERT_EQ(err, WMError::WM_OK);
210 }
211 
212 /**
213  * @tc.name: BindDialogTarget01
214  * @tc.desc: test success
215  * @tc.type: FUNC
216  */
217 HWTEST_F(WindowManagerProxyTest, BindDialogTarget01, Function | SmallTest | Level2)
218 {
219     uint32_t windowId = 0;
220     sptr<IRemoteObject> targetToken = nullptr;
221     WMError err = windowManagerProxy_->BindDialogTarget(windowId, targetToken);
222     ASSERT_EQ(err, WMError::WM_OK);
223 }
224 
225 /**
226  * @tc.name: GetVisibilityWindowInfo01
227  * @tc.desc: test success
228  * @tc.type: FUNC
229  */
230 HWTEST_F(WindowManagerProxyTest, GetVisibilityWindowInfo01, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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, Function | SmallTest | Level2)
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: UpdateProperty
411  * @tc.desc: test success
412  * @tc.type: FUNC
413  */
414 HWTEST_F(WindowManagerProxyTest, UpdateProperty, Function | SmallTest | Level2)
415 {
416     sptr<WindowProperty> windowProperty = new WindowProperty();
417     PropertyChangeAction action = PropertyChangeAction::ACTION_UPDATE_RECT;
418     bool isAsyncTask = true;
419     MessageParcel reply;
420     WMError err = windowManagerProxy_->UpdateProperty(windowProperty, action, isAsyncTask);
421     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
422 }
423 
424 /**
425  * @tc.name: SetWindowGravity
426  * @tc.desc: test success
427  * @tc.type: FUNC
428  */
429 HWTEST_F(WindowManagerProxyTest, SetWindowGravity, Function | SmallTest | Level2)
430 {
431     uint32_t windowId = 1;
432     WindowGravity gravity = WindowGravity::WINDOW_GRAVITY_FLOAT;
433     uint32_t percent = 1;
434     MessageParcel reply;
435     WMError err = windowManagerProxy_->SetWindowGravity(windowId, gravity, percent);
436     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
437 }
438 
439 /**
440  * @tc.name: GetSystemConfig
441  * @tc.desc: test success
442  * @tc.type: FUNC
443  */
444 HWTEST_F(WindowManagerProxyTest, GetSystemConfig, Function | SmallTest | Level2)
445 {
446     SystemConfig systemConfig;
447     MessageParcel reply;
448     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
449     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
450 }
451 
452 /**
453  * @tc.name: UpdateAvoidAreaListener
454  * @tc.desc: test success
455  * @tc.type: FUNC
456  */
457 HWTEST_F(WindowManagerProxyTest, UpdateAvoidAreaListener, Function | SmallTest | Level2)
458 {
459     uint32_t windowId = 0;
460     bool haveListener = true;
461     MessageParcel reply;
462     WMError err = windowManagerProxy_->UpdateAvoidAreaListener(windowId, haveListener);
463     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
464 }
465 
466 /**
467  * @tc.name: SetAnchorAndScale
468  * @tc.desc: test success
469  * @tc.type: FUNC
470  */
471 HWTEST_F(WindowManagerProxyTest, SetAnchorAndScale, Function | SmallTest | Level2)
472 {
473     int32_t x = 0;
474     int32_t y = 1;
475     float scale = 1.1;
476     MessageParcel reply;
477     SystemConfig systemConfig;
478     windowManagerProxy_->SetAnchorAndScale(x, y, scale);
479     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
480     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
481 }
482 
483 /**
484  * @tc.name: SetAnchorOffset
485  * @tc.desc: test success
486  * @tc.type: FUNC
487  */
488 HWTEST_F(WindowManagerProxyTest, SetAnchorOffset, Function | SmallTest | Level2)
489 {
490     int32_t deltaX = 0;
491     int32_t deltaY = 1;
492     SystemConfig systemConfig;
493     MessageParcel reply;
494     windowManagerProxy_->SetAnchorOffset(deltaX, deltaY);
495     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
496     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
497 }
498 
499 /**
500  * @tc.name: OffWindowZoom
501  * @tc.desc: test success
502  * @tc.type: FUNC
503  */
504 HWTEST_F(WindowManagerProxyTest, OffWindowZoom, Function | SmallTest | Level2)
505 {
506     SystemConfig systemConfig;
507     MessageParcel reply;
508     windowManagerProxy_->OffWindowZoom();
509     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
510     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
511 }
512 
513 /**
514  * @tc.name: RaiseToAppTop
515  * @tc.desc: test success
516  * @tc.type: FUNC
517  */
518 HWTEST_F(WindowManagerProxyTest, RaiseToAppTop, Function | SmallTest | Level2)
519 {
520     uint32_t windowId = 0;
521     WMError err = windowManagerProxy_->RaiseToAppTop(windowId);
522     EXPECT_EQ(err, WMError::WM_OK);
523 }
524 
525 /**
526  * @tc.name: GetSnapshot
527  * @tc.desc: test success
528  * @tc.type: FUNC
529  */
530 HWTEST_F(WindowManagerProxyTest, GetSnapshot, Function | SmallTest | Level2)
531 {
532     uint32_t windowId = 0;
533     Media::InitializationOptions opts;
534     opts.size.width = 200;
535     opts.size.height = 300;
536     std::shared_ptr<Media::PixelMap> pixelMap(Media::PixelMap::Create(opts).release());
537     auto res = windowManagerProxy_->GetSnapshot(windowId);
538     EXPECT_NE(res, pixelMap);
539 }
540 
541 /**
542  * @tc.name: SetGestureNavigaionEnabled
543  * @tc.desc: test success
544  * @tc.type: FUNC
545  */
546 HWTEST_F(WindowManagerProxyTest, SetGestureNavigaionEnabled, Function | SmallTest | Level2)
547 {
548     bool enable = true;
549     MessageParcel reply;
550     WMError err = windowManagerProxy_->SetGestureNavigaionEnabled(enable);
551     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
552 }
553 
554 /**
555  * @tc.name: DispatchKeyEvent
556  * @tc.desc: test success
557  * @tc.type: FUNC
558  */
559 HWTEST_F(WindowManagerProxyTest, DispatchKeyEvent, Function | SmallTest | Level2)
560 {
561     uint32_t windowId = 0;
562     std::shared_ptr<MMI::KeyEvent> event = MMI::KeyEvent::Create();
563     SystemConfig systemConfig;
564     MessageParcel reply;
565     windowManagerProxy_->DispatchKeyEvent(windowId, event);
566     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
567     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
568 }
569 
570 /**
571  * @tc.name: NotifyDumpInfoResult
572  * @tc.desc: test success
573  * @tc.type: FUNC
574  */
575 HWTEST_F(WindowManagerProxyTest, NotifyDumpInfoResult, Function | SmallTest | Level2)
576 {
577     std::vector<std::string> info;
578     string windowName = "windowName";
579     info.push_back(windowName);
580     SystemConfig systemConfig;
581     MessageParcel reply;
582     windowManagerProxy_->NotifyDumpInfoResult(info);
583     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
584     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
585 }
586 
587 /**
588  * @tc.name: SetMaximizeMode
589  * @tc.desc: test success
590  * @tc.type: FUNC
591  */
592 HWTEST_F(WindowManagerProxyTest, SetMaximizeMode, Function | SmallTest | Level2)
593 {
594     MaximizeMode maximizeMode = MaximizeMode::MODE_FULL_FILL;
595     SystemConfig systemConfig;
596     MessageParcel reply;
597     windowManagerProxy_->SetMaximizeMode(maximizeMode);
598     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
599     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
600 }
601 
602 /**
603  * @tc.name: GetMaximizeMode
604  * @tc.desc: test success
605  * @tc.type: FUNC
606  */
607 HWTEST_F(WindowManagerProxyTest, GetMaximizeMode, Function | SmallTest | Level2)
608 {
609     MessageParcel reply;
610     MaximizeMode mode = windowManagerProxy_->GetMaximizeMode();
611     EXPECT_NE(mode, static_cast<MaximizeMode>(reply.ReadInt32()));
612 }
613 
614 /**
615  * @tc.name: GetFocusWindowInfo
616  * @tc.desc: test success
617  * @tc.type: FUNC
618  */
619 HWTEST_F(WindowManagerProxyTest, GetFocusWindowInfo, Function | SmallTest | Level2)
620 {
621     FocusChangeInfo focusInfo;
622     SystemConfig systemConfig;
623     MessageParcel reply;
624     windowManagerProxy_->GetFocusWindowInfo(focusInfo);
625     WMError err = windowManagerProxy_->GetSystemConfig(systemConfig);
626     EXPECT_EQ(err, static_cast<WMError>(reply.ReadInt32()));
627 }
628 }
629 }
630 }
631