#include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/linux_key_rotation_command.h"
#include <string>
#include <string_view>
#include <utility>
#include "base/base64.h"
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/multiprocess_test.h"
#include "base/test/scoped_path_override.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/threading/platform_thread.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/metrics_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/shared_command_constants.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/system/invitation.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.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"
_;
namespace enterprise_connectors {
namespace {
constexpr char kExitCodeHistogram[] = …;
constexpr char kNonce[] = …;
constexpr char kFakeDMToken[] = …;
constexpr char kFakeDmServerUrl[] = …;
static constexpr const char* kSwitches[] = …;
base::FilePath GetBinaryFilePath() { … }
}
class LinuxKeyRotationCommandTest : public testing::Test { … };
MULTIPROCESS_TEST_MAIN(MojoInvitation) { … }
TEST_F(LinuxKeyRotationCommandTest, MojoAcceptInvitation) { … }
MULTIPROCESS_TEST_MAIN(Success) { … }
TEST_F(LinuxKeyRotationCommandTest, RotateSuccess) { … }
MULTIPROCESS_TEST_MAIN(Failure) { … }
TEST_F(LinuxKeyRotationCommandTest, RotateFailure) { … }
MULTIPROCESS_TEST_MAIN(UnknownFailure) { … }
TEST_F(LinuxKeyRotationCommandTest, RotateFailure_UnknownError) { … }
TEST_F(LinuxKeyRotationCommandTest, RotateFailureInvalidProcess) { … }
TEST_F(LinuxKeyRotationCommandTest, NegativeExitCode) { … }
TEST_F(LinuxKeyRotationCommandTest, MissingServiceBinary) { … }
}