#include "test/test_base.h"
#include <chrono>
#include <thread>
#include "api.h"
#include "ipcz/ipcz.h"
#include "ipcz/router.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/synchronization/notification.h"
#include "util/ref_counted.h"
namespace ipcz::test::internal {
namespace {
void CreateNodeChecked(const IpczAPI& ipcz,
const IpczDriver& driver,
IpczCreateNodeFlags flags,
IpczHandle& handle) { … }
void OpenPortalsChecked(const IpczAPI& ipcz,
IpczHandle node,
IpczHandle& first,
IpczHandle& second) { … }
}
TestBase::TestBase() { … }
TestBase::~TestBase() = default;
void TestBase::Close(IpczHandle handle) { … }
void TestBase::CloseAll(absl::Span<const IpczHandle> handles) { … }
IpczResult TestBase::Merge(IpczHandle a, IpczHandle b) { … }
IpczHandle TestBase::CreateNode(const IpczDriver& driver,
IpczCreateNodeFlags flags) { … }
std::pair<IpczHandle, IpczHandle> TestBase::OpenPortals(IpczHandle node) { … }
IpczResult TestBase::Put(IpczHandle portal,
std::string_view message,
absl::Span<IpczHandle> handles) { … }
IpczResult TestBase::Get(IpczHandle portal,
std::string* message,
absl::Span<IpczHandle> handles) { … }
IpczResult TestBase::Trap(IpczHandle portal,
const IpczTrapConditions& conditions,
TrapEventHandler fn,
IpczTrapConditionFlags* flags,
IpczPortalStatus* status) { … }
IpczResult TestBase::WaitForConditions(IpczHandle portal,
const IpczTrapConditions& conditions) { … }
IpczResult TestBase::WaitForConditionFlags(IpczHandle portal,
IpczTrapConditionFlags flags) { … }
IpczResult TestBase::WaitToGet(IpczHandle portal,
std::string* message,
absl::Span<IpczHandle> handles) { … }
std::string TestBase::WaitToGetString(IpczHandle portal) { … }
void TestBase::PingPong(IpczHandle portal) { … }
void TestBase::WaitForPingAndReply(IpczHandle portal) { … }
void TestBase::VerifyEndToEnd(IpczHandle portal) { … }
void TestBase::VerifyEndToEndLocal(IpczHandle a, IpczHandle b) { … }
void TestBase::WaitForDirectRemoteLink(IpczHandle portal) { … }
void TestBase::WaitForDirectLocalLink(IpczHandle a, IpczHandle b) { … }
void TestBase::HandleEvent(const IpczTrapEvent* event) { … }
}