#include <optional>
#include <string>
#include "base/base64.h"
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/containers/flat_map.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/process/process.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/enterprise_companion/app/app.h"
#include "chrome/enterprise_companion/device_management_storage/dm_storage.h"
#include "chrome/enterprise_companion/enterprise_companion.h"
#include "chrome/enterprise_companion/enterprise_companion_client.h"
#include "chrome/enterprise_companion/enterprise_companion_status.h"
#include "chrome/enterprise_companion/global_constants.h"
#include "chrome/enterprise_companion/installer_paths.h"
#include "chrome/enterprise_companion/ipc_support.h"
#include "chrome/enterprise_companion/proto/enterprise_companion_event.pb.h"
#include "chrome/enterprise_companion/test/test_server.h"
#include "chrome/enterprise_companion/test/test_utils.h"
#include "components/named_mojo_ipc_server/named_mojo_ipc_server_client_util.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/test/policy_builder.h"
#include "components/policy/core/common/policy_switches.h"
#include "components/policy/test_support/client_storage.h"
#include "components/policy/test_support/embedded_policy_test_server.h"
#include "components/policy/test_support/policy_storage.h"
#include "device_management_backend.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_WIN)
#include "base/strings/utf_string_conversions.h"
#endif
namespace enterprise_companion {
namespace {
constexpr char kFakeEnrollmentToken[] = …;
constexpr char kFakeMachineLevelOmahaPolicyValue[] = …;
constexpr char kFakeMachineLevelUserPolicyValue[] = …;
constexpr char kFakeMachineLevelExtensionPolicyValue[] = …;
#if BUILDFLAG(IS_POSIX)
constexpr char kTestExe[] = …;
#elif BUILDFLAG(IS_WIN)
constexpr char kTestExe[] = "enterprise_companion_test.exe";
#endif
}
class IntegrationTests : public ::testing::Test { … };
TEST_F(IntegrationTests, Install) { … }
TEST_F(IntegrationTests, ShutdownWithoutServerFails) { … }
TEST_F(IntegrationTests, Shutdown) { … }
TEST_F(IntegrationTests, FetchPoliciesWithoutRegistrationFails) { … }
TEST_F(IntegrationTests, FetchPoliciesAndRegister) { … }
TEST_F(IntegrationTests, FetchPoliciesAlreadyRegistered) { … }
TEST_F(IntegrationTests, UnknownDMTokenInvalidated) { … }
TEST_F(IntegrationTests, ReloadsTokens) { … }
}