!115 补充亮灭屏遗漏的systemtest

Merge pull request !115 from 沁心/dev0915
This commit is contained in:
openharmony_ci 2022-01-20 03:37:04 +00:00 committed by Gitee
commit 87cf63a6d1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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