chromium/third_party/ipcz/src/test/test_child_launcher.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 "test/test_child_launcher.h"

#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include <string>
#include <string_view>
#include <vector>

#include "reference_drivers/handle_eintr.h"
#include "test/multinode_test.h"
#include "testing/multiprocess_func_list.h"
#include "third_party/abseil-cpp/absl/base/macros.h"
#include "third_party/abseil-cpp/absl/strings/str_cat.h"
#include "util/safe_math.h"

namespace ipcz::test {

namespace {

// NOTE: This switch name must be identical to Chromium's kTestChildProcess
// switch in //base/base_switches.h in order for these tests to work properly as
// part of any base::TestSuite based unit tests.
constexpr std::string_view kTestChildProcess =;

// Used to tell a forked child process which open file descriptor corresponds to
// its ipcz driver's SocketTransport.
constexpr std::string_view kSocketFd =;

using ArgList = std::vector<std::string>;
ArgList& GetArgList() {}

std::string& GetTestNodeName() {}

reference_drivers::FileDescriptor& GetSocketFd() {}

template <typename ValueType>
std::string MakeSwitch(std::string_view name, ValueType value) {}

// Produces an argv-style data representation of a vector of strings.
std::vector<char*> MakeExecArgv(ArgList& args) {}

int GetMaxFds() {}

}  // namespace

TestChildLauncher::TestChildLauncher() = default;

TestChildLauncher::~TestChildLauncher() = default;

// static
void TestChildLauncher::Initialize(int argc, char** argv) {}

// static
bool TestChildLauncher::RunTestChild(int& exit_code) {}

// static
reference_drivers::FileDescriptor
TestChildLauncher::TakeChildSocketDescriptor() {}

// static
bool TestChildLauncher::WaitForSuccessfulProcessTermination(pid_t pid) {}

pid_t TestChildLauncher::Launch(std::string_view node_name,
                                std::string_view feature_set,
                                reference_drivers::FileDescriptor socket) {}

}  // namespace ipcz::test