• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #include <gtest/gtest.h>
16 #include "window_scene.h"
17 #include "ability_context_impl.h"
18 #include "mock_static_call.h"
19 #include "singleton_mocker.h"
20 #include "window_impl.h"
21 #include <configuration.h>
22 
23 #include "window_scene_session_impl.h"
24 
25 using namespace testing;
26 using namespace testing::ext;
27 
28 namespace OHOS {
29 namespace Rosen {
30 using Mocker = SingletonMocker<StaticCall, MockStaticCall>;
31 class WindowSceneTest : public testing::Test {
32 public:
33     static void SetUpTestCase();
34     static void TearDownTestCase();
35     virtual void SetUp() override;
36     virtual void TearDown() override;
37 
38     sptr<WindowScene> scene_ = nullptr;
39     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext_;
40 };
SetUpTestCase()41 void WindowSceneTest::SetUpTestCase()
42 {
43 }
44 
TearDownTestCase()45 void WindowSceneTest::TearDownTestCase()
46 {
47 }
48 
SetUp()49 void WindowSceneTest::SetUp()
50 {
51     DisplayId displayId = 0;
52     sptr<IWindowLifeCycle> listener = nullptr;
53     scene_ = new WindowScene();
54     abilityContext_ = std::make_shared<AbilityRuntime::AbilityContextImpl>();
55     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
56     sptr<WindowOption> option = new WindowOption();
57     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(option)));
58     ASSERT_EQ(WMError::WM_OK, scene_->Init(displayId, abilityContext_, listener));
59 }
60 
TearDown()61 void WindowSceneTest::TearDown()
62 {
63     scene_->GoDestroy();
64     scene_ = nullptr;
65     abilityContext_ = nullptr;
66 }
67 
68 namespace {
69 /**
70  * @tc.name: Init01
71  * @tc.desc: Init Scene with null abilityContext, null listener
72  * @tc.type: FUNC
73  */
74 HWTEST_F(WindowSceneTest, Init01, Function | SmallTest | Level2)
75 {
76     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
77     sptr<WindowOption> optionTest = new WindowOption();
78     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
79     DisplayId displayId = 0;
80     sptr<IWindowLifeCycle> listener = nullptr;
81     sptr<WindowScene> scene = new WindowScene();
82     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
83     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
84 }
85 
86 /**
87  * @tc.name: Init02
88  * @tc.desc: Mock window Create Static Method return nullptr, init Scene with null abilityContext, null listener
89  * @tc.type: FUNC
90  */
91 HWTEST_F(WindowSceneTest, Init02, Function | SmallTest | Level2)
92 {
93     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
94     sptr<WindowOption> optionTest = new WindowOption();
95     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(nullptr));
96     DisplayId displayId = 0;
97     sptr<IWindowLifeCycle> listener = nullptr;
98     sptr<WindowScene> scene = new WindowScene();
99     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
100     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->Init(displayId, abilityContext, listener));
101 }
102 
103 /**
104  * @tc.name: Init03
105  * @tc.desc: Init Scene with abilityContext, null listener
106  * @tc.type: FUNC
107  */
108 HWTEST_F(WindowSceneTest, Init03, Function | SmallTest | Level2)
109 {
110     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
111     sptr<WindowOption> optionTest = new WindowOption();
112     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
113     DisplayId displayId = 0;
114     sptr<IWindowLifeCycle> listener = nullptr;
115     sptr<WindowScene> scene = new WindowScene();
116     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
117 }
118 
119 /**
120  * @tc.name: Init04
121  * @tc.desc: Init Scene with abilityContext, null listener
122  * @tc.type: FUNC
123  */
124 HWTEST_F(WindowSceneTest, Init04, Function | SmallTest | Level2)
125 {
126     sptr<WindowOption> optionTest = nullptr;
127     DisplayId displayId = 0;
128     sptr<IWindowLifeCycle> listener = nullptr;
129     sptr<WindowScene> scene = new WindowScene();
130     sptr<IRemoteObject> iSession = nullptr;
131     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->Init(displayId, abilityContext_, listener, optionTest, iSession));
132 }
133 
134 /**
135  * @tc.name: Init05
136  * @tc.desc: Init Scene with abilityContext, null listener
137  * @tc.type: FUNC
138  */
139 HWTEST_F(WindowSceneTest, Init05, Function | SmallTest | Level2)
140 {
141     sptr<WindowOption> optionTest = new WindowOption();
142     DisplayId displayId = 0;
143     sptr<IWindowLifeCycle> listener = nullptr;
144     sptr<WindowScene> scene = new WindowScene();
145     sptr<IRemoteObject> iSession = new IPCObjectStub();
146     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
147     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->Init(displayId, abilityContext, listener, optionTest, iSession));
148 }
149 
150 /**
151  * @tc.name: Create01
152  * @tc.desc: CreateWindow without windowName
153  * @tc.type: FUNC
154  */
155 HWTEST_F(WindowSceneTest, Create01, Function | SmallTest | Level2)
156 {
157     sptr<WindowOption> optionTest = new WindowOption();
158     sptr<WindowScene> scene = new WindowScene();
159     ASSERT_EQ(nullptr, scene->CreateWindow("", optionTest));
160 }
161 
162 /**
163  * @tc.name: Create02
164  * @tc.desc: CreateWindow with windowName and without mainWindow
165  * @tc.type: FUNC
166  */
167 HWTEST_F(WindowSceneTest, Create02, Function | SmallTest | Level2)
168 {
169     sptr<WindowOption> optionTest = new WindowOption();
170     sptr<WindowScene> scene = new WindowScene();
171     ASSERT_EQ(nullptr, scene->CreateWindow("WindowSceneTest02", optionTest));
172 }
173 
174 /**
175  * @tc.name: Create03
176  * @tc.desc: CreateWindow with windowName and mainWindow
177  * @tc.type: FUNC
178  */
179 HWTEST_F(WindowSceneTest, Create03, Function | SmallTest | Level2)
180 {
181     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
182     sptr<WindowOption> optionTest = new WindowOption();
183     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
184     ASSERT_NE(nullptr, scene_->CreateWindow("WindowSceneTest03", optionTest));
185 }
186 
187 /**
188  * @tc.name: Create04
189  * @tc.desc: Mock window Create Static Method return nullptr, createWindow with windowName and mainWindow
190  * @tc.type: FUNC
191  */
192 HWTEST_F(WindowSceneTest, Create04, Function | SmallTest | Level2)
193 {
194     sptr<WindowOption> optionTest = new WindowOption();
195     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
196     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(nullptr));
197     ASSERT_EQ(nullptr, scene_->CreateWindow("WindowSceneTest04", optionTest));
198 }
199 
200 /**
201  * @tc.name: Create05
202  * @tc.desc: createWindow with windowName and null option
203  * @tc.type: FUNC
204  */
205 HWTEST_F(WindowSceneTest, Create05, Function | SmallTest | Level2)
206 {
207     sptr<WindowOption> optionTest = nullptr;
208     ASSERT_EQ(nullptr, scene_->CreateWindow("WindowSceneTest05", optionTest));
209 }
210 
211 /**
212  * @tc.name: GetMainWindow01
213  * @tc.desc: GetMainWindow without scene init
214  * @tc.type: FUNC
215  */
216 HWTEST_F(WindowSceneTest, GetMainWindow01, Function | SmallTest | Level2)
217 {
218     sptr<WindowScene> scene = new WindowScene();
219     ASSERT_EQ(nullptr, scene->GetMainWindow());
220 }
221 
222 /**
223  * @tc.name: GetMainWindow02
224  * @tc.desc: GetMainWindow01 with nullptr
225  * @tc.type: FUNC
226  */
227 HWTEST_F(WindowSceneTest, GetMainWindow02, Function | SmallTest | Level2)
228 {
229     ASSERT_NE(nullptr, scene_->GetMainWindow());
230 }
231 
232 /**
233  * @tc.name: GetSubWindow01
234  * @tc.desc: GetSubWindow without scene init
235  * @tc.type: FUNC
236  */
237 HWTEST_F(WindowSceneTest, GetSubWindow01, Function | SmallTest | Level2)
238 {
239     sptr<WindowScene> scene = new WindowScene();
240     std::vector<sptr<Window>> subWindows = scene->GetSubWindow();
241     ASSERT_TRUE(subWindows.empty());
242 }
243 
244 /**
245  * @tc.name: GetSubWindow02
246  * @tc.desc: GetSubWindow without scene init
247  * @tc.type: FUNC
248  */
249 HWTEST_F(WindowSceneTest, GetSubWindow02, Function | SmallTest | Level2)
250 {
251     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
252     sptr<WindowOption> optionTest = new WindowOption();
253     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
254     DisplayId displayId = 0;
255     sptr<IWindowLifeCycle> listener = nullptr;
256     sptr<WindowScene> scene = new WindowScene();
257     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
258     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
259     std::vector<sptr<Window>> subWindows = scene->GetSubWindow();
260     ASSERT_TRUE(subWindows.empty());
261 }
262 
263 /**
264  * @tc.name: OnNewWant01
265  * @tc.desc: OnNewWant nullptr
266  * @tc.type: FUNC
267  */
268 HWTEST_F(WindowSceneTest, OnNewWant01, Function | SmallTest | Level2)
269 {
270     sptr<WindowScene> scene = new WindowScene();
271     AAFwk::Want want;
272     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->OnNewWant(want));
273 }
274 
275 /**
276  * @tc.name: OnNewWant02
277  * @tc.desc: OnNewWant without scene init
278  * @tc.type: FUNC
279  */
280 HWTEST_F(WindowSceneTest, OnNewWant02, Function | SmallTest | Level2)
281 {
282     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
283     sptr<WindowOption> optionTest = new WindowOption();
284     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
285     DisplayId displayId = 0;
286     sptr<IWindowLifeCycle> listener = nullptr;
287     sptr<WindowScene> scene = new WindowScene();
288     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
289     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
290     AAFwk::Want want;
291     ASSERT_EQ(WMError::WM_OK, scene->OnNewWant(want));
292 }
293 
294 /**
295  * @tc.name: UpdateConfiguration01
296  * @tc.desc: UpdateConfiguration01 without mainWindow
297  * @tc.type: FUNC
298  * @tc.require: issueI5JQ04
299  */
300 HWTEST_F(WindowSceneTest, UpdateConfiguration01, Function | SmallTest | Level2)
301 {
302     sptr<WindowScene> scene = new WindowScene();
303     std::shared_ptr<AppExecFwk::Configuration> configuration = nullptr;
304     scene->UpdateConfiguration(configuration);
305     int32_t level = 0;
306     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->NotifyMemoryLevel(level));
307 }
308 
309 /**
310  * @tc.name: UpdateConfiguration02
311  * @tc.desc: UpdateConfiguration without scene init
312  * @tc.type: FUNC
313  */
314 HWTEST_F(WindowSceneTest, UpdateConfiguration02, Function | SmallTest | Level2)
315 {
316     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
317     sptr<WindowOption> optionTest = new WindowOption();
318     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
319     DisplayId displayId = 0;
320     sptr<IWindowLifeCycle> listener = nullptr;
321     sptr<WindowScene> scene = new WindowScene();
322     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
323     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
324     std::shared_ptr<AppExecFwk::Configuration> configuration = std::make_shared<AppExecFwk::Configuration>();
325     scene->UpdateConfiguration(configuration);
326 }
327 
328 /**
329  * @tc.name: GetContentInfo01
330  * @tc.desc: GetContentInfo nullptr
331  * @tc.type: FUNC
332  */
333 HWTEST_F(WindowSceneTest, GetContentInfo01, Function | SmallTest | Level2)
334 {
335     sptr<WindowScene> scene = new WindowScene();
336     ASSERT_EQ("", scene->GetContentInfo());
337 }
338 
339 /**
340  * @tc.name: GetContentInfo02
341  * @tc.desc: GetContentInfo without scene init
342  * @tc.type: FUNC
343  */
344 HWTEST_F(WindowSceneTest, GetContentInfo02, Function | SmallTest | Level2)
345 {
346     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
347     sptr<WindowOption> optionTest = new WindowOption();
348     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
349     DisplayId displayId = 0;
350     sptr<IWindowLifeCycle> listener = nullptr;
351     sptr<WindowScene> scene = new WindowScene();
352     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
353     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
354     ASSERT_EQ("", scene->GetContentInfo());
355 }
356 
357 /**
358  * @tc.name: SetSystemBarProperty01
359  * @tc.desc: SetSystemBarProperty nullptr
360  * @tc.type: FUNC
361  */
362 HWTEST_F(WindowSceneTest, SetSystemBarProperty01, Function | SmallTest | Level2)
363 {
364     sptr<WindowScene> scene = new WindowScene();
365     WindowType type = WindowType::WINDOW_TYPE_DIALOG;
366     SystemBarProperty property;
367     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->SetSystemBarProperty(type, property));
368 }
369 
370 /**
371  * @tc.name: SetSystemBarProperty02
372  * @tc.desc: SetSystemBarProperty without scene init
373  * @tc.type: FUNC
374  */
375 HWTEST_F(WindowSceneTest, SetSystemBarProperty02, Function | SmallTest | Level2)
376 {
377     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
378     sptr<WindowOption> optionTest = new WindowOption();
379     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
380     DisplayId displayId = 0;
381     sptr<IWindowLifeCycle> listener = nullptr;
382     sptr<WindowScene> scene = new WindowScene();
383     std::shared_ptr<AbilityRuntime::AbilityContext> abilityContext = nullptr;
384     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext, listener));
385     WindowType type = WindowType::WINDOW_TYPE_DIALOG;
386     SystemBarProperty property;
387     ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, scene->SetSystemBarProperty(type, property));
388 }
389 
390 /**
391  * @tc.name: GoForeground01
392  * @tc.desc: GoForeground01 without mainWindow
393  * @tc.type: FUNC
394  */
395 HWTEST_F(WindowSceneTest, GoForeground01, Function | SmallTest | Level2)
396 {
397     sptr<WindowScene> scene = new WindowScene();
398     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->GoForeground());
399 }
400 
401 /**
402  * @tc.name: GoForeground02
403  * @tc.desc: GoForeground02 without mainWindow
404  * @tc.type: FUNC
405  */
406 HWTEST_F(WindowSceneTest, GoForeground02, Function | SmallTest | Level2)
407 {
408     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
409     sptr<WindowOption> optionTest = new WindowOption();
410     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
411     DisplayId displayId = 0;
412     sptr<IWindowLifeCycle> listener = nullptr;
413     sptr<WindowScene> scene = new WindowScene();
414     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
415     uint32_t reason = 0;
416     ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, scene->GoForeground(reason));
417 }
418 
419 /**
420  * @tc.name: GoBackground01
421  * @tc.desc: GoBackground01 without mainWindow
422  * @tc.type: FUNC
423  */
424 HWTEST_F(WindowSceneTest, GoBackground01, Function | SmallTest | Level2)
425 {
426     sptr<WindowScene> scene = new WindowScene();
427     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->GoBackground());
428 }
429 
430 /**
431  * @tc.name: GoBackground02
432  * @tc.desc: GoBackground02 without mainWindow
433  * @tc.type: FUNC
434  */
435 HWTEST_F(WindowSceneTest, GoBackground02, Function | SmallTest | Level2)
436 {
437     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
438     sptr<WindowOption> optionTest = new WindowOption();
439     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
440     DisplayId displayId = 0;
441     sptr<IWindowLifeCycle> listener = nullptr;
442     sptr<WindowScene> scene = new WindowScene();
443     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
444     uint32_t reason = 0;
445     ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, scene->GoBackground(reason));
446 }
447 
448 /**
449  * @tc.name: RequestFocus01
450  * @tc.desc: RequestFocus01 without mainWindow
451  * @tc.type: FUNC
452  */
453 HWTEST_F(WindowSceneTest, RequestFocus01, Function | SmallTest | Level2)
454 {
455     sptr<WindowScene> scene = new WindowScene();
456     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->RequestFocus());
457 }
458 
459 /**
460  * @tc.name: RequestFocus02
461  * @tc.desc: RequestFocus02 without mainWindow
462  * @tc.type: FUNC
463  */
464 HWTEST_F(WindowSceneTest, RequestFocus02, Function | SmallTest | Level2)
465 {
466     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
467     sptr<WindowOption> optionTest = new WindowOption();
468     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(optionTest)));
469     DisplayId displayId = 0;
470     sptr<IWindowLifeCycle> listener = nullptr;
471     sptr<WindowScene> scene = new WindowScene();
472     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
473     ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, scene->RequestFocus());
474 }
475 
476 /**
477  * @tc.name: NotifyMemoryLevel01
478  * @tc.desc: NotifyMemoryLevel without mainWindow
479  * @tc.type: FUNC
480  * @tc.require: issueI5JQ04
481  */
482 HWTEST_F(WindowSceneTest, NotifyMemoryLevel01, Function | SmallTest | Level2)
483 {
484     sptr<WindowScene> scene = new WindowScene();
485     int32_t level = 0;
486     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->NotifyMemoryLevel(level));
487 }
488 
489 /**
490  * @tc.name: NotifyMemoryLevel02
491  * @tc.desc: NotifyMemoryLevel with level
492  * @tc.type: FUNC
493  * @tc.require: issueI5JQ04
494  */
495 HWTEST_F(WindowSceneTest, NotifyMemoryLevel02, Function | SmallTest | Level2)
496 {
497     DisplayId displayId = 0;
498     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
499     sptr<IWindowLifeCycle> listener = nullptr;
500     sptr<WindowScene> scene = new WindowScene();
501     sptr<WindowOption> option = new WindowOption();
502     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowImpl(option)));
503     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
504     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->NotifyMemoryLevel(0)); // ui content is null
505 }
506 
507 /**
508  * @tc.name: NotifyMemoryLevel03
509  * @tc.desc: NotifyMemoryLevel with windowSceneSession
510  * @tc.type: FUNC
511  * @tc.require: issueI5JQ04
512  */
513 HWTEST_F(WindowSceneTest, NotifyMemoryLevel03, Function | SmallTest | Level2)
514 {
515     DisplayId displayId = 0;
516     std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
517     sptr<IWindowLifeCycle> listener = nullptr;
518     sptr<WindowScene> scene = new WindowScene();
519     sptr<WindowOption> option = new WindowOption();
520     EXPECT_CALL(m->Mock(), CreateWindow(_, _, _)).Times(1).WillOnce(Return(new WindowSceneSessionImpl(option)));
521     ASSERT_EQ(WMError::WM_OK, scene->Init(displayId, abilityContext_, listener));
522     ASSERT_EQ(WMError::WM_ERROR_NULLPTR, scene->NotifyMemoryLevel(0)); // ui content is null
523 }
524 
525 }
526 } // namespace Rosen
527 } // namespace OHOS