arkcompiler_toolchain/tooling/test/utils/test_channel.h
wengchangcheng a007687d8a Descriptor: Add testcase and bugfix for tooling
Details:
1. add variable testcase
2. delete unused variable of es2abc

Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/I5WFGB

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Ic51c302edbc957aacea80e80a3b09619d184016f
2022-10-19 00:04:31 +08:00

54 lines
1.9 KiB
C++

/*
* Copyright (c) 2022 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 ECMASCRIPT_TOOLING_TEST_UTILS_TEST_CHANNEL_H
#define ECMASCRIPT_TOOLING_TEST_UTILS_TEST_CHANNEL_H
#include "tooling/protocol_channel.h"
namespace panda::ecmascript::tooling {
class TestChannel : public ProtocolChannel {
public:
TestChannel() = default;
virtual ~TestChannel() override = default;
void WaitForDebugger() override
{
std::cout << "TestChannel: WaitForDebugger" << std::endl;
}
void RunIfWaitingForDebugger() override
{
std::cout << "TestChannel: RunIfWaitingForDebugger" << std::endl;
}
void SendResponse([[maybe_unused]] const DispatchRequest &request,
[[maybe_unused]] const DispatchResponse &response,
const PtBaseReturns &result) override
{
std::string str = result.ToJson()->Stringify();
std::cout << "TestChannel: SendResponse:\n" << str << std::endl;
}
void SendNotification(const PtBaseEvents &events) override
{
std::string str = events.ToJson()->Stringify();
std::cout << "TestChannel: SendNotification:\n" << str << std::endl;
}
private:
NO_COPY_SEMANTIC(TestChannel);
NO_MOVE_SEMANTIC(TestChannel);
};
} // namespace panda::ecmascript::tooling
#endif // ECMASCRIPT_TOOLING_TEST_UTILS_TEST_CHANNEL_H