chromium/remoting/host/desktop_process_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/host/desktop_process.h"

#include <stdint.h>

#include <memory>
#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_listener.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "remoting/base/auto_thread.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/base/host_exit_codes.h"
#include "remoting/host/base/screen_resolution.h"
#include "remoting/host/desktop_process.h"
#include "remoting/host/fake_keyboard_layout_monitor.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/mojom/desktop_session.mojom.h"
#include "remoting/host/remote_open_url/fake_url_forwarder_configurator.h"
#include "remoting/protocol/fake_desktop_capturer.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
AnyNumber;
AtMost;
ByMove;
InSequence;
Return;

namespace remoting {

namespace {

class MockDaemonListener : public IPC::Listener,
                           public mojom::DesktopSessionRequestHandler {};

class MockNetworkListener : public IPC::Listener {};

bool MockDaemonListener::OnMessageReceived(const IPC::Message& message) {}

void MockDaemonListener::OnAssociatedInterfaceRequest(
    const std::string& interface_name,
    mojo::ScopedInterfaceEndpointHandle handle) {}

void MockDaemonListener::Disconnect() {}

bool MockNetworkListener::OnMessageReceived(const IPC::Message& message) {}

}  // namespace

class DesktopProcessTest : public testing::Test {};

DesktopProcessTest::DesktopProcessTest() = default;

DesktopProcessTest::~DesktopProcessTest() = default;

void DesktopProcessTest::CreateNetworkChannel(
    mojo::ScopedMessagePipeHandle desktop_pipe) {}

void DesktopProcessTest::StoreDesktopHandle(
    mojo::ScopedMessagePipeHandle desktop_pipe) {}

std::unique_ptr<DesktopEnvironment>
DesktopProcessTest::CreateDesktopEnvironment() {}

std::unique_ptr<InputInjector> DesktopProcessTest::CreateInputInjector() {}

void DesktopProcessTest::DisconnectChannels() {}

void DesktopProcessTest::PostDisconnectChannels() {}

void DesktopProcessTest::RunDesktopProcess() {}

void DesktopProcessTest::RunDeathTest() {}

void DesktopProcessTest::SendCrashRequest() {}

void DesktopProcessTest::SendStartSessionAgent() {}

void DesktopProcessTest::OnDesktopSessionAgentStarted(
    mojo::PendingAssociatedRemote<mojom::DesktopSessionControl>
        pending_remote) {}

// Launches the desktop process and then disconnects immediately.
TEST_F(DesktopProcessTest, Basic) {}

// Launches the desktop process and waits until the IPC channel is established.
TEST_F(DesktopProcessTest, CreateNetworkChannel) {}

// Launches the desktop process, waits until the IPC channel is established,
// then starts the desktop session agent.
TEST_F(DesktopProcessTest, StartSessionAgent) {}

// Run the desktop process and ask it to crash.
TEST_F(DesktopProcessTest, DeathTest) {}

}  // namespace remoting