Files
distributedhardware_distrib…/sourcehandler/test/unittest/distributed_input_sourcehandler_test.h
T
xxxx a1a881e13d Description: add dinput
Match-id-c92defcb789a58ba9366cc3228089da299a9f750
2022-05-17 15:32:25 +08:00

65 lines
2.3 KiB
C++

/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DISRIBUTED_INPUT_SOURCEHANDLER_TEST_H
#define DISRIBUTED_INPUT_SOURCEHANDLER_TEST_H
#include <thread>
#include <functional>
#include <iostream>
#include <gtest/gtest.h>
#include <refbase.h>
#include "i_distributed_source_input.h"
#include "register_d_input_call_back_stub.h"
#include "unregister_d_input_call_back_stub.h"
#include "distributed_input_kit.h"
#include "distributed_input_source_handler.h"
#include "system_ability_load_callback_stub.h"
#include "constants_dinput.h"
#include "idistributed_hardware_source.h"
namespace OHOS {
namespace DistributedHardware {
namespace DistributedInput {
class DistributedInputSourceHandlerTest : public testing::Test {
public:
static void SetUpTestCase();
static void TearDownTestCase();
virtual void SetUp() override;
virtual void TearDown() override;
int32_t CheckSystemAbility();
class TestRegisterDInputCallback : public OHOS::DistributedHardware::RegisterCallback {
public:
TestRegisterDInputCallback() = default;
virtual ~TestRegisterDInputCallback() = default;
virtual int32_t OnRegisterResult(const std::string &devId, const std::string &dhId, int32_t status,
const std::string &data) override;
};
class TestUnregisterDInputCallback : public OHOS::DistributedHardware::UnregisterCallback {
public:
TestUnregisterDInputCallback() = default;
virtual ~TestUnregisterDInputCallback() = default;
virtual int32_t OnUnregisterResult(const std::string &devId, const std::string &dhId, int32_t status,
const std::string &data) override;
};
};
} // namespace DistributedInput
} // namespace DistributedHardware
} // namespace OHOS
#endif // DISRIBUTED_INPUT_SOURCEHANDLER_TEST_H