• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 
18 #include "screen_session_manager.h"
19 #include "screen_session_manager/include/fold_screen_controller/secondary_display_fold_policy.h"
20 #include "fold_screen_state_internel.h"
21 
22 using namespace testing;
23 using namespace testing::ext;
24 
25 namespace OHOS {
26 namespace Rosen {
27 namespace {
28 constexpr uint32_t SLEEP_TIME_US = 100000;
29 constexpr uint32_t INDEX_TWO = 2;
30 constexpr uint32_t INDEX_THREE = 3;
31 constexpr uint32_t SECONDARY_INIT_PARAM_SIZE = 5;
32 #define ONLY_FOR_SECONDARY_DISPLAY_FOLD if (!FoldScreenStateInternel::IsSecondaryDisplayFoldDevice()) {return;}
33 }
34 
35 class SecondaryDisplayFoldPolicyTest : public testing::Test {
36 public:
37     static void SetUpTestCase();
38     static void TearDownTestCase();
39     void SetUp() override;
40     void TearDown() override;
41 };
42 
SetUpTestCase()43 void SecondaryDisplayFoldPolicyTest::SetUpTestCase()
44 {
45 }
46 
TearDownTestCase()47 void SecondaryDisplayFoldPolicyTest::TearDownTestCase()
48 {
49 }
50 
SetUp()51 void SecondaryDisplayFoldPolicyTest::SetUp()
52 {
53 }
54 
TearDown()55 void SecondaryDisplayFoldPolicyTest::TearDown()
56 {
57     usleep(SLEEP_TIME_US);
58 }
59 
60 namespace {
61 /**
62  * @tc.name: ChangeScreenDisplayMode
63  * @tc.desc: test function : ChangeScreenDisplayMode
64  * @tc.type: FUNC
65  */
66 HWTEST_F(SecondaryDisplayFoldPolicyTest, ChangeScreenDisplayMode, Function | SmallTest | Level3)
67 {
68     ONLY_FOR_SECONDARY_DISPLAY_FOLD
69     std::recursive_mutex displayInfoMutex;
70     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
71     DisplayModeChangeReason reason = DisplayModeChangeReason::DEFAULT;
72     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
73 
74     FoldDisplayMode displayMode = FoldDisplayMode::UNKNOWN;
75     policy.ChangeScreenDisplayMode(displayMode, reason);
76     EXPECT_FALSE(policy.onBootAnimation_);
77 
78     displayMode = FoldDisplayMode::MAIN;
79     policy.ChangeScreenDisplayMode(displayMode, reason);
80     EXPECT_FALSE(policy.onBootAnimation_);
81 
82     displayMode = FoldDisplayMode::FULL;
83     policy.ChangeScreenDisplayMode(displayMode, reason);
84     EXPECT_FALSE(policy.onBootAnimation_);
85 
86     displayMode = FoldDisplayMode::GLOBAL_FULL;
87     policy.ChangeScreenDisplayMode(displayMode, reason);
88     EXPECT_FALSE(policy.onBootAnimation_);
89 }
90 
91 /**
92  * @tc.name: SendSensorResult
93  * @tc.desc: test function : SendSensorResult
94  * @tc.type: FUNC
95  */
96 HWTEST_F(SecondaryDisplayFoldPolicyTest, SendSensorResult, Function | SmallTest | Level3)
97 {
98     ONLY_FOR_SECONDARY_DISPLAY_FOLD
99     std::recursive_mutex displayInfoMutex;
100     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
101     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
102 
103     FoldStatus foldStatus = FoldStatus::UNKNOWN;
104     policy.SendSensorResult(foldStatus);
105     EXPECT_FALSE(policy.onBootAnimation_);
106 }
107 
108 /**
109  * @tc.name: SetOnBootAnimation
110  * @tc.desc: test function : SetOnBootAnimation
111  * @tc.type: FUNC
112  */
113 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetOnBootAnimation, Function | SmallTest | Level3)
114 {
115     ONLY_FOR_SECONDARY_DISPLAY_FOLD
116     std::recursive_mutex displayInfoMutex;
117     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
118     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
119 
120     policy.SetOnBootAnimation(false);
121     EXPECT_FALSE(policy.onBootAnimation_);
122 
123     policy.SetOnBootAnimation(true);
124     EXPECT_TRUE(policy.onBootAnimation_);
125 }
126 
127 /**
128  * @tc.name: RecoverWhenBootAnimationExit
129  * @tc.desc: test function : RecoverWhenBootAnimationExit
130  * @tc.type: FUNC
131  */
132 HWTEST_F(SecondaryDisplayFoldPolicyTest, RecoverWhenBootAnimationExit, Function | SmallTest | Level3)
133 {
134     ONLY_FOR_SECONDARY_DISPLAY_FOLD
135     std::recursive_mutex displayInfoMutex;
136     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
137     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
138 
139     policy.currentDisplayMode_ = FoldDisplayMode::UNKNOWN;
140     policy.RecoverWhenBootAnimationExit();
141     EXPECT_FALSE(policy.onBootAnimation_);
142 
143     policy.currentDisplayMode_ = FoldDisplayMode::GLOBAL_FULL;
144     policy.RecoverWhenBootAnimationExit();
145     EXPECT_FALSE(policy.onBootAnimation_);
146 
147     policy.currentDisplayMode_ = FoldDisplayMode::FULL;
148     policy.RecoverWhenBootAnimationExit();
149     EXPECT_FALSE(policy.onBootAnimation_);
150 
151     policy.currentDisplayMode_ = FoldDisplayMode::MAIN;
152     policy.RecoverWhenBootAnimationExit();
153     EXPECT_FALSE(policy.onBootAnimation_);
154 }
155 
156 /**
157  * @tc.name: GetModeMatchStatus
158  * @tc.desc: test function : GetModeMatchStatus
159  * @tc.type: FUNC
160  */
161 HWTEST_F(SecondaryDisplayFoldPolicyTest, GetModeMatchStatus, Function | SmallTest | Level3)
162 {
163     ONLY_FOR_SECONDARY_DISPLAY_FOLD
164     std::recursive_mutex displayInfoMutex;
165     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
166     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
167     FoldDisplayMode displayMode = FoldDisplayMode::UNKNOWN;
168 
169     policy.currentFoldStatus_ = FoldStatus::EXPAND;
170     displayMode = policy.GetModeMatchStatus();
171     EXPECT_EQ(FoldDisplayMode::FULL, displayMode);
172 
173     policy.currentFoldStatus_ = FoldStatus::FOLDED;
174     displayMode = policy.GetModeMatchStatus();
175     EXPECT_EQ(FoldDisplayMode::MAIN, displayMode);
176 
177     policy.currentFoldStatus_ = FoldStatus::HALF_FOLD;
178     displayMode = policy.GetModeMatchStatus();
179     EXPECT_EQ(FoldDisplayMode::FULL, displayMode);
180 
181     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_EXPAND_WITH_SECOND_EXPAND;
182     displayMode = policy.GetModeMatchStatus();
183     EXPECT_EQ(FoldDisplayMode::GLOBAL_FULL, displayMode);
184 
185     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_EXPAND_WITH_SECOND_HALF_FOLDED;
186     displayMode = policy.GetModeMatchStatus();
187     EXPECT_EQ(FoldDisplayMode::GLOBAL_FULL, displayMode);
188 
189     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_FOLDED_WITH_SECOND_EXPAND;
190     displayMode = policy.GetModeMatchStatus();
191     EXPECT_EQ(FoldDisplayMode::MAIN, displayMode);
192 
193     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_FOLDED_WITH_SECOND_HALF_FOLDED;
194     displayMode = policy.GetModeMatchStatus();
195     EXPECT_EQ(FoldDisplayMode::MAIN, displayMode);
196 
197     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_HALF_FOLDED_WITH_SECOND_EXPAND;
198     displayMode = policy.GetModeMatchStatus();
199     EXPECT_EQ(FoldDisplayMode::GLOBAL_FULL, displayMode);
200 
201     policy.currentFoldStatus_ = FoldStatus::FOLD_STATE_HALF_FOLDED_WITH_SECOND_HALF_FOLDED;
202     displayMode = policy.GetModeMatchStatus();
203     EXPECT_EQ(FoldDisplayMode::GLOBAL_FULL, displayMode);
204 }
205 
206 /**
207  * @tc.name: ChangeSuperScreenDisplayMode01
208  * @tc.desc: test function : ChangeSuperScreenDisplayMode
209  * @tc.type: FUNC
210  */
211 HWTEST_F(SecondaryDisplayFoldPolicyTest, ChangeSuperScreenDisplayMode01, Function | SmallTest | Level3)
212 {
213     ONLY_FOR_SECONDARY_DISPLAY_FOLD
214     std::recursive_mutex displayInfoMutex;
215     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = std::make_shared<TaskScheduler>("test");
216     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
217     sptr<ScreenSession> screenSession = new ScreenSession;
218 
219     std::vector<uint32_t> secondaryDisplayParams = policy.GetScreenParams();
220     EXPECT_EQ(secondaryDisplayParams.size(), SECONDARY_INIT_PARAM_SIZE);
221 
222     FoldDisplayMode displayMode = FoldDisplayMode::MAIN;
223     policy.ChangeSuperScreenDisplayMode(screenSession, displayMode);
224     ScreenProperty screenProperty = screenSession->GetScreenProperty();
225     uint32_t currentWidth = screenProperty.GetBounds().rect_.GetWidth();
226     uint32_t currentHeight = screenProperty.GetBounds().rect_.GetHeight();
227     EXPECT_EQ(currentWidth, secondaryDisplayParams[0]);
228     EXPECT_EQ(currentHeight, secondaryDisplayParams[INDEX_THREE]);
229 
230     displayMode = FoldDisplayMode::FULL;
231     policy.ChangeSuperScreenDisplayMode(screenSession, displayMode);
232     screenProperty = screenSession->GetScreenProperty();
233     currentWidth = screenProperty.GetBounds().rect_.GetWidth();
234     currentHeight = screenProperty.GetBounds().rect_.GetHeight();
235     EXPECT_EQ(currentWidth, secondaryDisplayParams[1]);
236     EXPECT_EQ(currentHeight, secondaryDisplayParams[INDEX_THREE]);
237 
238     displayMode = FoldDisplayMode::GLOBAL_FULL;
239     policy.ChangeSuperScreenDisplayMode(screenSession, displayMode);
240     screenProperty = screenSession->GetScreenProperty();
241     currentWidth = screenProperty.GetBounds().rect_.GetWidth();
242     currentHeight = screenProperty.GetBounds().rect_.GetHeight();
243     EXPECT_EQ(currentWidth, secondaryDisplayParams[INDEX_TWO]);
244     EXPECT_EQ(currentHeight, secondaryDisplayParams[INDEX_THREE]);
245 }
246 
247 /**
248  * @tc.name: SendPropertyChangeResult01
249  * @tc.desc: test function : SendPropertyChangeResult
250  * @tc.type: FUNC
251  */
252 HWTEST_F(SecondaryDisplayFoldPolicyTest, SendPropertyChangeResult01, Function | SmallTest | Level3)
253 {
254     ONLY_FOR_SECONDARY_DISPLAY_FOLD
255     std::recursive_mutex displayInfoMutex;
256     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = std::make_shared<TaskScheduler>("test");
257     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
258     sptr<ScreenSession> screenSession = new ScreenSession;
259     std::vector<uint32_t> secondaryDisplayParams = policy.GetScreenParams();
260     EXPECT_EQ(secondaryDisplayParams.size(), SECONDARY_INIT_PARAM_SIZE);
261 
262     FoldDisplayMode displayMode = FoldDisplayMode::MAIN;
263     policy.SendPropertyChangeResult(screenSession, 0, ScreenPropertyChangeReason::UNDEFINED, displayMode);
264     ScreenProperty screenProperty = screenSession->GetScreenProperty();
265     uint32_t currentWidth = screenProperty.GetBounds().rect_.GetWidth();
266     uint32_t currentHeight = screenProperty.GetBounds().rect_.GetHeight();
267     EXPECT_EQ(currentWidth, secondaryDisplayParams[0]);
268     EXPECT_EQ(currentHeight, secondaryDisplayParams[INDEX_THREE]);
269 }
270 
271 /**
272  * @tc.name: SetStatusFullActiveRectAndTpFeature
273  * @tc.desc: test function : SetStatusFullActiveRectAndTpFeature
274  * @tc.type: FUNC
275  */
276 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetStatusFullActiveRectAndTpFeature, Function | SmallTest | Level3)
277 {
278     ONLY_FOR_SECONDARY_DISPLAY_FOLD
279     std::recursive_mutex displayInfoMutex;
280     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
281     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
282     ScreenProperty property = policy.screenProperty_;
283 
284     policy.SetStatusFullActiveRectAndTpFeature(property);
285     EXPECT_FALSE(policy.onBootAnimation_);
286 }
287 
288 /**
289  * @tc.name: SetStatusMainActiveRectAndTpFeature
290  * @tc.desc: test function : SetStatusMainActiveRectAndTpFeature
291  * @tc.type: FUNC
292  */
293 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetStatusMainActiveRectAndTpFeature, Function | SmallTest | Level3)
294 {
295     ONLY_FOR_SECONDARY_DISPLAY_FOLD
296     std::recursive_mutex displayInfoMutex;
297     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
298     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
299     ScreenProperty property = policy.screenProperty_;
300 
301     policy.SetStatusMainActiveRectAndTpFeature(property);
302     EXPECT_FALSE(policy.onBootAnimation_);
303 }
304 
305 /**
306  * @tc.name: SetStatusGlobalFullActiveRectAndTpFeature
307  * @tc.desc: test function : SetStatusGlobalFullActiveRectAndTpFeature
308  * @tc.type: FUNC
309  */
310 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetStatusGlobalFullActiveRectAndTpFeature, Function | SmallTest | Level3)
311 {
312     ONLY_FOR_SECONDARY_DISPLAY_FOLD
313     std::recursive_mutex displayInfoMutex;
314     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
315     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
316     ScreenProperty property = policy.screenProperty_;
317 
318     policy.SetStatusGlobalFullActiveRectAndTpFeature(property);
319     EXPECT_FALSE(policy.onBootAnimation_);
320 }
321 
322 /**
323  * @tc.name: ReportFoldDisplayModeChange
324  * @tc.desc: test function : ReportFoldDisplayModeChange
325  * @tc.type: FUNC
326  */
327 HWTEST_F(SecondaryDisplayFoldPolicyTest, ReportFoldDisplayModeChange, Function | SmallTest | Level3)
328 {
329     ONLY_FOR_SECONDARY_DISPLAY_FOLD
330     std::recursive_mutex displayInfoMutex;
331     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
332     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
333 
334     FoldDisplayMode displayMode = FoldDisplayMode::UNKNOWN;
335     policy.ReportFoldDisplayModeChange(displayMode);
336     EXPECT_EQ(FoldDisplayMode::UNKNOWN, displayMode);
337 
338     displayMode = FoldDisplayMode::FULL;
339     policy.ReportFoldDisplayModeChange(displayMode);
340     EXPECT_NE(FoldDisplayMode::UNKNOWN, displayMode);
341 }
342 
343 /**
344  * @tc.name: GetCurrentFoldCreaseRegion
345  * @tc.desc: test function : GetCurrentFoldCreaseRegion
346  * @tc.type: FUNC
347  */
348 HWTEST_F(SecondaryDisplayFoldPolicyTest, GetCurrentFoldCreaseRegion, Function | SmallTest | Level3)
349 {
350     ONLY_FOR_SECONDARY_DISPLAY_FOLD
351     std::recursive_mutex displayInfoMutex;
352     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
353     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
354 
355     sptr<FoldCreaseRegion> foldCreaseRegion;
356     foldCreaseRegion = policy.GetCurrentFoldCreaseRegion();
357     EXPECT_EQ(policy.currentFoldCreaseRegion_, foldCreaseRegion);
358 }
359 
360 /**
361  * @tc.name: InitScreenParams
362  * @tc.desc: test function : InitScreenParams
363  * @tc.type: FUNC
364  */
365 HWTEST_F(SecondaryDisplayFoldPolicyTest, InitScreenParams, Function | SmallTest | Level3)
366 {
367     ONLY_FOR_SECONDARY_DISPLAY_FOLD
368     std::recursive_mutex displayInfoMutex;
369     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
370     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
371 
372     policy.InitScreenParams();
373     EXPECT_FALSE(policy.onBootAnimation_);
374 }
375 
376 /**
377  * @tc.name: SetSecondaryDisplayModeChangeStatus01
378  * @tc.desc: test function : SetSecondaryDisplayModeChangeStatus
379  * @tc.type: FUNC
380  */
381 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetSecondaryDisplayModeChangeStatus01, Function | SmallTest | Level3)
382 {
383     ONLY_FOR_SECONDARY_DISPLAY_FOLD
384     std::recursive_mutex displayInfoMutex;
385     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
386     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
387 
388     policy.SetSecondaryDisplayModeChangeStatus(true);
389     EXPECT_EQ(policy.secondaryPengdingTask_, 2);
390 
391     policy.SetSecondaryDisplayModeChangeStatus(false);
392     EXPECT_EQ(policy.secondaryPengdingTask_, 1);
393 
394     policy.SetSecondaryDisplayModeChangeStatus(false);
395     EXPECT_EQ(policy.secondaryPengdingTask_, 0);
396 }
397 
398 /**
399  * @tc.name: GetScreenSnapshotRect
400  * @tc.desc: test function : GetScreenSnapshotRect
401  * @tc.type: FUNC
402  */
403 HWTEST_F(SecondaryDisplayFoldPolicyTest, GetScreenSnapshotRect, Function | SmallTest | Level3)
404 {
405     ONLY_FOR_SECONDARY_DISPLAY_FOLD
406     std::recursive_mutex displayInfoMutex;
407     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
408     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
409 
410     policy.currentDisplayMode_ = FoldDisplayMode::UNKNOWN;
411     Drawing::Rect snapshotRect = {0, 0, 0, 0};
412     Drawing::Rect targetSnapshotRect = policy.GetScreenSnapshotRect();
413     EXPECT_EQ(snapshotRect, targetSnapshotRect);
414 
415     policy.currentDisplayMode_ = FoldDisplayMode::MAIN;
416     snapshotRect = {0, 0, 2232, 1008};
417     targetSnapshotRect = policy.GetScreenSnapshotRect();
418     EXPECT_EQ(snapshotRect, targetSnapshotRect);
419 
420     policy.currentDisplayMode_ = FoldDisplayMode::FULL;
421     snapshotRect = {0, 1136, 2232, 3184};
422     targetSnapshotRect = policy.GetScreenSnapshotRect();
423     EXPECT_EQ(snapshotRect, targetSnapshotRect);
424 
425     policy.currentDisplayMode_ = FoldDisplayMode::GLOBAL_FULL;
426     snapshotRect = {0, 0, 2232, 3184};
427     targetSnapshotRect = policy.GetScreenSnapshotRect();
428     EXPECT_EQ(snapshotRect, targetSnapshotRect);
429 }
430 
431 /**
432  * @tc.name: SetMainScreenRegion
433  * @tc.desc: test function : SetMainScreenRegion
434  * @tc.type: FUNC
435  */
436 HWTEST_F(SecondaryDisplayFoldPolicyTest, SetMainScreenRegion, Function | SmallTest | Level3)
437 {
438     ONLY_FOR_SECONDARY_DISPLAY_FOLD
439     std::recursive_mutex displayInfoMutex;
440     std::shared_ptr<TaskScheduler> screenPowerTaskScheduler = nullptr;
441     SecondaryDisplayFoldPolicy policy(displayInfoMutex, screenPowerTaskScheduler);
442 
443     policy.currentDisplayMode_ = FoldDisplayMode::UNKNOWN;
444     DMRect mainScreenRegion = {0, 0, 0, 0};
445     DMRect targetMainScreenRegion = {0, 0, 0, 0};
446     policy.SetMainScreenRegion(mainScreenRegion);
447     EXPECT_EQ(mainScreenRegion, targetMainScreenRegion);
448 
449     policy.currentDisplayMode_ = FoldDisplayMode::MAIN;
450     mainScreenRegion = {0, 0, 0, 0};
451     targetMainScreenRegion = {0, 0, 2232, 3184};
452     policy.SetMainScreenRegion(mainScreenRegion);
453     EXPECT_EQ(mainScreenRegion, targetMainScreenRegion);
454 
455     policy.currentDisplayMode_ = FoldDisplayMode::FULL;
456     mainScreenRegion = {0, 0, 0, 0};
457     targetMainScreenRegion = {0, 1136, 2232, 2048};
458     policy.SetMainScreenRegion(mainScreenRegion);
459     EXPECT_EQ(mainScreenRegion, targetMainScreenRegion);
460 
461     policy.currentDisplayMode_ = FoldDisplayMode::GLOBAL_FULL;
462     mainScreenRegion = {0, 0, 0, 0};
463     targetMainScreenRegion = {0, 0, 2232, 3184};
464     policy.SetMainScreenRegion(mainScreenRegion);
465     EXPECT_EQ(mainScreenRegion, targetMainScreenRegion);
466 }
467 }
468 } // namespace Rosen
469 } // namespace OHOS