1 /* 2 * Copyright (c) 2021-2023 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 #ifndef THERMAL_MGR_INTERFACE_TEST_H 17 #define THERMAL_MGR_INTERFACE_TEST_H 18 19 #include <gtest/gtest.h> 20 21 #include "ithermal_level_callback.h" 22 #include "ithermal_temp_callback.h" 23 #include "thermal_level_callback_stub.h" 24 #include "thermal_temp_callback_stub.h" 25 #include "thermal_test.h" 26 27 namespace OHOS { 28 namespace PowerMgr { 29 class ThermalMgrInterfaceTest : public testing::Test, public ThermalTest { 30 public: 31 void TearDown(); 32 void InitData(); 33 34 class ThermalTempTest1Callback : public ThermalTempCallbackStub { 35 public: ThermalTempTest1Callback()36 ThermalTempTest1Callback() {}; ~ThermalTempTest1Callback()37 virtual ~ThermalTempTest1Callback() {}; 38 virtual bool OnThermalTempChanged(TempCallbackMap& tempCbMap) override; 39 }; 40 41 class ThermalTempTest2Callback : public ThermalTempCallbackStub { 42 public: ThermalTempTest2Callback()43 ThermalTempTest2Callback() {}; ~ThermalTempTest2Callback()44 virtual ~ThermalTempTest2Callback() {}; 45 virtual bool OnThermalTempChanged(TempCallbackMap& tempCbMap) override; 46 }; 47 48 class ThermalLevelTest1Callback : public ThermalLevelCallbackStub { 49 public: ThermalLevelTest1Callback()50 ThermalLevelTest1Callback() {}; ~ThermalLevelTest1Callback()51 virtual ~ThermalLevelTest1Callback() {}; 52 virtual bool GetThermalLevel(ThermalLevel level) override; 53 }; 54 55 class ThermalLevelTest2Callback : public ThermalLevelCallbackStub { 56 public: ThermalLevelTest2Callback()57 ThermalLevelTest2Callback() {}; ~ThermalLevelTest2Callback()58 virtual ~ThermalLevelTest2Callback() {}; 59 virtual bool GetThermalLevel(ThermalLevel level) override; 60 }; 61 62 class ThermalLevelTest3Callback : public ThermalLevelCallbackStub { 63 public: ThermalLevelTest3Callback()64 ThermalLevelTest3Callback() {}; ~ThermalLevelTest3Callback()65 virtual ~ThermalLevelTest3Callback() {}; 66 virtual bool GetThermalLevel(ThermalLevel level) override; 67 }; 68 69 class ThermalLevelTest4Callback : public ThermalLevelCallbackStub { 70 public: ThermalLevelTest4Callback()71 ThermalLevelTest4Callback() {}; ~ThermalLevelTest4Callback()72 virtual ~ThermalLevelTest4Callback() {}; 73 virtual bool GetThermalLevel(ThermalLevel level) override; 74 }; 75 76 class ThermalLevelTest5Callback : public ThermalLevelCallbackStub { 77 public: ThermalLevelTest5Callback()78 ThermalLevelTest5Callback() {}; ~ThermalLevelTest5Callback()79 virtual ~ThermalLevelTest5Callback() {}; 80 virtual bool GetThermalLevel(ThermalLevel level) override; 81 }; 82 }; 83 } // namespace PowerMgr 84 } // namespace OHOS 85 #endif // THERMAL_MGR_INTERFACE_TEST_H 86