chromium/third_party/ipcz/src/remote_portal_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 <string>
#include <string_view>
#include <utility>

#include "build/build_config.h"
#include "ipcz/ipcz.h"
#include "test/multinode_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/strings/str_cat.h"

namespace ipcz {
namespace {

RemotePortalTestNode;
RemotePortalTest;

static constexpr std::string_view kTestMessage1 =;
static constexpr std::string_view kTestMessage2 =;

MULTINODE_TEST_NODE(RemotePortalTestNode, BasicConnectionClient) {}

MULTINODE_TEST(RemotePortalTest, BasicConnection) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, PortalTransferClient) {}

MULTINODE_TEST(RemotePortalTest, PortalTransfer) {}

constexpr size_t kMultipleHopsNumIterations =;

MULTINODE_TEST_NODE(RemotePortalTestNode, MultipleHopsClient1) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, MultipleHopsClient2) {}

MULTINODE_TEST(RemotePortalTest, MultipleHops) {}

constexpr size_t kTransferBackAndForthNumIterations =;

MULTINODE_TEST_NODE(RemotePortalTestNode, TransferBackAndForthClient) {}

MULTINODE_TEST(RemotePortalTest, TransferBackAndForth) {}

constexpr size_t kHugeNumberOfPortalsCount =;

MULTINODE_TEST_NODE(RemotePortalTestNode, HugeNumberOfPortalsClient) {}

MULTINODE_TEST(RemotePortalTest, HugeNumberOfPortals) {}

constexpr size_t kRouteExpansionStressTestNumIterations =;

MULTINODE_TEST_NODE(RemotePortalTestNode, RoutingStressTestClient) {}

MULTINODE_TEST(RemotePortalTest, RoutingStressTest) {}

// For adequate test coverage this number needs to be large enough to trigger
// allocation of at least one new 64-byte BlockAllocator by the
// ClosurePropagationClient1 test node, which will occur approximately once for
// every 1024 routes created. We create a good bit more than that to be sure.
constexpr size_t kNumPortalsForClosurePropagation =;

MULTINODE_TEST_NODE(RemotePortalTestNode, ClosurePropagationClient1) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, ClosurePropagationClient2) {}

MULTINODE_TEST(RemotePortalTest, ClosurePropagation) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, DisconnectThroughProxyClient1) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, DisconnectThroughProxyClient2) {}

MULTINODE_TEST_NODE(RemotePortalTestNode, DisconnectThroughProxyClient3) {}

#if BUILDFLAG(IS_LINUX) && defined(ADDRESS_SANITIZER)
#define MAYBE_DisconnectThroughProxy
#else
#define MAYBE_DisconnectThroughProxy
#endif
MULTINODE_TEST(RemotePortalTest, MAYBE_DisconnectThroughProxy) {}

}  // namespace
}  // namespace ipcz