1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // Copyright 2021 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #include "remoting/host/mojo_ipc/fake_ipc_server.h"
- namespace remoting {
- FakeIpcServer::TestState::TestState() = default;
- FakeIpcServer::TestState::~TestState() = default;
- FakeIpcServer::FakeIpcServer(TestState* test_state) : test_state_(test_state) {}
- FakeIpcServer::~FakeIpcServer() = default;
- void FakeIpcServer::StartServer() {
- test_state_->is_server_started = true;
- }
- void FakeIpcServer::StopServer() {
- test_state_->is_server_started = false;
- }
- void FakeIpcServer::Close(mojo::ReceiverId id) {
- test_state_->last_closed_receiver = id;
- }
- void FakeIpcServer::set_disconnect_handler(base::RepeatingClosure handler) {
- test_state_->disconnect_handler = handler;
- }
- mojo::ReceiverId FakeIpcServer::current_receiver() const {
- return test_state_->current_receiver;
- }
- base::ProcessId FakeIpcServer::current_peer_pid() const {
- return test_state_->current_peer_pid;
- }
- } // namespace remoting
|