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 16 #include "power_mgr_powerdialog_test.h" 17 18 using namespace testing::ext; 19 using namespace OHOS::PowerMgr; 20 using namespace OHOS::EventFwk; 21 using namespace OHOS; 22 using namespace std; 23 SetUpTestCase()24void PowerMgrPowerDialog::SetUpTestCase() 25 { 26 auto pms = DelayedSpSingleton<PowerMgrService>::GetInstance(); 27 pms->OnStart(); 28 SystemAbility::MakeAndRegisterAbility(pms.GetRefPtr()); 29 } 30 TearDownTestCase()31void PowerMgrPowerDialog::TearDownTestCase() 32 { 33 } 34 SetUp()35void PowerMgrPowerDialog::SetUp() 36 { 37 } 38 TearDown()39void PowerMgrPowerDialog::TearDown() 40 { 41 } 42 43 namespace { 44 /** 45 * @tc.name: PowerMgr_PowerDialog_001 46 * @tc.desc: test pull up PowerDialog in ShowPowerDialog 47 * @tc.type: FUNC 48 * @tc.require: issueI5I9BF 49 */ 50 HWTEST_F(PowerMgrPowerDialog, PowerMgr_PowerDialog_001, TestSize.Level2) 51 { 52 auto powerMgrService = DelayedSpSingleton<PowerMgrService>::GetInstance(); 53 EXPECT_TRUE(powerMgrService->ShowPowerDialog()); 54 } 55 } 56