mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-28 01:21:13 +00:00
commit
87cf63a6d1
@ -130,6 +130,7 @@ HWTEST_F(DisplayPowerTest, register_display_power_event_listener_001, Function |
|
|||||||
sptr<IDisplayPowerEventListener> listener = new DisplayPowerEventListener();
|
sptr<IDisplayPowerEventListener> listener = new DisplayPowerEventListener();
|
||||||
bool ret = DisplayManager::GetInstance().RegisterDisplayPowerEventListener(listener);
|
bool ret = DisplayManager::GetInstance().RegisterDisplayPowerEventListener(listener);
|
||||||
ASSERT_EQ(true, ret);
|
ASSERT_EQ(true, ret);
|
||||||
|
DisplayManager::GetInstance().UnregisterDisplayPowerEventListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,6 +144,42 @@ HWTEST_F(DisplayPowerTest, register_display_power_event_listener_002, Function |
|
|||||||
ASSERT_EQ(false, ret);
|
ASSERT_EQ(false, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @tc.name: unregister_display_power_event_listener_001
|
||||||
|
* @tc.desc: call UnregisterDisplayPowerEventListener with a valid listener and check return value
|
||||||
|
* @tc.type: FUNC
|
||||||
|
*/
|
||||||
|
HWTEST_F(DisplayPowerTest, unregister_display_power_event_listener_001, Function | SmallTest | Level2)
|
||||||
|
{
|
||||||
|
sptr<IDisplayPowerEventListener> listener = new DisplayPowerEventListener();
|
||||||
|
DisplayManager::GetInstance().RegisterDisplayPowerEventListener(listener);
|
||||||
|
bool ret = DisplayManager::GetInstance().UnregisterDisplayPowerEventListener(listener);
|
||||||
|
ASSERT_EQ(true, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @tc.name: unregister_display_power_event_listener_002
|
||||||
|
* @tc.desc: call UnregisterDisplayPowerEventListener with nullptr and check return value
|
||||||
|
* @tc.type: FUNC
|
||||||
|
*/
|
||||||
|
HWTEST_F(DisplayPowerTest, unregister_display_power_event_listener_002, Function | SmallTest | Level2)
|
||||||
|
{
|
||||||
|
bool ret = DisplayManager::GetInstance().UnregisterDisplayPowerEventListener(nullptr);
|
||||||
|
ASSERT_EQ(false, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @tc.name: unregister_display_power_event_listener_003
|
||||||
|
* @tc.desc: call UnregisterDisplayPowerEventListener with an invalid listener and check return value
|
||||||
|
* @tc.type: FUNC
|
||||||
|
*/
|
||||||
|
HWTEST_F(DisplayPowerTest, unregister_display_power_event_listener_003, Function | SmallTest | Level2)
|
||||||
|
{
|
||||||
|
sptr<IDisplayPowerEventListener> listener = new DisplayPowerEventListener();
|
||||||
|
bool ret = DisplayManager::GetInstance().UnregisterDisplayPowerEventListener(listener);
|
||||||
|
ASSERT_EQ(false, ret);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @tc.name: set_display_state_001
|
* @tc.name: set_display_state_001
|
||||||
* @tc.desc: Call SetDisplayState and check if it the state set is the same as calling GetDisplayState
|
* @tc.desc: Call SetDisplayState and check if it the state set is the same as calling GetDisplayState
|
||||||
|
Loading…
Reference in New Issue
Block a user