#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/process/process.h"
#include "base/process/process_handle.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/token.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/invitation.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/constants.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_receiver.h"
#include "services/service_manager/public/cpp/test/test_service_manager.h"
#include "services/service_manager/public/mojom/service_manager.mojom.h"
#include "services/service_manager/service_process_launcher.h"
#include "services/service_manager/tests/service_manager/service_manager.test-mojom.h"
#include "services/service_manager/tests/service_manager/test_manifests.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace service_manager {
namespace {
void OnServiceStartedCallback(int* start_count,
std::string* service_name,
base::OnceClosure continuation,
const service_manager::Identity& identity) { … }
void OnServiceFailedToStartCallback(bool* run,
base::OnceClosure continuation,
const service_manager::Identity& identity) { … }
void OnServicePIDReceivedCallback(std::string* service_name,
uint32_t* service_pid,
base::OnceClosure continuation,
const service_manager::Identity& identity,
uint32_t pid) { … }
class TestService : public Service, public test::mojom::CreateInstanceTest { … };
class SimpleService : public Service { … };
}
class ServiceManagerTest : public testing::Test,
public mojom::ServiceManagerListener { … };
TEST_F(ServiceManagerTest, CreateInstance) { … }
TEST_F(ServiceManagerTest, CreatePackagedRegularInstances) { … }
TEST_F(ServiceManagerTest, CreatePackagedSharedAcrossGroupsInstances) { … }
TEST_F(ServiceManagerTest, CreatePackagedSingletonInstances) { … }
TEST_F(ServiceManagerTest, PIDReceivedCallback) { … }
TEST_F(ServiceManagerTest, ClientProcessCapabilityEnforced) { … }
TEST_F(ServiceManagerTest, ClonesDisconnectedConnectors) { … }
}