1 /*
2  * Copyright (c) 2022-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_ACTION_REPORT_TEST
17 #define THERMAL_ACTION_REPORT_TEST
18 
19 #include <gtest/gtest.h>
20 #include <string>
21 
22 #include "thermal_policy.h"
23 #include "thermal_test.h"
24 
25 namespace OHOS {
26 namespace PowerMgr {
27 class ThermalActionReportTest : public testing::Test, public ThermalTest {
28 public:
29     static void SetUpTestCase();
30     static void TearDownTestCase();
31     void TearDown();
32     static void ParserThermalSrvConfigFile();
33     static int32_t SetCondition(int32_t value, const std::string& scene);
34     static int32_t GetThermalLevel(int32_t expectValue);
35     static std::string GetActionValue(const std::string& actionName, uint32_t level);
36     static std::string ActionDecision(const std::string& actionName, std::vector<PolicyAction>& vAction);
37     static std::string ActionValueDecision(const std::string& actionName, std::vector<PolicyAction>& vAction);
38     static std::string LcdValueDecision(const std::string& actionName, std::vector<PolicyAction>& vAction);
39     static bool StateDecision(std::map<std::string, std::string>& actionPropMap);
40     static std::string GetScreenState();
41     static std::string GetChargeState();
42     static void GetStateMap(std::map<std::string, std::string>& stateMap);
43     static void ThermalActionTriggered(const std::string& actionName, int32_t level, const std::string& dumpInfo,
44         bool isReversed = false);
45 };
46 } // namespace PowerMgr
47 } // namespace OHOS
48 #endif // THERMAL_ACTION_REPORT_TEST
49