chromium/third_party/ipcz/src/ipcz/router_link_test.cc

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

#include "ipcz/router_link.h"

#include <tuple>
#include <utility>
#include <vector>

#include "ipcz/driver_memory.h"
#include "ipcz/driver_transport.h"
#include "ipcz/features.h"
#include "ipcz/ipcz.h"
#include "ipcz/link_side.h"
#include "ipcz/link_type.h"
#include "ipcz/local_router_link.h"
#include "ipcz/node.h"
#include "ipcz/node_link.h"
#include "ipcz/node_name.h"
#include "ipcz/remote_router_link.h"
#include "ipcz/router.h"
#include "ipcz/router_link_state.h"
#include "reference_drivers/sync_reference_driver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "util/ref_counted.h"

namespace ipcz {
namespace {

enum class RouterLinkTestMode {};

const IpczDriver& kTestDriver =;

constexpr NodeName kTestBrokerName(1, 2);
constexpr NodeName kTestNonBrokerName(2, 3);
constexpr NodeName kTestPeer1Name(3, 4);
constexpr NodeName kTestPeer2Name(4, 5);

// A helper for the tests in this module, TestNodePair creates one broker node
// and one non-broker node and interconnects them using the synchronous
// reference driver. This class exposes the NodeLinkMemory on either end of the
// connection and provides some additional facilities which tests can use to
// poke at node and router state.
class TestNodePair {};

class RouterLinkTest : public testing::Test,
                       public testing::WithParamInterface<RouterLinkTestMode> {};

TEST_P(RouterLinkTest, Locking) {}

TEST_P(RouterLinkTest, FlushOtherSideIfWaiting) {}

class RemoteRouterLinkTest : public testing::Test {};

TEST_F(RemoteRouterLinkTest, NewLinkWithAddressableState) {}

TEST_F(RemoteRouterLinkTest, NewLinkWithPendingState) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace ipcz