| // Copyright 2020 The Fuchsia Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| #ifndef SRC_DEVELOPER_DEBUG_DEBUG_AGENT_MOCK_STREAM_BACKEND_H_ | |
| #define SRC_DEVELOPER_DEBUG_DEBUG_AGENT_MOCK_STREAM_BACKEND_H_ | |
| #include "src/developer/debug/debug_agent/local_stream_backend.h" | |
| namespace debug_agent { | |
| class MockStreamBackend : public LocalStreamBackend { | |
| public: | |
| void HandleAttach(debug_ipc::AttachReply attach_reply) override { | |
| attach_replies_.push_back(std::move(attach_reply)); | |
| } | |
| void HandleNotifyProcessStarting(debug_ipc::NotifyProcessStarting notification) override { | |
| process_starts_.push_back(std::move(notification)); | |
| } | |
| void HandleNotifyModules(debug_ipc::NotifyModules modules) override { | |
| modules_.push_back(std::move(modules)); | |
| } | |
| const std::vector<debug_ipc::AttachReply>& attach_replies() const { return attach_replies_; } | |
| const std::vector<debug_ipc::NotifyProcessStarting>& process_starts() const { | |
| return process_starts_; | |
| } | |
| const std::vector<debug_ipc::NotifyModules> modules() const { return modules_; } | |
| void HandleNotifyException(debug_ipc::NotifyException exception) override { | |
| exceptions_.push_back(std::move(exception)); | |
| } | |
| const std::vector<debug_ipc::NotifyException>& exceptions() const { return exceptions_; } | |
| private: | |
| std::vector<debug_ipc::AttachReply> attach_replies_; | |
| std::vector<debug_ipc::NotifyProcessStarting> process_starts_; | |
| std::vector<debug_ipc::NotifyModules> modules_; | |
| std::vector<debug_ipc::NotifyException> exceptions_; | |
| }; | |
| } // namespace debug_agent | |
| #endif // SRC_DEVELOPER_DEBUG_DEBUG_AGENT_MOCK_STREAM_BACKEND_H_ |