#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/chrome_management_service.h"
#include <cstdint>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/multiprocess_test.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/shared_command_constants.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/key_rotation_manager.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/metrics_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/mojo_helper/mock_mojo_helper.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/mojo_helper/mojo_helper.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/system/invitation.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
_;
Test;
namespace enterprise_connectors {
namespace {
constexpr char kChromeManagementServiceStatusHistogramName[] = …;
constexpr char kFakeDMToken[] = …;
constexpr char kFakeDmServerUrl[] = …;
constexpr char kFakeNonce[] = …;
constexpr char kStringPipeName[] = …;
constexpr uint64_t kUintPipeName = …;
constexpr uint16_t kCustomErrorCode = …;
}
MockMojoHelper;
class ChromeManagementServiceTest : public testing::Test { … };
MULTIPROCESS_TEST_MAIN(Successful) { … }
TEST_F(ChromeManagementServiceTest, Success_Nonce) { … }
TEST_F(ChromeManagementServiceTest, Success_NoNonce) { … }
MULTIPROCESS_TEST_MAIN(CommandFailure) { … }
TEST_F(ChromeManagementServiceTest, Failure_IncorrectCommand) { … }
MULTIPROCESS_TEST_MAIN(PermissionsFailure) { … }
TEST_F(ChromeManagementServiceTest, Failure_IncorrectPermissions) { … }
MULTIPROCESS_TEST_MAIN(PlatformChannelEndpointFailure) { … }
TEST_F(ChromeManagementServiceTest,
MojoFailure_InvalidPlatformChannelEndpoint) { … }
MULTIPROCESS_TEST_MAIN(AcceptMojoInvitationFailure) { … }
TEST_F(ChromeManagementServiceTest, MojoFailure_AcceptInvitationFailure) { … }
MULTIPROCESS_TEST_MAIN(InvalidPipeHandle) { … }
TEST_F(ChromeManagementServiceTest, MojoFailure_InvalidPipeHandle) { … }
MULTIPROCESS_TEST_MAIN(InvalidPendingRemoteUrlLoaderFactory) { … }
TEST_F(ChromeManagementServiceTest,
MojoFailure_InvalidPendingRemoteLoaderFactory) { … }
MULTIPROCESS_TEST_MAIN(UnboundRemoteUrlLoaderFactory) { … }
TEST_F(ChromeManagementServiceTest, MojoFailure_UnboundRemoteLoaderFactory) { … }
MULTIPROCESS_TEST_MAIN(DisconnectedRemoteUrlLoaderFactory) { … }
TEST_F(ChromeManagementServiceTest,
MojoFailure_DisconnectedRemoteLoaderFactory) { … }
MULTIPROCESS_TEST_MAIN(RotateDTKeyFailure) { … }
TEST_F(ChromeManagementServiceTest, Failure_RotateDTKeyFailure) { … }
}