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 <cstring> 17 #include <gmock/gmock.h> 18 #include <gtest/gtest.h> 19 20 #include "ohos_init_web_adapter_impl.h" 21 22 using namespace testing; 23 using namespace testing::ext; 24 25 namespace OHOS::NWeb { 26 class OhosInitWebAdapterTest : public testing::Test { 27 public: 28 static void SetUpTestCase(void); 29 static void TearDownTestCase(void); 30 void SetUp(); 31 void TearDown(); 32 }; 33 SetUpTestCase(void)34void OhosInitWebAdapterTest::SetUpTestCase(void) 35 {} 36 TearDownTestCase(void)37void OhosInitWebAdapterTest::TearDownTestCase(void) 38 {} 39 SetUp(void)40void OhosInitWebAdapterTest::SetUp(void) 41 {} 42 TearDown(void)43void OhosInitWebAdapterTest::TearDown(void) 44 {} 45 46 /** 47 * @tc.name: OhosInitWebAdapterTest_SetRunWebInitedCallback_001 48 * @tc.desc: SetRunWebInitedCallback. 49 * @tc.type: FUNC 50 * @tc.require: 51 */ 52 HWTEST_F(OhosInitWebAdapterTest, OhosInitWebAdapterTest_SetRunWebInitedCallback_001, TestSize.Level1) 53 { 54 OhosInitWebAdapterImpl adapter; 55 adapter.SetRunWebInitedCallback(nullptr); 56 WebRunInitedCallback* callbackImpl = adapter.GetRunWebInitedCallback(); 57 EXPECT_EQ(callbackImpl, nullptr); 58 } 59 } // namespace OHOS