#include "chrome/browser/enterprise/signals/user_delegate_impl.h"
#include <set>
#include "base/files/file_path.h"
#include "base/test/scoped_feature_list.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/enterprise/connectors/device_trust/fake_device_trust_connector_service.h"
#include "chrome/test/base/testing_profile.h"
#include "components/policy/core/common/policy_types.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#endif
namespace enterprise_signals {
DTCPolicyLevel;
namespace {
constexpr char kUserEmail[] = …;
constexpr char kOtherUserEmail[] = …;
constexpr char kOtherUserGaiaId[] = …;
base::Value::List GetUrls() { … }
}
class UserDelegateImplTest : public testing::Test { … };
#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(UserDelegateImplTest, IsSigninContext_True) {
CreateDelegate(true,
base::FilePath(ash::kSigninBrowserContextBaseName));
EXPECT_TRUE(user_delegate_->IsSigninContext());
}
TEST_F(UserDelegateImplTest, IsSigninContext_False) {
CreateDelegate();
EXPECT_FALSE(user_delegate_->IsSigninContext());
}
#endif
TEST_F(UserDelegateImplTest, IsManagedUser_False) { … }
TEST_F(UserDelegateImplTest, IsManagedUser_True) { … }
TEST_F(UserDelegateImplTest, IsSameUser_NullManager) { … }
TEST_F(UserDelegateImplTest, IsSameManagedUser_DifferentUser) { … }
TEST_F(UserDelegateImplTest, IsSameUser_NoPrimaryUser) { … }
TEST_F(UserDelegateImplTest, IsSameUser_SameUser_Signin) { … }
TEST_F(UserDelegateImplTest, IsSameUser_SameUser_Sync) { … }
TEST_F(UserDelegateImplTest, GetPolicyScopesNeedingSignals_Empty) { … }
TEST_F(UserDelegateImplTest, GetPolicyScopesNeedingSignals_User) { … }
TEST_F(UserDelegateImplTest, GetPolicyScopesNeedingSignals_Browser) { … }
TEST_F(UserDelegateImplTest, GetPolicyScopesNeedingSignals_UserAndBrowser) { … }
}