chromium/remoting/host/daemon_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/daemon_process.h"

#include <stdint.h>

#include <memory>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/process/process.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/desktop_session.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
AnyNumber;
InSequence;
Invoke;

namespace remoting {

namespace {

// Provides a public constructor allowing the test to create instances of
// DesktopSession directly.
class FakeDesktopSession : public DesktopSession {};

class MockDaemonProcess : public DaemonProcess {};

FakeDesktopSession::FakeDesktopSession(DaemonProcess* daemon_process, int id)
    :{}

FakeDesktopSession::~FakeDesktopSession() = default;

MockDaemonProcess::MockDaemonProcess(
    scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
    scoped_refptr<AutoThreadTaskRunner> io_task_runner,
    base::OnceClosure stopped_callback)
    :{}

MockDaemonProcess::~MockDaemonProcess() = default;

std::unique_ptr<DesktopSession> MockDaemonProcess::DoCreateDesktopSession(
    int terminal_id,
    const ScreenResolution& resolution,
    bool virtual_terminal) {}

}  // namespace

class DaemonProcessTest : public testing::Test {};

DaemonProcessTest::DaemonProcessTest() = default;

DaemonProcessTest::~DaemonProcessTest() = default;

void DaemonProcessTest::SetUp() {}

void DaemonProcessTest::TearDown() {}

DesktopSession* DaemonProcessTest::DoCreateDesktopSession(int terminal_id) {}

void DaemonProcessTest::LaunchNetworkProcess() {}

void DaemonProcessTest::DeleteDaemonProcess() {}

void DaemonProcessTest::QuitMessageLoop() {}

void DaemonProcessTest::StartDaemonProcess() {}

MATCHER_P(Message, type, "") {}

TEST_F(DaemonProcessTest, OpenClose) {}

TEST_F(DaemonProcessTest, CallCloseDesktopSession) {}

// Sends two CloseDesktopSession messages and expects the second one to be
// ignored.
TEST_F(DaemonProcessTest, DoubleDisconnectTerminal) {}

// Tries to close an invalid terminal ID and expects the network process to be
// restarted.
TEST_F(DaemonProcessTest, InvalidDisconnectTerminal) {}

// Tries to open an invalid terminal ID and expects the network process to be
// restarted.
TEST_F(DaemonProcessTest, InvalidConnectTerminal) {}

}  // namespace remoting