chromium/mojo/core/ipcz_driver/driver_for_ipcz_tests.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 <memory>
#include <set>
#include <string>
#include <utility>

#include "base/base_switches.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/process/process.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/multiprocess_test.h"
#include "base/test/test_timeouts.h"
#include "base/threading/simple_thread.h"
#include "build/build_config.h"
#include "mojo/core/ipcz_driver/driver.h"
#include "mojo/core/ipcz_driver/transport.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel_endpoint.h"
#include "third_party/ipcz/src/test/multinode_test.h"

namespace mojo::core::ipcz_driver {
namespace {

const char kParentHandle[] =;

const char kMojoIpczInProcessTestDriverName[] =;
const char kMojoIpczMultiprocessTestDriverName[] =;

class MojoIpczInProcessTestNodeController
    : public ipcz::test::TestNode::TestNodeController {};

class MojoIpczChildTestNodeController
    : public ipcz::test::TestNode::TestNodeController {};

// TestDriver implementation for the mojo-ipcz driver to have coverage in ipcz'
// multinode tests.
class MojoIpczTestDriver : public ipcz::test::TestDriver {};

ipcz::test::TestDriverRegistration<MojoIpczTestDriver> kRegisterInProcessDriver{
    MojoIpczTestDriver::kInProcess};

#if !BUILDFLAG(IS_IOS)
ipcz::test::TestDriverRegistration<MojoIpczTestDriver>
    kRegisterMultiprocessDriver{MojoIpczTestDriver::kMultiprocess};
#endif

}  // namespace
}  // namespace mojo::core::ipcz_driver