#include "components/policy/core/common/cloud/affiliation.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/policy/core/common/cloud/mock_user_cloud_policy_store.h"
#endif
IsEmpty;
UnorderedElementsAre;
namespace policy {
namespace {
constexpr char kAffiliationId1[] = …;
constexpr char kAffiliationId2[] = …;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kNonEmptyDmToken[] = …;
policy::MockCloudPolicyClient* ConnectNewMockClient(
policy::CloudPolicyCore* core) { … }
#endif
}
TEST(CloudManagementAffiliationTest, Affiliated) { … }
TEST(CloudManagementAffiliationTest, Unaffiliated) { … }
TEST(CloudManagementAffiliationTest, UserIdsEmpty) { … }
TEST(CloudManagementAffiliationTest, DeviceIdsEmpty) { … }
TEST(CloudManagementAffiliationTest, BothIdsEmpty) { … }
TEST(CloudManagementAffiliationTest, UserAffiliated) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST(CloudManagementAffiliationTest, GetUserAffiliationIdsFromCore_User) { … }
TEST(CloudManagementAffiliationTest, GetUserAffiliationIdsFromCore_Device) { … }
TEST(CloudManagementAffiliationTest, GetUserAffiliationIdsFromCore_NoClient) { … }
TEST(CloudManagementAffiliationTest,
GetUserAffiliationIdsFromCore_NoPolicyData) { … }
#endif
}