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 "thermal_mgr_dialog_test.h" 17 #include "action_popup.h" 18 19 using namespace testing::ext; 20 using namespace OHOS::PowerMgr; 21 using namespace OHOS; 22 using namespace std; 23 SetUpTestCase()24void ThermalMgrDialogTest::SetUpTestCase() {} 25 TearDownTestCase()26void ThermalMgrDialogTest::TearDownTestCase() {} 27 SetUp()28void ThermalMgrDialogTest::SetUp() {} 29 TearDown()30void ThermalMgrDialogTest::TearDown() {} 31 32 namespace { 33 /** 34 * @tc.name: ThermalMgrDialogTest001 35 * @tc.desc: test pull up HighThermalDialog in StartPowerDialog 36 * @tc.type: FUNC 37 * @tc.require: issueissueI5I9BF 38 */ 39 HWTEST_F(ThermalMgrDialogTest, ThermalMgrDialogTest001, TestSize.Level0) 40 { 41 auto popup = std::make_unique<ActionPopup>("Start HighThermal Dialog"); 42 EXPECT_TRUE(popup->ShowThermalDialog(ActionPopup::TempStatus::HIGHER_TEMP)); 43 } 44 45 /** 46 * @tc.name: ThermalMgrDialogTest002 47 * @tc.desc: test pull up LowThermalDialog in StartPowerDialog 48 * @tc.type: FUNC 49 * @tc.require: issueissueI5I9BF 50 */ 51 HWTEST_F(ThermalMgrDialogTest, ThermalMgrDialogTest002, TestSize.Level0) 52 { 53 auto popup = std::make_unique<ActionPopup>("Start LowThermal Dialog"); 54 EXPECT_TRUE(popup->ShowThermalDialog(ActionPopup::TempStatus::LOWER_TEMP)); 55 } 56 } // namespace