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 <gtest/gtest.h>
17 #include "soc_perf_client_adapter_impl.h"
18
19 using namespace testing;
20 using namespace testing::ext;
21 using namespace OHOS;
22 using namespace OHOS::NWeb;
23
24 namespace OHOS::NWeb {
25 class SocPerfAdapterTest : public testing::Test {
26 public:
27 static void SetUpTestCase(void);
28 static void TearDownTestCase(void);
29 void SetUp();
30 void TearDown();
31 };
32
SetUpTestCase(void)33 void SocPerfAdapterTest::SetUpTestCase(void)
34 {}
35
TearDownTestCase(void)36 void SocPerfAdapterTest::TearDownTestCase(void)
37 {}
38
SetUp(void)39 void SocPerfAdapterTest::SetUp(void)
40 {}
41
TearDown(void)42 void SocPerfAdapterTest::TearDown(void)
43 {}
44
45 /**
46 * @tc.name: SocPerfAdapterTest_001.
47 * @tc.desc: test apply socperf config
48 * @tc.type: FUNC
49 * @tc.require:
50 */
51 HWTEST_F(SocPerfAdapterTest, SocPerfAdapterTest_001, TestSize.Level1)
52 {
53 std::unique_ptr<SocPerfClientAdapterImpl> socPerfClient = std::make_unique<SocPerfClientAdapterImpl>();
54 EXPECT_NE(socPerfClient, nullptr);
55 const int SOC_PERF_CONFIG_ID = 10020;
56 socPerfClient->ApplySocPerfConfigById(SOC_PERF_CONFIG_ID);
57 socPerfClient->ApplySocPerfConfigById(0);
58 socPerfClient->ApplySocPerfConfigByIdEx(SOC_PERF_CONFIG_ID, true);
59 socPerfClient->ApplySocPerfConfigByIdEx(0, true);
60 }
61 } // namespace NWeb
62