#include "base/memory/shared_memory_switch.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/process/launch.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/test/multiprocess_test.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
#include "base/files/platform_file.h"
#include "base/posix/global_descriptors.h"
#endif
namespace base {
namespace shared_memory {
namespace {
constexpr char kSharedMemoryData[] = …;
constexpr char kSharedMemoryGUID[] = …;
constexpr char kIsReadOnly[] = …;
constexpr size_t kArbitrarySize = …;
#if BUILDFLAG(IS_APPLE)
constexpr MachPortsForRendezvous::key_type kArbitraryRendezvousKey = 'smsh';
#elif BUILDFLAG(IS_POSIX)
constexpr GlobalDescriptors::Key kArbitraryDescriptorKey = …;
#endif
}
MULTIPROCESS_TEST_MAIN(InitFromSwitchValue) { … }
SharedMemorySwitchTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(SharedMemorySwitchTest, PassViaSwitch) { … }
}
}