Use new enum-class style value for UserType.
As for UserType, we are switching from enum to enum-class. This CL mechanically replaces enum values to enum-class style. For each type (regular, child, guest, public_account, kiosk_app, arc_kiosk_app and web_kiosk_app), the following command are run: git grep -l 'UserType::USER_TYPE_REGULAR' | \ xargs sed -i '' \ -e 's/UserType::USER_TYPE_REGULAR/UserType::kRegular/g' git grep -l 'user_manager::USER_TYPE_REGULAR' | \ xargs sed -i '' \ -e 's/user_manager::USER_TYPE_REGULAR/user_manager::UserType::kRegular/g' Then, tools/*, force_installed_metrics.* are excluded manually, because tools/* are out of scope, force_installed_metrics.* cannot be handled mechanically due to naming overlap. The force_installed_metrics.* files will be updated in a following CL. Also, legacy aliases in user_type.h will be removed in another CL, as well. BUG=b:278643115 TEST=Tryjob. Change-Id: I04747a6403de3f367460b668f48f13016195a3f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5246971 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Hidehiko Abe <hidehiko@chromium.org> Cr-Commit-Position: refs/heads/main@{#1253987}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
0e1cf96ee0
commit
e3e167e504
ash
accelerators
accessibility
ambient
app_list
assistant
capture_mode
clipboard
components
arc
detachable_base
display
display_manager_unittest.ccdisplay_prefs.ccdisplay_prefs_unittest.ccresolution_notification_controller_unittest.cc
login
ui
local_authentication_request_controller_impl_pixeltest.cclocal_authentication_request_controller_impl_unittest.cclock_contents_view.cclock_contents_view_unittest.cclock_debug_view.cclogin_auth_user_view.cclogin_big_user_view.cclogin_expanded_public_account_view.cclogin_public_account_user_view.cclogin_remove_account_dialog.cclogin_remove_account_dialog_unittest.cclogin_test_utils.cclogin_user_view.cc
metrics
multi_device_setup
public
cpp
session
quick_pair
companion_app
feature_status_tracker
keyed_service
pairing
scanning
ui
fast_pair
session
session_controller_impl.ccsession_controller_impl_unittest.cctest_session_controller_client.cctest_session_controller_client.h
shelf
system
diagnostics
federated
firmware_update
focus_mode
human_presence
input_device_settings
notification_center
palette
power
scheduled_feature
session
time
unified
test
touch
user_education
wallpaper
webui
file_manager
wm
desks
gestures
tablet_mode
window_cycle
chrome/browser
ash
accessibility
arc
assistant
child_accounts
crosapi
browser_manager.ccdlp_ash_unittest.ccdocument_scan_ash_unittest.ccenvironment_provider.cclogin_ash.cc
crostini
eol_incentive_util.ccextensions
users_private
file_manager
file_suggest
first_run
kcer
login
demo_mode
device_family_link_allowed_policy_browsertest.ccencryption_migration_browsertest.ccenterprise_user_session_metrics.ccenterprise_user_session_metrics_unittest.ccexisting_user_controller.ccexisting_user_controller_browsertest.cclock
login_manager_test.ccquick_unlock
quickstart_controller.ccreporting
saml
screens
chrome_user_selection_screen.ccencryption_migration_screen.ccerror_screen.cclocale_switch_screen.cc
osauth
sync_consent_screen.ccuser_selection_screen.ccsession
signin
test
ui
users
webview_login_browsertest.ccwizard_controller.ccownership
plugin_vm
policy
affiliation
core
device_cloud_policy_manager_ash.ccdevice_local_account_browsertest.ccreporting_user_tracker.ccuser_cloud_policy_manager_ash.ccuser_cloud_policy_manager_ash_unittest.ccuser_cloud_policy_manager_factory_ash.ccuser_cloud_policy_token_forwarder_unittest.cc
dlp
handlers
invalidation
networking
off_hours
reporting
metrics_reporting
fatal_crash
network
user_added_removed
status_collector
remote_apps
settings
system
system_logs
system_web_apps
apps
chromeos
extensions
login_screen
policy
dlp
download
enterprise
extensions
feedback
system_logs
log_sources
media
webrtc
metrics
chromeos_metrics_provider_browsertest.ccper_user_state_manager_chromeos.ccper_user_state_manager_chromeos_browsertest.ccper_user_state_manager_chromeos_unittest.cc
structured
usertype_by_devicetype_metrics_provider_browsertest.ccpolicy
developer_tools_policy_handler_unittest.cc
networking
profile_policy_connector.ccprofile_policy_connector_unittest.ccprofiles
supervised_user
ui
ash
app_access_notifier_unittest.cc
holding_space
login_screen_client_impl.ccprojector
session_controller_client_impl.ccsystem_tray_tray_cast_browsertest_media_router_chromeos.ccwallpaper_controller_client_impl.ccstartup
webui
ash
login
settings
settings
signin
web_applications
isolated_web_apps
chromeos/ash
components
login
auth
auth_performer.ccauth_performer_unittest.ccauth_session_authenticator.ccauth_session_authenticator_unittest.cclogin_performer.cc
public
stub_authenticator.cclogin_state
standalone_browser
services
bluetooth_config
components
@ -446,7 +446,7 @@ bool CanCreateNewIncognitoWindow() {
|
||||
// For non-guest mode, consume the key and defer the decision to the browser.
|
||||
std::optional<user_manager::UserType> user_type =
|
||||
Shell::Get()->session_controller()->GetUserType();
|
||||
return user_type && *user_type != user_manager::USER_TYPE_GUEST;
|
||||
return user_type && *user_type != user_manager::UserType::kGuest;
|
||||
}
|
||||
|
||||
bool CanCycleInputMethod() {
|
||||
|
@ -317,7 +317,7 @@ bool IsSigninPrefService(PrefService* pref_service) {
|
||||
bool IsCurrentSessionGuest() {
|
||||
const std::optional<user_manager::UserType> user_type =
|
||||
Shell::Get()->session_controller()->GetUserType();
|
||||
return user_type && *user_type == user_manager::USER_TYPE_GUEST;
|
||||
return user_type && *user_type == user_manager::UserType::kGuest;
|
||||
}
|
||||
|
||||
bool IsUserFirstLogin() {
|
||||
|
@ -2128,7 +2128,7 @@ TEST_F(AmbientControllerForManagedScreensaverLoginScreenTest,
|
||||
EXPECT_TRUE(ambient_controller()->ShouldShowAmbientUi());
|
||||
ASSERT_TRUE(GetContainerView());
|
||||
|
||||
SimulateKioskMode(user_manager::UserType::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kWebKioskApp);
|
||||
EXPECT_FALSE(ambient_controller()->ShouldShowAmbientUi());
|
||||
SetAmbientModeManagedScreensaverEnabled(true);
|
||||
EXPECT_EQ(AmbientUiModel::Get()->ui_visibility(),
|
||||
|
@ -180,7 +180,7 @@ TEST_F(ScreensaverImagesPolicyHandlerTest, FactoryFunctionTestSignin) {
|
||||
TEST_F(ScreensaverImagesPolicyHandlerTest, FactoryFunctionTestUser) {
|
||||
// User
|
||||
RegisterUserWithUserPrefs(AccountId::FromUserEmail(kUserEmail),
|
||||
user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType::kRegular);
|
||||
auto handler = ScreensaverImagesPolicyHandler::Create(active_prefs());
|
||||
// Verify that the policy handler detected the new user and created a new
|
||||
// image downloader instance.
|
||||
@ -192,7 +192,7 @@ TEST_F(ScreensaverImagesPolicyHandlerTest, FactoryFunctionTestManagedGuest) {
|
||||
// Managed Guest
|
||||
GetSessionControllerClient()->RequestSignOut();
|
||||
RegisterUserWithUserPrefs(AccountId::FromUserEmail(kUserEmail),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
auto handler = ScreensaverImagesPolicyHandler::Create(
|
||||
Shell::Get()->session_controller()->GetActivePrefService());
|
||||
// Verify that the policy handler detected the new user and created a new
|
||||
@ -222,7 +222,7 @@ class ScreensaverImagesPolicyHandlerForAnySessionTest
|
||||
switch (test_case.handle_type) {
|
||||
case ScreensaverImagesPolicyHandler::HandlerType::kUser:
|
||||
RegisterUserWithUserPrefs(AccountId::FromUserEmail(kUserEmail),
|
||||
user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType::kRegular);
|
||||
break;
|
||||
case ScreensaverImagesPolicyHandler::HandlerType::kSignin: {
|
||||
auto pref_service = std::make_unique<TestingPrefServiceSimple>();
|
||||
@ -234,7 +234,7 @@ class ScreensaverImagesPolicyHandlerForAnySessionTest
|
||||
} break;
|
||||
case ScreensaverImagesPolicyHandler::HandlerType::kManagedGuest:
|
||||
RegisterUserWithUserPrefs(AccountId::FromUserEmail(kUserEmail),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ TEST_F(AppListFeatureUsageMetricsTest, InitialMetricsWithTabletModeSupport) {
|
||||
}
|
||||
|
||||
TEST_F(AppListFeatureUsageMetricsTest, NotEligibleInKioskMode) {
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
FastForwardPastMetricsReportingInterval();
|
||||
|
||||
histograms_.ExpectBucketCount(kClamshellMetric, kEligible, 0);
|
||||
|
@ -140,7 +140,7 @@ void AssistantAshTestBase::CreateAndSwitchActiveUser(
|
||||
session_controller_client->Reset();
|
||||
|
||||
session_controller_client->AddUserSession(
|
||||
display_email, user_manager::USER_TYPE_REGULAR,
|
||||
display_email, user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/true,
|
||||
/*is_new_profile=*/false, given_name);
|
||||
|
||||
|
@ -4687,7 +4687,7 @@ TEST_F(NoSessionCaptureModeCameraTest, RequestCameraInfoAfterUserLogsIn) {
|
||||
{
|
||||
base::RunLoop loop;
|
||||
camera_controller->SetOnCameraListReceivedForTesting(loop.QuitClosure());
|
||||
SimulateUserLogin("example@gmail.com", user_manager::USER_TYPE_REGULAR);
|
||||
SimulateUserLogin("example@gmail.com", user_manager::UserType::kRegular);
|
||||
loop.Run();
|
||||
}
|
||||
|
||||
|
@ -686,15 +686,15 @@ bool CaptureModeController::CanShowUserNudge() const {
|
||||
// never be empty.
|
||||
DCHECK(user_type);
|
||||
switch (*user_type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
// We only allow regular and child accounts to see the nudge.
|
||||
break;
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kGuest:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -6508,13 +6508,13 @@ TEST_F(CaptureModeSettingsTest, NudgeDoesNotShowForAllUserTypes) {
|
||||
user_manager::UserType user_type;
|
||||
bool can_see_nudge;
|
||||
} kUserTypeTestCases[] = {
|
||||
{"regular user", user_manager::USER_TYPE_REGULAR, true},
|
||||
{"child", user_manager::USER_TYPE_CHILD, true},
|
||||
{"guest", user_manager::USER_TYPE_GUEST, false},
|
||||
{"public account", user_manager::USER_TYPE_PUBLIC_ACCOUNT, false},
|
||||
{"kiosk app", user_manager::USER_TYPE_KIOSK_APP, false},
|
||||
{"arc kiosk app", user_manager::USER_TYPE_ARC_KIOSK_APP, false},
|
||||
{"web kiosk app", user_manager::USER_TYPE_WEB_KIOSK_APP, false},
|
||||
{"regular user", user_manager::UserType::kRegular, true},
|
||||
{"child", user_manager::UserType::kChild, true},
|
||||
{"guest", user_manager::UserType::kGuest, false},
|
||||
{"public account", user_manager::UserType::kPublicAccount, false},
|
||||
{"kiosk app", user_manager::UserType::kKioskApp, false},
|
||||
{"arc kiosk app", user_manager::UserType::kArcKioskApp, false},
|
||||
{"web kiosk app", user_manager::UserType::kWebKioskApp, false},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kUserTypeTestCases) {
|
||||
|
@ -331,13 +331,13 @@ TEST_F(ClipboardHistoryControllerTest, VerifyAvailabilityInUserModes) {
|
||||
constexpr struct {
|
||||
user_manager::UserType user_type;
|
||||
bool is_enabled;
|
||||
} kTestCases[] = {{user_manager::USER_TYPE_REGULAR, true},
|
||||
{user_manager::USER_TYPE_GUEST, true},
|
||||
{user_manager::USER_TYPE_PUBLIC_ACCOUNT, false},
|
||||
{user_manager::USER_TYPE_KIOSK_APP, false},
|
||||
{user_manager::USER_TYPE_CHILD, true},
|
||||
{user_manager::USER_TYPE_ARC_KIOSK_APP, false},
|
||||
{user_manager::USER_TYPE_WEB_KIOSK_APP, false}};
|
||||
} kTestCases[] = {{user_manager::UserType::kRegular, true},
|
||||
{user_manager::UserType::kGuest, true},
|
||||
{user_manager::UserType::kPublicAccount, false},
|
||||
{user_manager::UserType::kKioskApp, false},
|
||||
{user_manager::UserType::kChild, true},
|
||||
{user_manager::UserType::kArcKioskApp, false},
|
||||
{user_manager::UserType::kWebKioskApp, false}};
|
||||
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
|
@ -325,8 +325,8 @@ bool IsArcAllowedForUser(const user_manager::User* user) {
|
||||
// above because ARC kiosk user is always the primary/active user of a
|
||||
// user session. The same for USER_TYPE_PUBLIC_ACCOUNT.
|
||||
if (!user->HasGaiaAccount() && !user->IsActiveDirectoryUser() &&
|
||||
user->GetType() != user_manager::USER_TYPE_ARC_KIOSK_APP &&
|
||||
user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
|
||||
user->GetType() != user_manager::UserType::kArcKioskApp &&
|
||||
user->GetType() != user_manager::UserType::kPublicAccount) {
|
||||
VLOG(1) << "Users without GAIA or AD accounts, or not ARC kiosk apps are "
|
||||
"not supported in ARC.";
|
||||
return false;
|
||||
|
@ -22,7 +22,7 @@ namespace ash {
|
||||
|
||||
UserInfo CreateTestUserInfo(const std::string& user_email) {
|
||||
UserInfo user_info;
|
||||
user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
user_info.type = user_manager::UserType::kRegular;
|
||||
user_info.account_id = AccountId::FromUserEmail(user_email);
|
||||
user_info.display_name = "Test user";
|
||||
user_info.display_email = user_email;
|
||||
|
@ -3639,7 +3639,7 @@ TEST_F(DisplayManagerTest, DisplayPrefsAndKioskMode) {
|
||||
// Login in as kiosk app.
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_KIOSK_APP;
|
||||
session.user_info.type = user_manager::UserType::kKioskApp;
|
||||
session.user_info.account_id = AccountId::FromUserEmail("user1@test.com");
|
||||
session.user_info.display_name = "User 1";
|
||||
session.user_info.display_email = "user1@test.com";
|
||||
|
@ -195,10 +195,10 @@ bool UserCanSaveDisplayPreference() {
|
||||
return false;
|
||||
}
|
||||
|
||||
return *user_type == user_manager::USER_TYPE_REGULAR ||
|
||||
*user_type == user_manager::USER_TYPE_CHILD ||
|
||||
*user_type == user_manager::USER_TYPE_KIOSK_APP ||
|
||||
(*user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT &&
|
||||
return *user_type == user_manager::UserType::kRegular ||
|
||||
*user_type == user_manager::UserType::kChild ||
|
||||
*user_type == user_manager::UserType::kKioskApp ||
|
||||
(*user_type == user_manager::UserType::kPublicAccount &&
|
||||
Shell::Get()->local_state()->GetBoolean(
|
||||
prefs::kAllowMGSToStoreDisplayProperties));
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ class DisplayPrefsTest : public AshTestBase {
|
||||
void LoggedInAsGuest() { SimulateGuestLogin(); }
|
||||
|
||||
void LoggedInAsPublicAccount() {
|
||||
SimulateUserLogin("pa@test.com", user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin("pa@test.com", user_manager::UserType::kPublicAccount);
|
||||
}
|
||||
|
||||
void LoadDisplayPreferences() { display_prefs()->LoadDisplayPreferences(); }
|
||||
|
@ -463,7 +463,7 @@ TEST_P(ResolutionNotificationControllerTest, NoTimeoutInKioskMode) {
|
||||
// Login in as kiosk app.
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_KIOSK_APP;
|
||||
session.user_info.type = user_manager::UserType::kKioskApp;
|
||||
session.user_info.account_id = AccountId::FromUserEmail("user1@test.com");
|
||||
session.user_info.display_name = "User 1";
|
||||
session.user_info.display_email = "user1@test.com";
|
||||
@ -483,7 +483,7 @@ TEST_P(ResolutionNotificationControllerTest, NoDialogInKioskMode) {
|
||||
// Login in as kiosk app.
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_KIOSK_APP;
|
||||
session.user_info.type = user_manager::UserType::kKioskApp;
|
||||
session.user_info.account_id = AccountId::FromUserEmail("user1@test.com");
|
||||
session.user_info.display_name = "User 1";
|
||||
session.user_info.display_email = "user1@test.com";
|
||||
|
@ -143,7 +143,7 @@ class LocalAuthenticationRequestControllerImplPixelTest : public AshTestBase {
|
||||
void StartLocalAuthenticationRequest() {
|
||||
// Configure the user context.
|
||||
std::unique_ptr<UserContext> user_context = std::make_unique<UserContext>(
|
||||
user_manager::USER_TYPE_REGULAR, test_account_id_);
|
||||
user_manager::UserType::kRegular, test_account_id_);
|
||||
|
||||
user_context->SetAuthSessionIds(session_ids_.first, session_ids_.second);
|
||||
|
||||
|
@ -130,7 +130,7 @@ class LocalAuthenticationRequestControllerImplTest : public LoginTestBase {
|
||||
void StartLocalAuthenticationRequest() {
|
||||
// Configure the user context.
|
||||
std::unique_ptr<UserContext> user_context = std::make_unique<UserContext>(
|
||||
user_manager::USER_TYPE_REGULAR, test_account_id_);
|
||||
user_manager::UserType::kRegular, test_account_id_);
|
||||
|
||||
user_context->SetAuthSessionIds(session_ids_.first, session_ids_.second);
|
||||
|
||||
|
@ -150,7 +150,7 @@ keyboard::KeyboardUIController* GetKeyboardControllerForWidget(
|
||||
}
|
||||
|
||||
bool IsPublicAccountUser(const LoginUserInfo& user) {
|
||||
return user.basic_user_info.type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
return user.basic_user_info.type == user_manager::UserType::kPublicAccount;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1787,7 +1787,7 @@ TEST_F(LockContentsViewUnitTest, SwapUserListToPrimaryBigUser) {
|
||||
|
||||
auto is_public_account = [](const LoginUserView* view) -> bool {
|
||||
return view->current_user().basic_user_info.type ==
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
user_manager::UserType::kPublicAccount;
|
||||
};
|
||||
|
||||
// Case 1: Swap user_view0 (public account user) with primary big user (public
|
||||
|
@ -120,7 +120,7 @@ struct UserMetadata {
|
||||
bool enable_tap_to_unlock = false;
|
||||
bool enable_challenge_response = false; // Smart Card
|
||||
bool enable_auth = true;
|
||||
user_manager::UserType type = user_manager::USER_TYPE_REGULAR;
|
||||
user_manager::UserType type = user_manager::UserType::kRegular;
|
||||
SmartLockState smart_lock_state = SmartLockState::kInactive;
|
||||
FingerprintState fingerprint_state = FingerprintState::UNAVAILABLE;
|
||||
DebugAuthEnabledState auth_enable_state = DebugAuthEnabledState::kAuthEnabled;
|
||||
@ -148,7 +148,7 @@ LoginUserInfo PopulateUserData(const LoginUserInfo& user,
|
||||
LoginUserInfo result = user;
|
||||
result.basic_user_info.type = type;
|
||||
|
||||
bool is_public_account = type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
bool is_public_account = type == user_manager::UserType::kPublicAccount;
|
||||
// Set debug user names and email. Useful for the stub user, which does not
|
||||
// have a name and email set.
|
||||
result.basic_user_info.display_name =
|
||||
@ -393,7 +393,7 @@ class LockDebugView::DebugDataDispatcherTransformer
|
||||
const AccountId account_id = debug_user->account_id;
|
||||
|
||||
std::unique_ptr<ash::UserContext> user_context =
|
||||
std::make_unique<ash::UserContext>(user_manager::USER_TYPE_REGULAR,
|
||||
std::make_unique<ash::UserContext>(user_manager::UserType::kRegular,
|
||||
account_id);
|
||||
|
||||
Shell::Get()->local_authentication_request_controller()->ShowWidget(
|
||||
@ -526,9 +526,9 @@ class LockDebugView::DebugDataDispatcherTransformer
|
||||
DCHECK(user_index >= 0 && user_index < debug_users_.size());
|
||||
UserMetadata& user = debug_users_[user_index];
|
||||
// Swap the type between regular and public account.
|
||||
user.type = user.type == user_manager::USER_TYPE_REGULAR
|
||||
? user_manager::USER_TYPE_PUBLIC_ACCOUNT
|
||||
: user_manager::USER_TYPE_REGULAR;
|
||||
user.type = user.type == user_manager::UserType::kRegular
|
||||
? user_manager::UserType::kPublicAccount
|
||||
: user_manager::UserType::kRegular;
|
||||
|
||||
std::vector<LoginUserInfo> users = BuildUserList(debug_users_.size());
|
||||
// Update display name and email in debug users.
|
||||
|
@ -490,7 +490,7 @@ LoginAuthUserView::LoginAuthUserView(const LoginUserInfo& user,
|
||||
DCHECK(callbacks.on_tap);
|
||||
DCHECK(callbacks.on_remove);
|
||||
DCHECK(callbacks.on_auth_factor_is_hiding_password_changed);
|
||||
DCHECK_NE(user.basic_user_info.type, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
DCHECK_NE(user.basic_user_info.type, user_manager::UserType::kPublicAccount);
|
||||
if (Shell::Get()->login_screen_controller()->IsAuthenticating()) {
|
||||
// TODO(b/276246832): We should avoid re-layouting during Authentication.
|
||||
LOG(WARNING)
|
||||
|
@ -24,7 +24,7 @@ namespace ash {
|
||||
namespace {
|
||||
|
||||
bool IsPublicAccountUser(const LoginUserInfo& user) {
|
||||
return user.basic_user_info.type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
return user.basic_user_info.type == user_manager::UserType::kPublicAccount;
|
||||
}
|
||||
|
||||
// Returns true if either a or b have a value, but not both.
|
||||
|
@ -466,7 +466,7 @@ class RightPaneView : public NonAccessibleView {
|
||||
|
||||
void UpdateForUser(const LoginUserInfo& user) {
|
||||
DCHECK_EQ(user.basic_user_info.type,
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
current_user_ = user;
|
||||
if (!language_changed_by_user_) {
|
||||
selected_language_item_value_ = user.public_account_info->default_locale;
|
||||
|
@ -65,7 +65,7 @@ LoginPublicAccountUserView::LoginPublicAccountUserView(
|
||||
: NonAccessibleView(kLoginPublicAccountUserViewClassName),
|
||||
on_tap_(callbacks.on_tap),
|
||||
on_public_account_tap_(callbacks.on_public_account_tapped) {
|
||||
DCHECK_EQ(user.basic_user_info.type, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
DCHECK_EQ(user.basic_user_info.type, user_manager::UserType::kPublicAccount);
|
||||
DCHECK(callbacks.on_tap);
|
||||
DCHECK(callbacks.on_public_account_tapped);
|
||||
|
||||
|
@ -207,7 +207,7 @@ LoginRemoveAccountDialog::LoginRemoveAccountDialog(
|
||||
std::u16string part1 = l10n_util::GetStringUTF16(
|
||||
IDS_ASH_LOGIN_POD_NON_OWNER_USER_REMOVE_WARNING_PART_1);
|
||||
std::u16string part2 = l10n_util::GetStringFUTF16(
|
||||
type == user_manager::UserType::USER_TYPE_CHILD
|
||||
type == user_manager::UserType::kChild
|
||||
? IDS_ASH_LOGIN_POD_NON_OWNER_USER_REMOVE_WARNING_PART_2_SUPERVISED_USER
|
||||
: IDS_ASH_LOGIN_POD_NON_OWNER_USER_REMOVE_WARNING_PART_2,
|
||||
email);
|
||||
|
@ -94,7 +94,7 @@ TEST_F(LoginRemoveAccountDialogTest, LongUserNameAndEmailLaidOutCorrectly) {
|
||||
"NedHasAReallyLongName StarkHasAReallyLongName";
|
||||
login_user_info.basic_user_info.display_email =
|
||||
"reallyreallyextralonggaianame@gmail.com";
|
||||
login_user_info.basic_user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
login_user_info.basic_user_info.type = user_manager::UserType::kRegular;
|
||||
login_user_info.is_device_owner = false;
|
||||
login_user_info.can_remove = true;
|
||||
auto* bubble = new LoginRemoveAccountDialog(
|
||||
|
@ -66,11 +66,11 @@ LoginPasswordView::TestApi MakeLoginPasswordTestApi(LockContentsView* view,
|
||||
}
|
||||
|
||||
LoginUserInfo CreateUser(const std::string& email) {
|
||||
return CreateUserWithType(email, user_manager::UserType::USER_TYPE_REGULAR);
|
||||
return CreateUserWithType(email, user_manager::UserType::kRegular);
|
||||
}
|
||||
|
||||
LoginUserInfo CreateChildUser(const std::string& email) {
|
||||
return CreateUserWithType(email, user_manager::UserType::USER_TYPE_CHILD);
|
||||
return CreateUserWithType(email, user_manager::UserType::kChild);
|
||||
}
|
||||
|
||||
LoginUserInfo CreatePublicAccountUser(const std::string& email) {
|
||||
@ -80,7 +80,7 @@ LoginUserInfo CreatePublicAccountUser(const std::string& email) {
|
||||
user.basic_user_info.account_id = AccountId::FromUserEmail(email);
|
||||
user.basic_user_info.display_name = email_parts[0];
|
||||
user.basic_user_info.display_email = email;
|
||||
user.basic_user_info.type = user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
user.basic_user_info.type = user_manager::UserType::kPublicAccount;
|
||||
user.public_account_info.emplace();
|
||||
user.public_account_info->device_enterprise_manager = email_parts[1];
|
||||
user.public_account_info->show_expanded_view = true;
|
||||
|
@ -210,7 +210,7 @@ class LoginUserView::UserImage : public NonAccessibleView {
|
||||
|
||||
bool is_managed =
|
||||
user.user_account_manager ||
|
||||
user.basic_user_info.type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
user.basic_user_info.type == user_manager::UserType::kPublicAccount;
|
||||
enterprise_icon_container_->SetVisible(is_managed);
|
||||
}
|
||||
|
||||
@ -632,7 +632,7 @@ void LoginUserView::UpdateCurrentUserState() {
|
||||
accessible_name = l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_LOGIN_POD_MANAGED_ACCESSIBLE_NAME, email);
|
||||
} else if (current_user_.basic_user_info.type ==
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
|
||||
user_manager::UserType::kPublicAccount) {
|
||||
accessible_name = l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_LOGIN_POD_MANAGED_ACCESSIBLE_NAME,
|
||||
base::UTF8ToUTF16(current_user_.basic_user_info.display_name));
|
||||
|
@ -69,10 +69,10 @@ class FeatureDiscoveryDurationReporterImplTest : public AshTestBase {
|
||||
GetSessionController()->ClearUserSessionsForTest();
|
||||
TestSessionControllerClient* session_client = GetSessionControllerClient();
|
||||
session_client->AddUserSession(kPrimaryUserEmail,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_client->AddUserSession(kSecondaryUserEmail,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
|
||||
auto user_1_prefs = std::make_unique<TestingPrefServiceSimple>();
|
||||
|
@ -76,14 +76,14 @@ TEST_F(UserMetricsRecorderTest, VerifyIsUserInActiveDesktopEnvironmentValues) {
|
||||
// Kiosk logins are not considered active.
|
||||
client->Reset();
|
||||
client->AddUserSession("app@kiosk-apps.device-local.localhost",
|
||||
user_manager::USER_TYPE_KIOSK_APP);
|
||||
user_manager::UserType::kKioskApp);
|
||||
client->SetSessionState(session_manager::SessionState::ACTIVE);
|
||||
EXPECT_FALSE(test_api().IsUserInActiveDesktopEnvironment());
|
||||
|
||||
// Arc kiosk logins are not considered active.
|
||||
client->Reset();
|
||||
client->AddUserSession("app@arc-kiosk-apps.device-local.localhost",
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
client->SetSessionState(session_manager::SessionState::ACTIVE);
|
||||
EXPECT_FALSE(test_api().IsUserInActiveDesktopEnvironment());
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class MultiDeviceNotificationPresenterTest : public NoSessionAshTestBase {
|
||||
TestSessionControllerClient* test_session_client =
|
||||
GetSessionControllerClient();
|
||||
test_session_client->AddUserSession(
|
||||
kTestUserEmail, user_manager::USER_TYPE_REGULAR,
|
||||
kTestUserEmail, user_manager::UserType::kRegular,
|
||||
true /* provide_pref_service */, false /* is_new_profile */);
|
||||
test_session_client->SetSessionState(session_manager::SessionState::ACTIVE);
|
||||
test_session_client->SwitchActiveUser(
|
||||
|
@ -37,7 +37,7 @@ struct ASH_PUBLIC_EXPORT UserInfo {
|
||||
UserInfo(const UserInfo& other);
|
||||
~UserInfo();
|
||||
|
||||
user_manager::UserType type = user_manager::USER_TYPE_REGULAR;
|
||||
user_manager::UserType type = user_manager::UserType::kRegular;
|
||||
AccountId account_id;
|
||||
std::string display_name;
|
||||
std::string display_email;
|
||||
|
@ -122,7 +122,7 @@ TEST_F(CompanionAppBrokerImplUnitTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, false);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
@ -145,7 +145,7 @@ TEST_F(CompanionAppBrokerImplUnitTest, NoCompanionAppNotification_Guest) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, true);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
@ -168,7 +168,7 @@ TEST_F(CompanionAppBrokerImplUnitTest, ShowLaunchCompanionApp_Installed) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, true);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
@ -191,7 +191,7 @@ TEST_F(CompanionAppBrokerImplUnitTest, ShowLaunchCompanionApp_NoPlayStoreLink) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, false);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
@ -214,7 +214,7 @@ TEST_F(CompanionAppBrokerImplUnitTest, NoCompanionAppNotification_NoAppInfo) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, false);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
@ -237,7 +237,7 @@ TEST_F(CompanionAppBrokerImplUnitTest, ShowInstallCompanionApp_PlayStoreLink) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
SetCompanionAppInstalled(kCompanionAppId, false);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
EXPECT_FALSE(install_companion_app_notification_shown_);
|
||||
EXPECT_FALSE(launch_companion_app_notification_shown_);
|
||||
|
@ -55,27 +55,27 @@ TEST_F(LoggedInUserEnabledProviderTest, LockAndUnlock) {
|
||||
}
|
||||
|
||||
TEST_F(LoggedInUserEnabledProviderTest, Kiosk) {
|
||||
Login(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
Login(user_manager::UserType::kKioskApp);
|
||||
EXPECT_FALSE(provider_->is_enabled());
|
||||
}
|
||||
|
||||
TEST_F(LoggedInUserEnabledProviderTest, UserLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
EXPECT_TRUE(provider_->is_enabled());
|
||||
}
|
||||
|
||||
TEST_F(LoggedInUserEnabledProviderTest, GuestLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
EXPECT_TRUE(provider_->is_enabled());
|
||||
}
|
||||
|
||||
TEST_F(LoggedInUserEnabledProviderTest, PublicAccountLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
Login(user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(provider_->is_enabled());
|
||||
}
|
||||
|
||||
TEST_F(LoggedInUserEnabledProviderTest, ChildLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_CHILD);
|
||||
Login(user_manager::UserType::kChild);
|
||||
EXPECT_TRUE(provider_->is_enabled());
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ class QuickPairMetricsLoggerTest : public NoSessionAshTestBase {
|
||||
|
||||
auto accountId = AccountId::FromUserEmail(kUserEmail);
|
||||
session_controller->AddUserSession(kUserEmail,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(accountId, std::move(user_prefs));
|
||||
|
||||
|
@ -486,7 +486,7 @@ class FastPairPairerImplTest : public AshTestBase {
|
||||
};
|
||||
|
||||
TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -496,7 +496,7 @@ TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Retroactive) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairRetroactive);
|
||||
@ -506,7 +506,7 @@ TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Retroactive) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -518,7 +518,7 @@ TEST_F(FastPairPairerImplTest, NoCallbackIsInvokedOnGattSuccess_Subsequent) {
|
||||
// PairByDevice refers to the fact that we aren't pairing by address, unlike
|
||||
// most other tests in this file.
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectFailure_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceResult, 0);
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceErrorReason, 0);
|
||||
@ -536,7 +536,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectFailure_Initial) {
|
||||
// PairByDevice refers to the fact that we aren't pairing by address, unlike
|
||||
// most other tests in this file.
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectFailure_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceResult, 0);
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceErrorReason, 0);
|
||||
@ -554,7 +554,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectFailure_Subsequent) {
|
||||
// PairByDevice refers to the fact that we aren't pairing by address, unlike
|
||||
// most other tests in this file.
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceResult, 0);
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceErrorReason, 0);
|
||||
@ -569,7 +569,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Initial_CancelsPairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -585,7 +585,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Initial_CancelsPairing) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceResult, 0);
|
||||
histogram_tester().ExpectTotalCount(kPairDeviceErrorReason, 0);
|
||||
@ -603,7 +603,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceFailure_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -626,7 +626,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Initial_Floss) {
|
||||
{floss::features::kFlossEnabled},
|
||||
/*disabled_features=*/{});
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -644,7 +644,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Initial_Floss) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
PairByDeviceSuccess_Initial_AlreadyClassicPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -673,7 +673,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
PairByDeviceSuccess_Initial_AlreadyClassicPaired_FailureToConnect) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -706,7 +706,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
PairByDeviceSuccess_Initial_AlreadyClassicPaired_Disconnected) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -734,7 +734,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Initial_AlreadyFastPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -766,7 +766,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Initial_AlreadyFastPaired) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
PairByDeviceSuccess_Subsequent_AlreadyClassicPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -788,7 +788,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
PairByDeviceSuccess_Subsequent_AlreadyFastPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -813,7 +813,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -829,7 +829,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ConnectFailure_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kConnectDeviceResult, 0);
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
@ -851,7 +851,7 @@ TEST_F(FastPairPairerImplTest, ConnectFailure_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ConnectFailure_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kConnectDeviceResult, 0);
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
@ -872,7 +872,7 @@ TEST_F(FastPairPairerImplTest, ConnectFailure_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ConnectSuccess_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kWritePasskeyCharacteristicResultMetric,
|
||||
0);
|
||||
@ -899,7 +899,7 @@ TEST_F(FastPairPairerImplTest, ConnectSuccess_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ConnectSuccess_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kWritePasskeyCharacteristicResultMetric,
|
||||
0);
|
||||
@ -926,7 +926,7 @@ TEST_F(FastPairPairerImplTest, ConnectSuccess_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyFailure_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kWritePasskeyCharacteristicResultMetric,
|
||||
0);
|
||||
@ -959,7 +959,7 @@ TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyFailure_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyFailure_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(kWritePasskeyCharacteristicResultMetric,
|
||||
0);
|
||||
@ -992,7 +992,7 @@ TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyFailure_Subsequent) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
ParseDecryptedPasskeyIncorrectMessageType_Initial_SeekersPasskey) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1021,7 +1021,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
TEST_F(
|
||||
FastPairPairerImplTest,
|
||||
ParseDecryptedPasskeyIncorrectMessageType_Initial_KeyBasedPairingRequest) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1050,7 +1050,7 @@ TEST_F(
|
||||
TEST_F(
|
||||
FastPairPairerImplTest,
|
||||
ParseDecryptedPasskeyIncorrectMessageType_Initial_KeyBasedPairingResponse) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1077,7 +1077,7 @@ TEST_F(
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyNoPasskey) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1104,7 +1104,7 @@ TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyNoPasskey) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
ParseDecryptedPasskeyIncorrectMessageType_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -1131,7 +1131,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyMismatch_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1158,7 +1158,7 @@ TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyMismatch_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyMismatch_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -1185,7 +1185,7 @@ TEST_F(FastPairPairerImplTest, ParseDecryptedPasskeyMismatch_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairedDeviceLost_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1216,7 +1216,7 @@ TEST_F(FastPairPairerImplTest, PairedDeviceLost_Initial) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairedDeviceLost_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairSubsequent);
|
||||
@ -1247,7 +1247,7 @@ TEST_F(FastPairPairerImplTest, PairedDeviceLost_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairSuccess_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1285,7 +1285,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Initial_Floss) {
|
||||
{floss::features::kFlossEnabled},
|
||||
/*disabled_features=*/{});
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1319,7 +1319,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Initial_Floss) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, BleDeviceLostMidPair) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1343,7 +1343,7 @@ TEST_F(FastPairPairerImplTest, BleDeviceLostMidPair) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairSuccess_Initial_FactoryCreate) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -1366,7 +1366,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Initial_FactoryCreate) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -1406,7 +1406,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -1437,7 +1437,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -1467,7 +1467,7 @@ TEST_F(FastPairPairerImplTest, PairSuccess_Subsequent_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -1510,7 +1510,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -1553,7 +1553,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -1595,7 +1595,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_GuestLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
|
||||
histogram_tester().ExpectTotalCount(
|
||||
kWriteAccountKeyCharacteristicResultMetric, 0);
|
||||
@ -1628,7 +1628,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_GuestLoggedIn) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_KioskAppLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
Login(user_manager::UserType::kKioskApp);
|
||||
|
||||
histogram_tester().ExpectTotalCount(
|
||||
kWriteAccountKeyCharacteristicResultMetric, 0);
|
||||
@ -1710,7 +1710,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Initial_Locked) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -1754,7 +1754,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1798,7 +1798,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1841,7 +1841,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Subsequent_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1869,7 +1869,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1896,7 +1896,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1922,7 +1922,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKey_Retroactive_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKeyFailure_Initial_GattErrorFailed) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1948,7 +1948,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKeyFailure_Initial_GattErrorFailed) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorUnknown) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1974,7 +1974,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorInProgress) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2000,7 +2000,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorInvalidLength) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2026,7 +2026,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorNotPermitted) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2052,7 +2052,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorNotAuthorized) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2078,7 +2078,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
WriteAccountKeyFailure_Initial_GattErrorNotPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2111,7 +2111,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
/*enabled_features=*/{},
|
||||
/*disabled_features=*/{features::kFastPairSavedDevices,
|
||||
features::kFastPairSavedDevicesStrictOptIn});
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
histogram_tester().ExpectTotalCount(
|
||||
kWriteAccountKeyCharacteristicResultMetric, 0);
|
||||
@ -2129,7 +2129,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKeyFailure_Initial_NoCancelPairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2155,7 +2155,7 @@ TEST_F(FastPairPairerImplTest, WriteAccountKeyFailure_Initial_NoCancelPairing) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, FastPairVersionOne_DevicePaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateDevice(DeviceFastPairVersion::kV1);
|
||||
EXPECT_EQ(GetSystemTrayClient()->show_bluetooth_pairing_dialog_count(), 1);
|
||||
@ -2171,7 +2171,7 @@ TEST_F(FastPairPairerImplTest, FastPairVersionOne_DevicePaired) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
FastPairVersionOne_SetsClassicAddressAfterPairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
CreateDevice(DeviceFastPairVersion::kV1);
|
||||
// V1 devices don't have classic addresses set during handshake.
|
||||
device_->set_classic_address(std::nullopt);
|
||||
@ -2186,7 +2186,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, FastPairVersionOne_DeviceUnpaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateDevice(DeviceFastPairVersion::kV1);
|
||||
EXPECT_EQ(GetSystemTrayClient()->show_bluetooth_pairing_dialog_count(), 1);
|
||||
@ -2201,7 +2201,7 @@ TEST_F(FastPairPairerImplTest, FastPairVersionOne_DeviceUnpaired) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2222,7 +2222,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_OptedIn_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2252,7 +2252,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_OptedIn_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_OptedIn_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2277,7 +2277,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_OptedIn_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2303,7 +2303,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2328,7 +2328,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_OptedOut_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -2350,7 +2350,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -2376,7 +2376,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -2418,7 +2418,7 @@ TEST_F(FastPairPairerImplTest, WriteAccount_StatusUnknown_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, UpdateOptInStatus_InitialPairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -2471,7 +2471,7 @@ TEST_F(FastPairPairerImplTest, UpdateOptInStatus_InitialPairing) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, UpdateOptInStatus_RetroactivePairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
// Start opted out
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
@ -2515,7 +2515,7 @@ TEST_F(FastPairPairerImplTest, UpdateOptInStatus_RetroactivePairing) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, UpdateOptInStatus_SubsequentPairing) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -2568,7 +2568,7 @@ TEST_F(FastPairPairerImplTest, UpdateOptInStatus_SubsequentPairing) {
|
||||
// FastPairPairerImpl object in |fake_fast_pair_handshake_| will attempt and
|
||||
// fail to pair with it directly using FastPairPairerImpl::Pair.
|
||||
TEST_F(FastPairPairerImplTest, CreateBondTimeout_AdapterHasDeviceAddress) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2581,7 +2581,7 @@ TEST_F(FastPairPairerImplTest, CreateBondTimeout_AdapterHasDeviceAddress) {
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
CreateBondTimeout_AdapterDoesNotHaveDeviceAddress) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2599,7 +2599,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
// PairByDevice refers to the fact that we aren't pairing by address, unlike
|
||||
// most other tests in this file.
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectTimeout_Initial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2615,7 +2615,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectTimeout_Initial) {
|
||||
// PairByDevice refers to the fact that we aren't pairing by address, unlike
|
||||
// most other tests in this file.
|
||||
TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectTimeout_Subsequent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2629,7 +2629,7 @@ TEST_F(FastPairPairerImplTest, PairByDeviceSuccess_ConnectTimeout_Subsequent) {
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, RetroactiveNotLoggedToInitial) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -2662,7 +2662,7 @@ TEST_F(FastPairPairerImplTest, RetroactiveNotLoggedToInitial) {
|
||||
TEST_F(FastPairPairerImplTest, BleAddressRotatedCallsCallback) {
|
||||
base::test::ScopedFeatureList feature_list{
|
||||
ash::features::kFastPairBleRotation};
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairRetroactive);
|
||||
|
||||
@ -2682,7 +2682,7 @@ TEST_F(FastPairPairerImplTest, BleAddressRotatedCallsCallback) {
|
||||
// fire.
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
CreateBondTimeout_ConfirmPasskey_AdapterHasDeviceAddress) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2694,7 +2694,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
|
||||
TEST_F(FastPairPairerImplTest,
|
||||
CreateBondTimeout_ConfirmPasskey_AdapterDoesNotHaveDeviceAddress) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
|
||||
CreateMockDevice(DeviceFastPairVersion::kHigherThanV1,
|
||||
/*protocol=*/Protocol::kFastPairInitial);
|
||||
@ -2710,7 +2710,7 @@ TEST_F(FastPairPairerImplTest,
|
||||
}
|
||||
|
||||
TEST_F(FastPairPairerImplTest, WriteAccountKeyFailure_Retroactive) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
@ -298,7 +298,7 @@ class RetroactivePairingDetectorTest
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
DevicedPaired_FastPair_BluetoothEventFiresFirst) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -316,7 +316,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
// Regression test for b/261041950
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
FastPairPairingEventCalledDuringBluetoothAdapterPairingEvent) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
CreateRetroactivePairingDetector();
|
||||
@ -354,7 +354,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, DeviceUnpaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -368,7 +368,7 @@ TEST_F(RetroactivePairingDetectorTest, DeviceUnpaired) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, NoMessageStream) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -385,7 +385,7 @@ TEST_F(RetroactivePairingDetectorTest, NoMessageStream) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_NoBle) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -406,7 +406,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_NoBle) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_NoModelId) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -428,7 +428,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_NoModelId) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_SocketError) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -450,7 +450,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_SocketError) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_NoBytes) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -473,7 +473,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_NoBytes) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_Lost) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -496,7 +496,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_Lost) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -530,7 +530,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -565,7 +565,7 @@ TEST_F(RetroactivePairingDetectorTest, MessageStream_Ble_ModelId_FlagDisabled) {
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Ble_ModelId_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -599,7 +599,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Ble_ModelId_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevicesStrictOptIn},
|
||||
@ -633,7 +633,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Ble_ModelId_GuestUserLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -655,7 +655,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Ble_ModelId_KioskUserLoggedIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
Login(user_manager::UserType::kKioskApp);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -677,7 +677,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_Ble_ModelId_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -710,7 +710,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_Ble_ModelId_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With SavedDevices and StrictOptIn flags disabled, the user's opt-in status
|
||||
@ -740,7 +740,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_Ble_ModelId_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With only one flag enabled and the other disabled, the user's opt-in status
|
||||
@ -769,7 +769,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_Ble_ModelId_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With only one flag enabled and the other disabled, the user's opt-in status
|
||||
@ -798,7 +798,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
EnableScenarioIfLoggedInLater_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -811,7 +811,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
CreateRetroactivePairingDetector();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
AddMessageStream(kModelIdBleAddressBytes);
|
||||
PairFastPairDeviceWithClassicBluetooth(
|
||||
/*new_paired_status=*/true, kTestDeviceAddress);
|
||||
@ -825,7 +825,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
EnableScenarioIfLoggedInLater_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -838,7 +838,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
CreateRetroactivePairingDetector();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
AddMessageStream(kModelIdBleAddressBytes);
|
||||
PairFastPairDeviceWithClassicBluetooth(
|
||||
/*new_paired_status=*/true, kTestDeviceAddress);
|
||||
@ -852,7 +852,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
EnableScenarioIfLoggedInLater_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -864,7 +864,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
CreateRetroactivePairingDetector();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
AddMessageStream(kModelIdBleAddressBytes);
|
||||
PairFastPairDeviceWithClassicBluetooth(
|
||||
/*new_paired_status=*/true, kTestDeviceAddress);
|
||||
@ -878,7 +878,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
EnableScenarioIfLoggedInLater_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevicesStrictOptIn},
|
||||
@ -890,7 +890,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
CreateRetroactivePairingDetector();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
AddMessageStream(kModelIdBleAddressBytes);
|
||||
PairFastPairDeviceWithClassicBluetooth(
|
||||
/*new_paired_status=*/true, kTestDeviceAddress);
|
||||
@ -904,13 +904,13 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
DontEnableScenarioIfLoggedInLaterAsGuest) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
EXPECT_FALSE(retroactive_pair_found_);
|
||||
|
||||
CreateRetroactivePairingDetector();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(retroactive_pair_found_);
|
||||
@ -918,7 +918,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_Ble_ModelId_GuestUser) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
CreateRetroactivePairingDetector();
|
||||
|
||||
@ -935,7 +935,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_ModelId_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -966,7 +966,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_ModelId_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With both SavedDevices and StrictOptIn disabled, we expect to be notified
|
||||
@ -996,7 +996,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_ModelId_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With the SavedDevices flag enabled but the StrictOptIn disabled, we
|
||||
@ -1025,7 +1025,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_GetMessageStream_ModelId_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With the StrictOptIn flag enabled but the SavedDevices disabled, we
|
||||
@ -1054,7 +1054,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_Ble_ModelId_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -1089,7 +1089,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_Ble_ModelId_GuestAccount) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
CreateRetroactivePairingDetector();
|
||||
|
||||
@ -1111,7 +1111,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_ModelId_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With the SavedDevices and StrictOptIn flags enabled, we do not expect
|
||||
@ -1144,7 +1144,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_ModelId_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With the SavedDevices and StrictOptIn flags disabled, we do not expect
|
||||
@ -1180,7 +1180,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_ModelId_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With only the StrictOptIn flag disabled, we do not expect
|
||||
@ -1215,7 +1215,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStream_Observer_ModelId_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// With only the SavedDevices flag disabled, we do not expect
|
||||
@ -1250,7 +1250,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDestroyed_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1283,7 +1283,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDestroyed_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1316,7 +1316,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDestroyed_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1348,7 +1348,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDestroyed_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
fast_pair_repository_->SetOptInStatus(
|
||||
nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
@ -1380,7 +1380,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDisconnect_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// This test is verifying that we are notified when the Message Stream
|
||||
@ -1420,7 +1420,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDisconnect_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// This test is verifying that we are notified when the Message Stream
|
||||
@ -1460,7 +1460,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDisconnect_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// This test is verifying that we are notified when the Message Stream
|
||||
@ -1499,7 +1499,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
MessageStreamRemovedOnDisconnect_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// This test is verifying that we are notified when the Message Stream
|
||||
@ -1537,7 +1537,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, DontNotify_OptedOut_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// If the SavedDevices and StrictOptIn flags are enabled and the user is
|
||||
@ -1569,7 +1569,7 @@ TEST_F(RetroactivePairingDetectorTest, DontNotify_OptedOut_FlagEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// If the SavedDevices and StrictOptIn flags are disabled, we expect to be
|
||||
@ -1600,7 +1600,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// If the SavedDevices flag is enabled but the StrictOptin flag is disabled,
|
||||
@ -1631,7 +1631,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// If the SavedDevices flag is disabled but the StrictOptin flag is enabled,
|
||||
@ -1662,7 +1662,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedOut_SavedFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_FlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -1690,7 +1690,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_FlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_StrictFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// When the strict interpretation is disabled, we expect to be notified about
|
||||
@ -1720,7 +1720,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_StrictFlagDisabled) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_SavedFlagDisabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
|
||||
// When only the SavedDevices flag is disabled, we expect to be notified about
|
||||
@ -1751,7 +1751,7 @@ TEST_F(RetroactivePairingDetectorTest, Notify_OptedIn_SavedFlagDisabled) {
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
DontNotify_OptedOut_OptedIn_FlagEnabled) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -1802,7 +1802,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, DontNotifyIfAlreadySavedToAcount) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
fast_pair_repository_->SaveMacAddressToAccount(kTestDeviceAddress);
|
||||
|
||||
@ -1844,7 +1844,7 @@ TEST_F(RetroactivePairingDetectorTest, DontNotifyIfAlreadySavedToAcount) {
|
||||
// on.
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
DontNotify_ExpiryTimeoutReached_GetModelIdAndAddressFromMessageStream) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -1878,7 +1878,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest,
|
||||
DontNotify_ExpiryTimeoutReached_CheckPairingInformation) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -1924,7 +1924,7 @@ TEST_F(RetroactivePairingDetectorTest,
|
||||
TEST_F(
|
||||
RetroactivePairingDetectorTest,
|
||||
DontNotify_ExpiryTimeoutReached_DifferentDeviceTriggerRemoval_DeviceToBeRemovedHashesToFirstPosition) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -1976,7 +1976,7 @@ TEST_F(
|
||||
TEST_F(
|
||||
RetroactivePairingDetectorTest,
|
||||
DontNotify_ExpiryTimeoutReached_DifferentDeviceTriggerRemoval_DeviceToBeRemovedHashesToSecondPosition) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -2028,7 +2028,7 @@ TEST_F(
|
||||
TEST_F(
|
||||
RetroactivePairingDetectorTest,
|
||||
DontNotify_ExpiryTimeoutReached_DifferentDeviceTriggerRemoval_MultipleDevicesPaired) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -2076,7 +2076,7 @@ TEST_F(
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, NotifyAfterDeviceRepairs) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -2111,7 +2111,7 @@ TEST_F(RetroactivePairingDetectorTest, NotifyAfterDeviceRepairs) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, NoCrashWhenFootprintsResponseIsSlow) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -2147,7 +2147,7 @@ TEST_F(RetroactivePairingDetectorTest, NoCrashWhenFootprintsResponseIsSlow) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, FastPairHID_Success) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -2175,7 +2175,7 @@ TEST_F(RetroactivePairingDetectorTest, FastPairHID_Success) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, FastPairHID_GattConnectionOpen_Success) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -2203,7 +2203,7 @@ TEST_F(RetroactivePairingDetectorTest, FastPairHID_GattConnectionOpen_Success) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, FastPairHID_GattConnectionFailure) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -2229,7 +2229,7 @@ TEST_F(RetroactivePairingDetectorTest, FastPairHID_GattConnectionFailure) {
|
||||
}
|
||||
|
||||
TEST_F(RetroactivePairingDetectorTest, FastPairHID_ReadModelIdFailure) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
|
@ -274,7 +274,7 @@ class ScannerBrokerImplTest : public AshTestBase,
|
||||
};
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, RegularUser_DiscoverableFound) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -292,7 +292,7 @@ TEST_F(ScannerBrokerImplTest, RegularUser_DiscoverableFound) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, ChildUser_DiscoverableFound) {
|
||||
Login(user_manager::UserType::USER_TYPE_CHILD);
|
||||
Login(user_manager::UserType::kChild);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -310,7 +310,7 @@ TEST_F(ScannerBrokerImplTest, ChildUser_DiscoverableFound) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, RegularUser_NotDiscoverableFound) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -328,7 +328,7 @@ TEST_F(ScannerBrokerImplTest, RegularUser_NotDiscoverableFound) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, GuestUser_DiscoverableFound) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -345,7 +345,7 @@ TEST_F(ScannerBrokerImplTest, GuestUser_DiscoverableFound) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, GuestUser_NotDiscoverableNotCreated) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -358,7 +358,7 @@ TEST_F(ScannerBrokerImplTest, GuestUser_NotDiscoverableNotCreated) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, GuestUser_RegularUserLogsIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -369,14 +369,14 @@ TEST_F(ScannerBrokerImplTest, GuestUser_RegularUserLogsIn) {
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
EXPECT_TRUE(discoverable_scanner_factory_->create_instance());
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_TRUE(not_discoverable_scanner_factory_->create_instance());
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, RegularUser_GuestUserLogsIn) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -387,14 +387,14 @@ TEST_F(ScannerBrokerImplTest, RegularUser_GuestUserLogsIn) {
|
||||
EXPECT_TRUE(not_discoverable_scanner_factory_->create_instance());
|
||||
EXPECT_TRUE(discoverable_scanner_factory_->create_instance());
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_TRUE(not_discoverable_scanner_factory_->create_instance());
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, PublicUser_NotDiscoverableNotCreated) {
|
||||
Login(user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
Login(user_manager::UserType::kPublicAccount);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -407,7 +407,7 @@ TEST_F(ScannerBrokerImplTest, PublicUser_NotDiscoverableNotCreated) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, Kiosk_NotDiscoverableNotCreated) {
|
||||
Login(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
Login(user_manager::UserType::kKioskApp);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -420,7 +420,7 @@ TEST_F(ScannerBrokerImplTest, Kiosk_NotDiscoverableNotCreated) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, RegularUser_DiscoverableLost) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -438,7 +438,7 @@ TEST_F(ScannerBrokerImplTest, RegularUser_DiscoverableLost) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, RegularUser_NotDiscoverableLost) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -456,7 +456,7 @@ TEST_F(ScannerBrokerImplTest, RegularUser_NotDiscoverableLost) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, GuestUser_DiscoverableLost) {
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
EXPECT_FALSE(not_discoverable_scanner_factory_->create_instance());
|
||||
@ -473,7 +473,7 @@ TEST_F(ScannerBrokerImplTest, GuestUser_DiscoverableLost) {
|
||||
}
|
||||
|
||||
TEST_F(ScannerBrokerImplTest, StopScanning_Regular) {
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
CreateScannerBroker();
|
||||
|
@ -264,7 +264,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -290,7 +290,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -315,7 +315,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -341,7 +341,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -367,7 +367,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -392,7 +392,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -412,7 +412,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Child) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_CHILD);
|
||||
Login(user_manager::UserType::kChild);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -432,7 +432,7 @@ TEST_F(FastPairPresenterImplTest, RemoveNotifications) {
|
||||
/*disabled_features=*/{features::kFastPairSavedDevices,
|
||||
features::kFastPairSavedDevicesStrictOptIn});
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -456,7 +456,7 @@ TEST_F(FastPairPresenterImplTest, ExtendNotification) {
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
/*disabled_features=*/{features::kFastPairSavedDevicesStrictOptIn});
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -485,7 +485,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -512,7 +512,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -538,7 +538,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -570,7 +570,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
initially_paired_device_ = base::MakeRefCounted<Device>(
|
||||
kValidModelId, kTestAddress, Protocol::kFastPairInitial);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices,
|
||||
@ -602,7 +602,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
initially_paired_device_ = base::MakeRefCounted<Device>(
|
||||
kValidModelId, kTestAddress, Protocol::kFastPairInitial);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -634,7 +634,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
initially_paired_device_ = base::MakeRefCounted<Device>(
|
||||
kValidModelId, kTestAddress, Protocol::kFastPairInitial);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{features::kFastPairSavedDevices},
|
||||
@ -664,7 +664,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(nullptr);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_IN);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -690,7 +690,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(nullptr);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -715,7 +715,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
SetIdentityManager(nullptr);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
repository_->SetOptInStatus(nearby::fastpair::OptInStatus::STATUS_OPTED_OUT);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
@ -731,7 +731,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_ConnectClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -756,7 +756,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_ConnectClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_LearnMoreClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -781,7 +781,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_LearnMoreClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_DismissedByUser) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -808,7 +808,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
ShowInitialDiscovery_User_DismissedByTimeout) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
test_message_center_.CloseNotificationsWhenRemoved();
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -832,7 +832,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_User_DismissedByOS) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -861,7 +861,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -880,7 +880,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_KioskApp) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
Login(user_manager::UserType::kKioskApp);
|
||||
base::test::ScopedFeatureList feature_list;
|
||||
feature_list.InitWithFeatures(
|
||||
/*enabled_features=*/{},
|
||||
@ -901,7 +901,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_KioskApp) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_ConnectClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -921,7 +921,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_ConnectClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_LearnMoreClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -941,7 +941,7 @@ TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_LearnMoreClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_DismissedByUser) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -963,7 +963,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
ShowInitialDiscovery_Guest_DismissedByTimeout) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
test_message_center_.CloseNotificationsWhenRemoved();
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -982,7 +982,7 @@ TEST_F(FastPairPresenterImplTest,
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowInitialDiscovery_Guest_DismissedByOS) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
initially_paired_device_,
|
||||
@ -1006,7 +1006,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairing) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairing(initially_paired_device_);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1022,7 +1022,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairing_NoDeviceMetadata) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairing(initially_paired_device_);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1037,7 +1037,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairingFailed) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairingFailed(
|
||||
initially_paired_device_,
|
||||
@ -1057,7 +1057,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairingFailed_NoDeviceMetadata) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairingFailed(
|
||||
initially_paired_device_,
|
||||
@ -1072,7 +1072,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairingFailed_NoDeviceMetadata) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowPairingFailed_SettingsClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairingFailed(
|
||||
initially_paired_device_,
|
||||
@ -1092,7 +1092,7 @@ TEST_F(FastPairPresenterImplTest, ShowPairingFailed_SettingsClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowPairingFailed_DismissedByOS) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_GUEST);
|
||||
Login(user_manager::UserType::kGuest);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowPairingFailed(
|
||||
initially_paired_device_,
|
||||
@ -1121,7 +1121,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionAppDisabled) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
EXPECT_DEATH_IF_SUPPORTED(
|
||||
{
|
||||
@ -1143,7 +1143,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionAppEnabled) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
base::RunLoop show_notification_loop;
|
||||
@ -1165,7 +1165,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionApp_SetupClicked) {
|
||||
ash::features::kFastPairPwaCompanion};
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
base::RunLoop show_notification_loop;
|
||||
@ -1197,7 +1197,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionApp_NoDeviceMetadata) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
base::RunLoop show_notification_loop;
|
||||
@ -1219,7 +1219,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionApp_DismissedByUser) {
|
||||
ash::features::kFastPairPwaCompanion};
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
base::RunLoop show_notification_loop;
|
||||
@ -1246,7 +1246,7 @@ TEST_F(FastPairPresenterImplTest, ShowCompanionApp_DismissedByOS) {
|
||||
ash::features::kFastPairPwaCompanion};
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
base::RunLoop show_notification_loop;
|
||||
@ -1274,7 +1274,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1293,7 +1293,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_SaveClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1319,7 +1319,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_NoDeviceMetadata) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1339,7 +1339,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_NoIdentityManager) {
|
||||
SetIdentityManager(nullptr);
|
||||
repository_->ClearFakeMetadata(kValidModelId);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1354,7 +1354,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_NoIdentityManager) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_LearnMoreClicked) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1374,7 +1374,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_LearnMoreClicked) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_DismissedByUser) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1396,7 +1396,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_DismissedByUser) {
|
||||
TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_DismissedByTimeout) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
test_message_center_.CloseNotificationsWhenRemoved();
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1416,7 +1416,7 @@ TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_DismissedByTimeout) {
|
||||
|
||||
TEST_F(FastPairPresenterImplTest, ShowAssociateAccount_DismissedByOS) {
|
||||
SetIdentityManager(identity_manager_);
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowAssociateAccount(
|
||||
initially_paired_device_,
|
||||
@ -1440,7 +1440,7 @@ TEST_F(FastPairPresenterImplTest, ShowSubsequentDiscovery_Connect) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
subsequently_paired_device_,
|
||||
@ -1464,7 +1464,7 @@ TEST_F(FastPairPresenterImplTest, ShowSubsequentDiscovery_LearnMore) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
subsequently_paired_device_,
|
||||
@ -1488,7 +1488,7 @@ TEST_F(FastPairPresenterImplTest, ShowSubsequentDiscovery_DismissedByUser) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
subsequently_paired_device_,
|
||||
@ -1513,7 +1513,7 @@ TEST_F(FastPairPresenterImplTest, ShowSubsequentDiscovery_DismissedByOS) {
|
||||
|
||||
SetIdentityManager(identity_manager_);
|
||||
|
||||
Login(user_manager::UserType::USER_TYPE_REGULAR);
|
||||
Login(user_manager::UserType::kRegular);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
fast_pair_presenter_->ShowDiscovery(
|
||||
subsequently_paired_device_,
|
||||
|
@ -211,7 +211,7 @@ bool SessionControllerImpl::IsUserChild() const {
|
||||
return false;
|
||||
|
||||
user_manager::UserType active_user_type = GetUserSession(0)->user_info.type;
|
||||
return active_user_type == user_manager::USER_TYPE_CHILD;
|
||||
return active_user_type == user_manager::UserType::kChild;
|
||||
}
|
||||
|
||||
bool SessionControllerImpl::IsUserGuest() const {
|
||||
@ -220,7 +220,7 @@ bool SessionControllerImpl::IsUserGuest() const {
|
||||
}
|
||||
|
||||
user_manager::UserType active_user_type = GetUserSession(0)->user_info.type;
|
||||
return active_user_type == user_manager::USER_TYPE_GUEST;
|
||||
return active_user_type == user_manager::UserType::kGuest;
|
||||
}
|
||||
|
||||
bool SessionControllerImpl::IsUserPublicAccount() const {
|
||||
@ -228,7 +228,7 @@ bool SessionControllerImpl::IsUserPublicAccount() const {
|
||||
return false;
|
||||
|
||||
user_manager::UserType active_user_type = GetUserSession(0)->user_info.type;
|
||||
return active_user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
return active_user_type == user_manager::UserType::kPublicAccount;
|
||||
}
|
||||
|
||||
std::optional<user_manager::UserType> SessionControllerImpl::GetUserType()
|
||||
@ -641,19 +641,19 @@ LoginStatus SessionControllerImpl::CalculateLoginStatusForActiveSession()
|
||||
return LoginStatus::USER;
|
||||
|
||||
switch (user_sessions_[0]->user_info.type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::UserType::kRegular:
|
||||
return LoginStatus::USER;
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::UserType::kGuest:
|
||||
return LoginStatus::GUEST;
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
return LoginStatus::PUBLIC;
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
return LoginStatus::KIOSK_APP;
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kChild:
|
||||
return LoginStatus::CHILD;
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
return LoginStatus::KIOSK_APP;
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return LoginStatus::KIOSK_APP;
|
||||
}
|
||||
NOTREACHED();
|
||||
|
@ -131,7 +131,7 @@ class SessionControllerImplTest : public testing::Test {
|
||||
void UpdateSession(uint32_t session_id, const std::string& email) {
|
||||
UserSession session;
|
||||
session.session_id = session_id;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
session.user_info.account_id = AccountId::FromUserEmail(email);
|
||||
session.user_info.display_name = email;
|
||||
session.user_info.display_email = email;
|
||||
@ -346,13 +346,13 @@ TEST_F(SessionControllerImplTest, GetLoginStateForActiveSession) {
|
||||
user_manager::UserType user_type;
|
||||
LoginStatus expected_status;
|
||||
} kTestCases[] = {
|
||||
{user_manager::USER_TYPE_REGULAR, LoginStatus::USER},
|
||||
{user_manager::USER_TYPE_GUEST, LoginStatus::GUEST},
|
||||
{user_manager::USER_TYPE_PUBLIC_ACCOUNT, LoginStatus::PUBLIC},
|
||||
{user_manager::USER_TYPE_KIOSK_APP, LoginStatus::KIOSK_APP},
|
||||
{user_manager::USER_TYPE_CHILD, LoginStatus::CHILD},
|
||||
{user_manager::USER_TYPE_ARC_KIOSK_APP, LoginStatus::KIOSK_APP},
|
||||
{user_manager::USER_TYPE_WEB_KIOSK_APP, LoginStatus::KIOSK_APP}
|
||||
{user_manager::UserType::kRegular, LoginStatus::USER},
|
||||
{user_manager::UserType::kGuest, LoginStatus::GUEST},
|
||||
{user_manager::UserType::kPublicAccount, LoginStatus::PUBLIC},
|
||||
{user_manager::UserType::kKioskApp, LoginStatus::KIOSK_APP},
|
||||
{user_manager::UserType::kChild, LoginStatus::CHILD},
|
||||
{user_manager::UserType::kArcKioskApp, LoginStatus::KIOSK_APP},
|
||||
{user_manager::UserType::kWebKioskApp, LoginStatus::KIOSK_APP}
|
||||
// TODO(jamescook): Add USER_TYPE_ACTIVE_DIRECTORY if we add a status for
|
||||
// it.
|
||||
};
|
||||
@ -465,7 +465,7 @@ TEST_F(SessionControllerImplWithShellTest,
|
||||
TEST_F(SessionControllerImplTest, IsUserChild) {
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_CHILD;
|
||||
session.user_info.type = user_manager::UserType::kChild;
|
||||
controller()->UpdateUserSession(session);
|
||||
|
||||
EXPECT_TRUE(controller()->IsUserChild());
|
||||
@ -493,9 +493,9 @@ TEST_F(SessionControllerImplPrefsTest, Observer) {
|
||||
TestSessionControllerClient* session = GetSessionControllerClient();
|
||||
// Disable auto-provision of PrefService for each user.
|
||||
constexpr bool kProvidePrefService = false;
|
||||
session->AddUserSession(kUser1, user_manager::USER_TYPE_REGULAR,
|
||||
session->AddUserSession(kUser1, user_manager::UserType::kRegular,
|
||||
kProvidePrefService);
|
||||
session->AddUserSession(kUser2, user_manager::USER_TYPE_REGULAR,
|
||||
session->AddUserSession(kUser2, user_manager::UserType::kRegular,
|
||||
kProvidePrefService);
|
||||
|
||||
// The observer is not notified because the PrefService for kUser1 is not yet
|
||||
@ -595,7 +595,7 @@ TEST_F(SessionControllerImplPrefsTest, SetsTimeOfLastSessionActivation) {
|
||||
|
||||
// Switch to test user.
|
||||
TestSessionControllerClient* session = GetSessionControllerClient();
|
||||
session->AddUserSession(kUser1Email, user_manager::USER_TYPE_REGULAR);
|
||||
session->AddUserSession(kUser1Email, user_manager::UserType::kRegular);
|
||||
session->SwitchActiveUser(kUser1AccountId);
|
||||
|
||||
// Initially time of last session activation is expected to be `base::Time()`.
|
||||
@ -688,7 +688,7 @@ TEST_F(SessionControllerImplPrefsTest, SetsTimeOfLastSessionActivation) {
|
||||
*base::ValueToTime(time_of_last_session_activation->GetValue()),
|
||||
expected_time_of_last_session_activation);
|
||||
}));
|
||||
session->AddUserSession(kUser2Email, user_manager::USER_TYPE_REGULAR);
|
||||
session->AddUserSession(kUser2Email, user_manager::UserType::kRegular);
|
||||
session->SwitchActiveUser(kUser2AccountId);
|
||||
testing::Mock::VerifyAndClearExpectations(&mock_session_observer);
|
||||
|
||||
@ -725,16 +725,16 @@ TEST_F(SessionControllerImplTest, GetUserType) {
|
||||
// Child accounts
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_CHILD;
|
||||
session.user_info.type = user_manager::UserType::kChild;
|
||||
controller()->UpdateUserSession(session);
|
||||
EXPECT_EQ(user_manager::USER_TYPE_CHILD, controller()->GetUserType());
|
||||
EXPECT_EQ(user_manager::UserType::kChild, controller()->GetUserType());
|
||||
|
||||
// Regular accounts
|
||||
session = UserSession();
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
controller()->UpdateUserSession(session);
|
||||
EXPECT_EQ(user_manager::USER_TYPE_REGULAR, controller()->GetUserType());
|
||||
EXPECT_EQ(user_manager::UserType::kRegular, controller()->GetUserType());
|
||||
}
|
||||
|
||||
TEST_F(SessionControllerImplTest, IsUserPrimary) {
|
||||
@ -743,14 +743,14 @@ TEST_F(SessionControllerImplTest, IsUserPrimary) {
|
||||
// The first added user is a primary user
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
controller()->UpdateUserSession(session);
|
||||
EXPECT_TRUE(controller()->IsUserPrimary());
|
||||
|
||||
// The users added thereafter are not primary users
|
||||
session = UserSession();
|
||||
session.session_id = 2u;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
controller()->UpdateUserSession(session);
|
||||
// Simulates user switching by changing the order of session_ids.
|
||||
controller()->SetUserSessionOrder({2u, 1u});
|
||||
@ -760,14 +760,14 @@ TEST_F(SessionControllerImplTest, IsUserPrimary) {
|
||||
TEST_F(SessionControllerImplTest, IsUserFirstLogin) {
|
||||
UserSession session;
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
controller()->UpdateUserSession(session);
|
||||
EXPECT_FALSE(controller()->IsUserFirstLogin());
|
||||
|
||||
// user_info->is_new_profile being true means the user is first time login.
|
||||
session = UserSession();
|
||||
session.session_id = 1u;
|
||||
session.user_info.type = user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = user_manager::UserType::kRegular;
|
||||
session.user_info.is_new_profile = true;
|
||||
controller()->UpdateUserSession(session);
|
||||
EXPECT_TRUE(controller()->IsUserFirstLogin());
|
||||
|
@ -157,8 +157,8 @@ void TestSessionControllerClient::AddUserSession(
|
||||
bool is_account_managed) {
|
||||
// Set is_ephemeral in user_info to true if the user type is guest or public
|
||||
// account.
|
||||
bool is_ephemeral = user_type == user_manager::USER_TYPE_GUEST ||
|
||||
user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
bool is_ephemeral = user_type == user_manager::UserType::kGuest ||
|
||||
user_type == user_manager::UserType::kPublicAccount;
|
||||
|
||||
UserSession session;
|
||||
session.session_id = ++fake_session_id_;
|
||||
|
@ -96,7 +96,7 @@ class TestSessionControllerClient : public SessionControllerClient {
|
||||
// discussion.
|
||||
void AddUserSession(
|
||||
const std::string& display_email,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular,
|
||||
bool provide_pref_service = true,
|
||||
bool is_new_profile = false,
|
||||
const std::string& given_name = std::string(),
|
||||
@ -106,7 +106,7 @@ class TestSessionControllerClient : public SessionControllerClient {
|
||||
void AddUserSession(
|
||||
const AccountId& account_id,
|
||||
const std::string& display_email,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular,
|
||||
bool provide_pref_service = true,
|
||||
bool is_new_profile = false,
|
||||
const std::string& given_name = std::string(),
|
||||
|
@ -99,8 +99,8 @@ class TestShelfItemDelegate : public ShelfItemDelegate {
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(,
|
||||
ShelfContextMenuModelTest,
|
||||
::testing::Values(user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::USER_TYPE_CHILD));
|
||||
::testing::Values(user_manager::UserType::kRegular,
|
||||
user_manager::UserType::kChild));
|
||||
|
||||
// Tests the default items in a shelf context menu.
|
||||
TEST_P(ShelfContextMenuModelTest, Basic) {
|
||||
@ -318,8 +318,8 @@ class DeskButtonContextMenuModelTest : public ShelfContextMenuModelTest {
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(,
|
||||
DeskButtonContextMenuModelTest,
|
||||
::testing::Values(user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::USER_TYPE_CHILD));
|
||||
::testing::Values(user_manager::UserType::kRegular,
|
||||
user_manager::UserType::kChild));
|
||||
|
||||
// Tests that the default items are in the shelf context menu when it is created
|
||||
// outside of the shelf, and that the desk button menu item also appears when
|
||||
|
@ -529,7 +529,7 @@ INSTANTIATE_TEST_SUITE_P(ShelfAutoHideSeparation,
|
||||
|
||||
// Tests that shelf auto hide behavior is always hidden in app mode.
|
||||
TEST_P(ShelfControllerAppModeTest, AutoHideBehavior) {
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
|
||||
Shelf* shelf = GetPrimaryShelf();
|
||||
EXPECT_EQ(ShelfAutoHideBehavior::kAlwaysHidden, shelf->auto_hide_behavior());
|
||||
|
@ -281,11 +281,11 @@ TEST_F(DiagnosticsLogControllerTest,
|
||||
DiagnosticsLogController::Get()->ResetAndInitializeLogWriters();
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
|
||||
SimulateKioskMode(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
DiagnosticsLogController::Get()->ResetAndInitializeLogWriters();
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
|
||||
SimulateKioskMode(user_manager::UserType::USER_TYPE_ARC_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kArcKioskApp);
|
||||
DiagnosticsLogController::Get()->ResetAndInitializeLogWriters();
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
}
|
||||
@ -326,10 +326,10 @@ TEST_F(DiagnosticsLogControllerTest,
|
||||
SimulateGuestLogin();
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
|
||||
SimulateKioskMode(user_manager::UserType::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
|
||||
SimulateKioskMode(user_manager::UserType::USER_TYPE_ARC_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kArcKioskApp);
|
||||
EXPECT_EQ(expected_path_not_regular_user, log_base_path());
|
||||
|
||||
SimulateUserLogin(kTestUserEmail);
|
||||
|
@ -77,8 +77,8 @@ chromeos::federated::mojom::ExamplePtr CreateBrellaAnalyticsExamplePtr() {
|
||||
bool IsValidPrimaryUserType(const user_manager::UserType user_type) {
|
||||
// Primary user session must have user_type = regular or child (v.s. guest,
|
||||
// public account, kiosk app).
|
||||
return user_type == user_manager::USER_TYPE_REGULAR ||
|
||||
user_type == user_manager::USER_TYPE_CHILD;
|
||||
return user_type == user_manager::UserType::kRegular ||
|
||||
user_type == user_manager::UserType::kChild;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -71,7 +71,7 @@ TEST_F(FederatedServiceControllerImplTestBase, NormalUserLogin) {
|
||||
}
|
||||
|
||||
TEST_F(FederatedServiceControllerImplTestBase, ChildUserLogin) {
|
||||
SimulateUserLogin("user@gmail.com", user_manager::USER_TYPE_CHILD);
|
||||
SimulateUserLogin("user@gmail.com", user_manager::UserType::kChild);
|
||||
EXPECT_TRUE(controller_->IsServiceAvailable());
|
||||
}
|
||||
|
||||
@ -80,12 +80,12 @@ TEST_F(FederatedServiceControllerImplTestBase, InvalidLoginStatusAndUserType) {
|
||||
EXPECT_FALSE(controller_->IsServiceAvailable());
|
||||
ClearLogin();
|
||||
|
||||
SimulateKioskMode(user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kArcKioskApp);
|
||||
|
||||
EXPECT_FALSE(controller_->IsServiceAvailable());
|
||||
ClearLogin();
|
||||
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
|
||||
EXPECT_FALSE(controller_->IsServiceAvailable());
|
||||
ClearLogin();
|
||||
|
@ -69,14 +69,14 @@ bool ShouldShowNotification() {
|
||||
}
|
||||
|
||||
switch (*user_type) {
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
case user_manager::UserType::kGuest:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return false;
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ TEST_F(FirmwareUpdateStartupNotificationTest,
|
||||
TEST_F(FirmwareUpdateStartupNotificationTest,
|
||||
StartupNotificationShownGuestUser) {
|
||||
// Notification should not be shown at login if the user is a guest.
|
||||
SimulateUserLogin("user1@email.com", user_manager::USER_TYPE_GUEST);
|
||||
SimulateUserLogin("user1@email.com", user_manager::UserType::kGuest);
|
||||
InitializeNotificationController();
|
||||
SimulateFetchingUpdates();
|
||||
EXPECT_FALSE(message_center()->FindVisibleNotificationById(
|
||||
@ -172,7 +172,7 @@ TEST_F(FirmwareUpdateStartupNotificationTest,
|
||||
|
||||
TEST_F(FirmwareUpdateStartupNotificationTest, StartupNotificationShownKiosk) {
|
||||
// Notification should not be shown at login if the user is in kiosk mode.
|
||||
SimulateUserLogin("user1@email.com", user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateUserLogin("user1@email.com", user_manager::UserType::kKioskApp);
|
||||
InitializeNotificationController();
|
||||
SimulateFetchingUpdates();
|
||||
EXPECT_FALSE(message_center()->FindVisibleNotificationById(
|
||||
@ -182,7 +182,7 @@ TEST_F(FirmwareUpdateStartupNotificationTest, StartupNotificationShownKiosk) {
|
||||
TEST_F(FirmwareUpdateStartupNotificationTest,
|
||||
StartupNotificationShownKioskPWA) {
|
||||
// Notification should not be shown at login if the user is in kiosk mode.
|
||||
SimulateUserLogin("user1@email.com", user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateUserLogin("user1@email.com", user_manager::UserType::kWebKioskApp);
|
||||
InitializeNotificationController();
|
||||
SimulateFetchingUpdates();
|
||||
EXPECT_FALSE(message_center()->FindVisibleNotificationById(
|
||||
|
@ -57,12 +57,12 @@ class FocusModeControllerMultiUserTest : public NoSessionAshTestBase {
|
||||
RegisterUserProfilePrefs(user_2_prefs_->registry(), /*country=*/"",
|
||||
/*for_test=*/true);
|
||||
session_controller->AddUserSession(kUser1Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser1AccountId(),
|
||||
std::move(user_1_prefs));
|
||||
session_controller->AddUserSession(kUser2Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser2AccountId(),
|
||||
std::move(user_2_prefs));
|
||||
|
@ -294,7 +294,8 @@ TEST_F(SnoopingProtectionControllerTestPresent, Oobe) {
|
||||
TestSessionControllerClient* session = GetSessionControllerClient();
|
||||
|
||||
// Simulate end of OOBE when user is logged in.
|
||||
session->AddUserSession("testuser@gmail.com", user_manager::USER_TYPE_REGULAR,
|
||||
session->AddUserSession("testuser@gmail.com",
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/true,
|
||||
/*is_new_profile=*/true);
|
||||
session->SwitchActiveUser(AccountId::FromUserEmail("testuser@gmail.com"));
|
||||
|
@ -473,17 +473,17 @@ class InputDeviceSettingsControllerTest : public NoSessionAshTestBase {
|
||||
RegisterUserProfilePrefs(user_2_prefs->registry(), /*country=*/"",
|
||||
/*for_test=*/true);
|
||||
session_controller->AddUserSession(kUserEmail1,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(account_id_1,
|
||||
std::move(user_1_prefs));
|
||||
session_controller->AddUserSession(kUserEmail2,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(account_id_2,
|
||||
std::move(user_2_prefs));
|
||||
session_controller->AddUserSession(kUserEmail3,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
|
||||
session_controller->SwitchActiveUser(account_id_1);
|
||||
|
@ -256,7 +256,7 @@ TEST_F(SessionStateNotificationBlockerTest, BlockOnPrefService) {
|
||||
TestSessionControllerClient* const session_controller_client =
|
||||
GetSessionControllerClient();
|
||||
session_controller_client->AddUserSession(kUserAccountId.GetUserEmail(),
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
false /* provide_pref_service */);
|
||||
EXPECT_EQ(0, GetStateChangedCountAndReset());
|
||||
EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id));
|
||||
@ -281,7 +281,7 @@ TEST_F(SessionStateNotificationBlockerTest, BlockInKioskMode) {
|
||||
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
|
||||
EXPECT_TRUE(ShouldShowNotification(notifier_id));
|
||||
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id));
|
||||
EXPECT_FALSE(ShouldShowNotification(notifier_id));
|
||||
}
|
||||
|
@ -125,8 +125,8 @@ void PaletteWelcomeBubble::ShowIfNeeded() {
|
||||
|
||||
std::optional<user_manager::UserType> user_type =
|
||||
session_controller->GetUserType();
|
||||
if (user_type && (*user_type == user_manager::USER_TYPE_GUEST ||
|
||||
*user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT)) {
|
||||
if (user_type && (*user_type == user_manager::UserType::kGuest ||
|
||||
*user_type == user_manager::UserType::kPublicAccount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ TEST_F(PaletteWelcomeBubbleTest, BubbleNotShownInactiveSession) {
|
||||
|
||||
TEST_F(PaletteWelcomeBubbleTest, BubbleNotShownKiosk) {
|
||||
ClearLogin();
|
||||
SimulateKioskMode(user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kWebKioskApp);
|
||||
SetCanLockScreen(false);
|
||||
|
||||
welcome_bubble_->ShowIfNeeded();
|
||||
@ -162,7 +162,7 @@ TEST_F(PaletteWelcomeBubbleEmphemeralAccountTest, BubbleNotShownForGuest) {
|
||||
auto welcome_bubble = std::make_unique<PaletteWelcomeBubble>(
|
||||
StatusAreaWidgetTestHelper::GetStatusAreaWidget()->palette_tray());
|
||||
GetSessionControllerClient()->AddUserSession(kGuestEmail,
|
||||
user_manager::USER_TYPE_GUEST);
|
||||
user_manager::UserType::kGuest);
|
||||
GetSessionControllerClient()->SwitchActiveUser(
|
||||
AccountId::FromUserEmail(kGuestEmail));
|
||||
welcome_bubble->ShowIfNeeded();
|
||||
@ -174,7 +174,7 @@ TEST_F(PaletteWelcomeBubbleEmphemeralAccountTest,
|
||||
auto welcome_bubble = std::make_unique<PaletteWelcomeBubble>(
|
||||
StatusAreaWidgetTestHelper::GetStatusAreaWidget()->palette_tray());
|
||||
GetSessionControllerClient()->AddUserSession(
|
||||
kPublicAccountEmail, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
kPublicAccountEmail, user_manager::UserType::kPublicAccount);
|
||||
GetSessionControllerClient()->SwitchActiveUser(
|
||||
AccountId::FromUserEmail(kPublicAccountEmail));
|
||||
welcome_bubble->ShowIfNeeded();
|
||||
|
@ -1083,7 +1083,7 @@ TEST_F(PowerButtonControllerTest, PartiallyShownMenuInTabletMode) {
|
||||
|
||||
TEST_F(PowerButtonControllerTest, PowerMenuItemsInTabletKiosk) {
|
||||
ClearLogin();
|
||||
SimulateKioskMode(user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kWebKioskApp);
|
||||
SetCanLockScreen(false);
|
||||
|
||||
EnableTabletMode(true);
|
||||
@ -1099,7 +1099,7 @@ TEST_F(PowerButtonControllerTest, PowerMenuItemsInTabletKiosk) {
|
||||
|
||||
TEST_F(PowerButtonControllerTest, PowerMenuItemsInLaptopKiosk) {
|
||||
ClearLogin();
|
||||
SimulateKioskMode(user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kWebKioskApp);
|
||||
SetCanLockScreen(false);
|
||||
|
||||
EnableTabletMode(false);
|
||||
|
@ -316,7 +316,7 @@ class ScheduledFeatureTest : public NoSessionAshTestBase,
|
||||
/*for_test=*/true);
|
||||
auto* const session_controller_client = GetSessionControllerClient();
|
||||
session_controller_client->AddUserSession(user_email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller_client->SetUserPrefService(
|
||||
AccountId::FromUserEmail(user_email), std::move(prefs));
|
||||
|
@ -195,7 +195,7 @@ class LastWindowClosedTest : public NoSessionAshTestBase {
|
||||
void StartManagedGuestSession() {
|
||||
TestSessionControllerClient* session = GetSessionControllerClient();
|
||||
session->Reset();
|
||||
session->AddUserSession(kUserEmail, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
session->AddUserSession(kUserEmail, user_manager::UserType::kPublicAccount);
|
||||
session->SetSessionState(session_manager::SessionState::ACTIVE);
|
||||
}
|
||||
|
||||
|
@ -265,8 +265,8 @@ class CalendarModelTest : public AshTestBase {
|
||||
bool is_child = false) {
|
||||
UserSession session;
|
||||
session.session_id = session_id;
|
||||
session.user_info.type = is_child ? user_manager::USER_TYPE_CHILD
|
||||
: user_manager::USER_TYPE_REGULAR;
|
||||
session.user_info.type = is_child ? user_manager::UserType::kChild
|
||||
: user_manager::UserType::kRegular;
|
||||
session.user_info.account_id = AccountId::FromUserEmail(email);
|
||||
session.user_info.display_name = email;
|
||||
session.user_info.display_email = email;
|
||||
|
@ -259,8 +259,8 @@ ASH_EXPORT bool ShouldFetchEvents() {
|
||||
ASH_EXPORT bool IsActiveUser() {
|
||||
std::optional<user_manager::UserType> user_type =
|
||||
Shell::Get()->session_controller()->GetUserType();
|
||||
return (user_type && (*user_type == user_manager::USER_TYPE_REGULAR ||
|
||||
*user_type == user_manager::USER_TYPE_CHILD)) &&
|
||||
return (user_type && (*user_type == user_manager::UserType::kRegular ||
|
||||
*user_type == user_manager::UserType::kChild)) &&
|
||||
!Shell::Get()->session_controller()->IsUserSessionBlocked();
|
||||
}
|
||||
|
||||
|
@ -453,12 +453,12 @@ TEST_F(CalendarUtilsUnitTest, GetYearOfDay) {
|
||||
}
|
||||
|
||||
TEST_F(CalendarUtilsUnitTest, ChildLoggedIn) {
|
||||
SimulateUserLogin("test@test.test", user_manager::UserType::USER_TYPE_CHILD);
|
||||
SimulateUserLogin("test@test.test", user_manager::UserType::kChild);
|
||||
EXPECT_TRUE(calendar_utils::IsActiveUser());
|
||||
}
|
||||
|
||||
TEST_F(CalendarUtilsUnitTest, InactiveUser) {
|
||||
SimulateUserLogin("test@test.test", user_manager::UserType::USER_TYPE_GUEST);
|
||||
SimulateUserLogin("test@test.test", user_manager::UserType::kGuest);
|
||||
EXPECT_FALSE(calendar_utils::IsActiveUser());
|
||||
}
|
||||
|
||||
|
@ -131,14 +131,14 @@ bool ShouldShowEmailMenuItem() {
|
||||
return false;
|
||||
}
|
||||
switch (user_session->user_info.type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
return true;
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kGuest:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ TEST_F(PowerButtonTest, ButtonStatesGuestMode) {
|
||||
}
|
||||
|
||||
TEST_F(PowerButtonTest, EmailIsShownForRegularAccount) {
|
||||
SimulateUserLogin("user@gmail.com", user_manager::USER_TYPE_REGULAR);
|
||||
SimulateUserLogin("user@gmail.com", user_manager::UserType::kRegular);
|
||||
SimulatePowerButtonPress();
|
||||
EXPECT_TRUE(GetEmailButton()->GetVisible());
|
||||
EXPECT_TRUE(GetEmailButton()->GetEnabled());
|
||||
@ -379,7 +379,7 @@ TEST_F(PowerButtonTest, EmailIsShownForRegularAccount) {
|
||||
}
|
||||
|
||||
TEST_F(PowerButtonTest, EmailIsShownForChildAccount) {
|
||||
SimulateUserLogin("child@gmail.com", user_manager::USER_TYPE_CHILD);
|
||||
SimulateUserLogin("child@gmail.com", user_manager::UserType::kChild);
|
||||
SimulatePowerButtonPress();
|
||||
EXPECT_TRUE(GetEmailButton()->GetVisible());
|
||||
// The multi-profile user chooser is disabled for child accounts.
|
||||
@ -388,7 +388,7 @@ TEST_F(PowerButtonTest, EmailIsShownForChildAccount) {
|
||||
}
|
||||
|
||||
TEST_F(PowerButtonTest, EmailIsNotShownForPublicAccount) {
|
||||
SimulateUserLogin("test@test.com", user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin("test@test.com", user_manager::UserType::kPublicAccount);
|
||||
SimulatePowerButtonPress();
|
||||
EXPECT_EQ(nullptr, GetEmailButton());
|
||||
}
|
||||
@ -397,7 +397,7 @@ TEST_F(PowerButtonTest, EmailIsNotShownForPublicAccount) {
|
||||
// accessed in kiosk mode.
|
||||
|
||||
TEST_F(PowerButtonTest, ClickingEmailShowsUserChooserView) {
|
||||
SimulateUserLogin("user@gmail.com", user_manager::USER_TYPE_REGULAR);
|
||||
SimulateUserLogin("user@gmail.com", user_manager::UserType::kRegular);
|
||||
SimulatePowerButtonPress();
|
||||
LeftClickOn(GetEmailButton());
|
||||
|
||||
|
@ -74,7 +74,7 @@ TEST_F(QuickSettingsFooterPixelTest, FooterShouldBeRenderedCorrectly) {
|
||||
|
||||
// Regression test for b/293484037: The settings button is missing when
|
||||
// there's no enough space for the battery label.
|
||||
SimulateUserLogin("test@gmail.com", user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin("test@gmail.com", user_manager::UserType::kPublicAccount);
|
||||
InitPowerStatusAndOpenBubble();
|
||||
EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen(
|
||||
"with_exit_button",
|
||||
|
@ -212,7 +212,7 @@ TEST_F(QuickSettingsFooterTest, ButtonStatesGuestMode) {
|
||||
}
|
||||
|
||||
TEST_F(QuickSettingsFooterTest, ButtonStatesPublicAccount) {
|
||||
SimulateUserLogin("foo@example.com", user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin("foo@example.com", user_manager::UserType::kPublicAccount);
|
||||
SetUpView();
|
||||
|
||||
ASSERT_TRUE(GetSettingsButton());
|
||||
@ -264,8 +264,8 @@ TEST_F(QuickSettingsFooterTest, SignOutButtonRecordsUmaAndSignsOut) {
|
||||
|
||||
// Settings button is disabled when kSettingsIconDisabled is set.
|
||||
TEST_F(QuickSettingsFooterTest, DisableSettingsIconPolicy) {
|
||||
GetSessionControllerClient()->AddUserSession("foo@example.com",
|
||||
user_manager::USER_TYPE_REGULAR);
|
||||
GetSessionControllerClient()->AddUserSession(
|
||||
"foo@example.com", user_manager::UserType::kRegular);
|
||||
GetSessionControllerClient()->SetSessionState(
|
||||
session_manager::SessionState::ACTIVE);
|
||||
SetUpView();
|
||||
|
@ -273,7 +273,7 @@ TEST_F(QuickSettingsHeaderTest, ChildVisible) {
|
||||
SessionControllerImpl* session = Shell::Get()->session_controller();
|
||||
TestSessionControllerClient* client = GetSessionControllerClient();
|
||||
client->Reset();
|
||||
client->AddUserSession("child@test.com", user_manager::USER_TYPE_CHILD);
|
||||
client->AddUserSession("child@test.com", user_manager::UserType::kChild);
|
||||
client->SetSessionState(session_manager::SessionState::ACTIVE);
|
||||
UserSession user_session = *session->GetUserSession(0);
|
||||
user_session.custodian_email = "parent@test.com";
|
||||
|
@ -821,7 +821,7 @@ TEST_P(UnifiedSystemTrayTest, BubbleViewSizeChangeWithBigMainPage) {
|
||||
|
||||
// Tests that there's no bubble in the kiosk mode.
|
||||
TEST_P(UnifiedSystemTrayTest, NoBubbleAndNoDetailedViewInKioskMode) {
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
|
||||
auto* tray = GetPrimaryUnifiedSystemTray();
|
||||
tray->ShowBubble();
|
||||
|
@ -37,7 +37,7 @@ bool UserChooserDetailedViewController::IsUserChooserEnabled() {
|
||||
|
||||
// Only allow for regular user session.
|
||||
if (session->GetPrimaryUserSession()->user_info.type !=
|
||||
user_manager::USER_TYPE_REGULAR) {
|
||||
user_manager::UserType::kRegular) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ TEST_F(UserChooserDetailedViewControllerTest,
|
||||
GetSessionControllerClient()->Reset();
|
||||
|
||||
// Log in as a child user.
|
||||
SimulateUserLogin("child@gmail.com", user_manager::USER_TYPE_CHILD);
|
||||
SimulateUserLogin("child@gmail.com", user_manager::UserType::kChild);
|
||||
|
||||
EXPECT_FALSE(UserChooserDetailedViewController::IsUserChooserEnabled());
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ views::View* CreateUserAvatarView(int user_index) {
|
||||
Shell::Get()->session_controller()->GetUserSession(user_index);
|
||||
DCHECK(user_session);
|
||||
|
||||
if (user_session->user_info.type == user_manager::USER_TYPE_GUEST) {
|
||||
if (user_session->user_info.type == user_manager::UserType::kGuest) {
|
||||
// In guest mode, the user avatar is just a disabled button pod.
|
||||
auto* image_view = new IconButton(
|
||||
views::Button::PressedCallback(), IconButton::Type::kMedium,
|
||||
@ -170,10 +170,11 @@ std::u16string GetUserItemAccessibleString(int user_index) {
|
||||
Shell::Get()->session_controller()->GetUserSession(user_index);
|
||||
DCHECK(user_session);
|
||||
|
||||
if (user_session->user_info.type == user_manager::USER_TYPE_GUEST)
|
||||
if (user_session->user_info.type == user_manager::UserType::kGuest) {
|
||||
return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_GUEST_LABEL);
|
||||
}
|
||||
|
||||
if (user_session->user_info.type == user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
|
||||
if (user_session->user_info.type == user_manager::UserType::kPublicAccount) {
|
||||
std::string domain_manager = Shell::Get()
|
||||
->system_tray_model()
|
||||
->enterprise_domain()
|
||||
|
@ -428,19 +428,19 @@ void AshTestBase::SimulateUserLogin(const AccountId& account_id,
|
||||
|
||||
void AshTestBase::SimulateNewUserFirstLogin(const std::string& user_email) {
|
||||
ash_test_helper_->SimulateUserLogin(AccountId::FromUserEmail(user_email),
|
||||
user_manager::UserType::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*is_new_profile=*/true);
|
||||
}
|
||||
|
||||
void AshTestBase::SimulateGuestLogin() {
|
||||
SimulateUserLogin(AccountId::FromUserEmail(user_manager::kGuestUserName),
|
||||
user_manager::USER_TYPE_GUEST);
|
||||
user_manager::UserType::kGuest);
|
||||
}
|
||||
|
||||
void AshTestBase::SimulateKioskMode(user_manager::UserType user_type) {
|
||||
DCHECK(user_type == user_manager::USER_TYPE_ARC_KIOSK_APP ||
|
||||
user_type == user_manager::USER_TYPE_KIOSK_APP ||
|
||||
user_type == user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
DCHECK(user_type == user_manager::UserType::kArcKioskApp ||
|
||||
user_type == user_manager::UserType::kKioskApp ||
|
||||
user_type == user_manager::UserType::kWebKioskApp);
|
||||
|
||||
GetSessionControllerClient()->SetIsRunningInAppMode(true);
|
||||
SimulateUserLogin(AccountId::FromUserEmail(kKioskUserEmail), user_type);
|
||||
|
@ -326,13 +326,13 @@ class AshTestBase : public testing::Test {
|
||||
// See the documentation for|AccountId::GetUserEmail| for discussion.
|
||||
void SimulateUserLogin(
|
||||
const std::string& user_email,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular);
|
||||
|
||||
// Simulates a user sign-in. It creates a new user session, adds it to
|
||||
// existing user sessions and makes it the active user session.
|
||||
void SimulateUserLogin(
|
||||
const AccountId& account_id,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular);
|
||||
|
||||
// Simular to SimulateUserLogin but for a newly created user first ever login.
|
||||
void SimulateNewUserFirstLogin(const std::string& user_email);
|
||||
|
@ -130,7 +130,7 @@ class AshTestHelper : public aura::test::AuraTestHelper {
|
||||
// `is_new_profile` indicates whether the logged-in account is new.
|
||||
void SimulateUserLogin(
|
||||
const AccountId& account_id,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular,
|
||||
bool is_new_profile = false);
|
||||
|
||||
// Stabilizes the variable UI components (such as the battery view).
|
||||
|
@ -192,7 +192,7 @@ TEST_F(TouchDevicesControllerPrefsTest, RecordUma) {
|
||||
// Disable auto-provision of PrefService.
|
||||
constexpr bool kProvidePrefService = false;
|
||||
// Add and switch to |kUser1Email|, but user pref service is not ready.
|
||||
session->AddUserSession(kUser1Email, user_manager::USER_TYPE_REGULAR,
|
||||
session->AddUserSession(kUser1Email, user_manager::UserType::kRegular,
|
||||
kProvidePrefService);
|
||||
const AccountId kUserAccount1 = AccountId::FromUserEmail(kUser1Email);
|
||||
session->SwitchActiveUser(kUserAccount1);
|
||||
|
@ -545,7 +545,7 @@ class DragDropDelegate : public WallpaperDragDropDelegate,
|
||||
|
||||
// The nudge is supported for regular users only.
|
||||
if (const auto user_type = session_controller->GetUserType();
|
||||
user_type != user_manager::UserType::USER_TYPE_REGULAR) {
|
||||
user_type != user_manager::UserType::kRegular) {
|
||||
eligibility = false;
|
||||
}
|
||||
|
||||
|
@ -921,13 +921,13 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
std::nullopt),
|
||||
/*is_new_user_locally=*/::testing::Bool(),
|
||||
/*is_managed_user=*/::testing::Bool(),
|
||||
::testing::Values(user_manager::UserType::USER_TYPE_ARC_KIOSK_APP,
|
||||
user_manager::UserType::USER_TYPE_CHILD,
|
||||
user_manager::UserType::USER_TYPE_GUEST,
|
||||
user_manager::UserType::USER_TYPE_KIOSK_APP,
|
||||
user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT,
|
||||
user_manager::UserType::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::USER_TYPE_WEB_KIOSK_APP)));
|
||||
::testing::Values(user_manager::UserType::kArcKioskApp,
|
||||
user_manager::UserType::kChild,
|
||||
user_manager::UserType::kGuest,
|
||||
user_manager::UserType::kKioskApp,
|
||||
user_manager::UserType::kPublicAccount,
|
||||
user_manager::UserType::kRegular,
|
||||
user_manager::UserType::kWebKioskApp)));
|
||||
|
||||
// Tests -----------------------------------------------------------------------
|
||||
|
||||
@ -936,7 +936,7 @@ TEST_P(HoldingSpaceWallpaperNudgeControllerEligibilityTest,
|
||||
const bool expect_first_session_marked =
|
||||
!IsManagedUser() && IsNewUserFirstLoginLocally() &&
|
||||
IsNewUserFirstLoginCrossDevice().value_or(false) &&
|
||||
GetUserType() == user_manager::USER_TYPE_REGULAR;
|
||||
GetUserType() == user_manager::UserType::kRegular;
|
||||
|
||||
const auto before = base::Time::Now();
|
||||
|
||||
@ -972,7 +972,7 @@ TEST_P(HoldingSpaceWallpaperNudgeControllerEligibilityTest, UserEligibility) {
|
||||
ForceUserEligibility() ||
|
||||
(!IsManagedUser() && IsNewUserFirstLoginLocally() &&
|
||||
IsNewUserFirstLoginCrossDevice().value_or(false) &&
|
||||
GetUserType() == user_manager::USER_TYPE_REGULAR);
|
||||
GetUserType() == user_manager::UserType::kRegular);
|
||||
|
||||
// Log in a user type based on parameterization.
|
||||
auto* session = GetSessionControllerClient();
|
||||
|
@ -247,14 +247,14 @@ TEST_F(UserEducationUtilAshTest, GetUserType) {
|
||||
|
||||
auto* session_controller = GetSessionControllerClient();
|
||||
session_controller->AddUserSession(guest_account_id.GetUserEmail(),
|
||||
user_manager::USER_TYPE_GUEST);
|
||||
user_manager::UserType::kGuest);
|
||||
session_controller->AddUserSession(regular_account_id.GetUserEmail(),
|
||||
user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType::kRegular);
|
||||
|
||||
// Case: multiple user sessions added.
|
||||
EXPECT_FALSE(GetUserType(AccountId()));
|
||||
EXPECT_EQ(GetUserType(guest_account_id), user_manager::USER_TYPE_GUEST);
|
||||
EXPECT_EQ(GetUserType(regular_account_id), user_manager::USER_TYPE_REGULAR);
|
||||
EXPECT_EQ(GetUserType(guest_account_id), user_manager::UserType::kGuest);
|
||||
EXPECT_EQ(GetUserType(regular_account_id), user_manager::UserType::kRegular);
|
||||
}
|
||||
|
||||
// Verifies that `IsPrimaryAccountActive()` is working as intended.
|
||||
|
@ -349,7 +349,7 @@ void WelcomeTourController::MaybeStartWelcomeTour() {
|
||||
// Welcome Tour is supported for regular users only.
|
||||
const auto* const session_controller = Shell::Get()->session_controller();
|
||||
if (const auto user_type = session_controller->GetUserType();
|
||||
user_type != user_manager::UserType::USER_TYPE_REGULAR) {
|
||||
user_type != user_manager::UserType::kRegular) {
|
||||
welcome_tour_metrics::RecordTourPrevented(
|
||||
welcome_tour_metrics::PreventedReason::kUserTypeNotRegular);
|
||||
return;
|
||||
|
@ -391,10 +391,10 @@ TEST_F(WelcomeTourControllerTest, StartsTourAndPropagatesEvents) {
|
||||
// *not* trigger the Welcome Tour to start.
|
||||
auto* const session_controller_client = GetSessionControllerClient();
|
||||
session_controller_client->AddUserSession(
|
||||
primary_account_id.GetUserEmail(), user_manager::USER_TYPE_REGULAR,
|
||||
primary_account_id.GetUserEmail(), user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/true, /*is_new_profile=*/true);
|
||||
session_controller_client->AddUserSession(
|
||||
secondary_account_id.GetUserEmail(), user_manager::USER_TYPE_REGULAR,
|
||||
secondary_account_id.GetUserEmail(), user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/true, /*is_new_profile=*/true);
|
||||
|
||||
// Activate the primary user session. This *should* trigger the Welcome Tour
|
||||
@ -552,7 +552,7 @@ TEST_F(WelcomeTourControllerTest, PreventTourFromStartingIfChromeVoxEnabled) {
|
||||
|
||||
TestSessionControllerClient* const session = GetSessionControllerClient();
|
||||
session->AddUserSession(
|
||||
primary_account_id.GetUserEmail(), user_manager::USER_TYPE_REGULAR,
|
||||
primary_account_id.GetUserEmail(), user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/true, /*is_new_profile=*/true);
|
||||
session->SwitchActiveUser(primary_account_id);
|
||||
|
||||
@ -727,13 +727,13 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
std::nullopt),
|
||||
/*is_new_user_locally=*/::testing::Bool(),
|
||||
/*is_managed_user=*/::testing::Bool(),
|
||||
::testing::Values(user_manager::UserType::USER_TYPE_ARC_KIOSK_APP,
|
||||
user_manager::UserType::USER_TYPE_CHILD,
|
||||
user_manager::UserType::USER_TYPE_GUEST,
|
||||
user_manager::UserType::USER_TYPE_KIOSK_APP,
|
||||
user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT,
|
||||
user_manager::UserType::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::USER_TYPE_WEB_KIOSK_APP)));
|
||||
::testing::Values(user_manager::UserType::kArcKioskApp,
|
||||
user_manager::UserType::kChild,
|
||||
user_manager::UserType::kGuest,
|
||||
user_manager::UserType::kKioskApp,
|
||||
user_manager::UserType::kPublicAccount,
|
||||
user_manager::UserType::kRegular,
|
||||
user_manager::UserType::kWebKioskApp)));
|
||||
|
||||
// Tests -----------------------------------------------------------------------
|
||||
|
||||
@ -749,7 +749,7 @@ TEST_P(WelcomeTourControllerUserEligibilityTest, EnforcesUserEligibility) {
|
||||
const bool is_user_eligibility_expected =
|
||||
ForceUserEligibility() ||
|
||||
(IsNewUserCrossDevice().value_or(false) && IsNewUserLocally() &&
|
||||
!IsManagedUser() && GetUserType() == user_manager::USER_TYPE_REGULAR);
|
||||
!IsManagedUser() && GetUserType() == user_manager::UserType::kRegular);
|
||||
|
||||
// Set expectations for whether the Welcome Tour will run.
|
||||
EXPECT_CALL(*user_education_delegate(),
|
||||
@ -783,7 +783,7 @@ TEST_P(WelcomeTourControllerUserEligibilityTest, EnforcesUserEligibility) {
|
||||
// should be last.
|
||||
std::vector<base::Bucket> buckets;
|
||||
if (!ForceUserEligibility()) {
|
||||
if (GetUserType() != user_manager::USER_TYPE_REGULAR) {
|
||||
if (GetUserType() != user_manager::UserType::kRegular) {
|
||||
buckets.emplace_back(PreventedReason::kUserTypeNotRegular, 1);
|
||||
} else if (IsManagedUser()) {
|
||||
buckets.emplace_back(PreventedReason::kManagedAccount, 1);
|
||||
|
@ -205,7 +205,7 @@ bool IsInKioskMode() {
|
||||
Shell::Get()->session_controller()->GetUserType();
|
||||
// |active_user_type| is empty when there's no active user.
|
||||
return active_user_type &&
|
||||
*active_user_type == user_manager::USER_TYPE_KIOSK_APP;
|
||||
*active_user_type == user_manager::UserType::kKioskApp;
|
||||
}
|
||||
|
||||
// Returns the currently active user session (at index 0).
|
||||
@ -236,7 +236,7 @@ user_manager::UserType GetUserType(const AccountId& id) {
|
||||
// a CHECK.
|
||||
LOG(ERROR) << "Cannot resolve user. Assuming regular. This should only "
|
||||
"happen in tests";
|
||||
return user_manager::USER_TYPE_REGULAR;
|
||||
return user_manager::UserType::kRegular;
|
||||
}
|
||||
|
||||
return user_session->user_info.type;
|
||||
@ -958,12 +958,12 @@ base::FilePath WallpaperControllerImpl::GetDefaultWallpaperPath(
|
||||
// The wallpaper is determined in the following order:
|
||||
// Guest wallpaper, child wallpaper, customized default wallpaper, and regular
|
||||
// default wallpaper.
|
||||
if (user_type == user_manager::USER_TYPE_GUEST) {
|
||||
if (user_type == user_manager::UserType::kGuest) {
|
||||
const std::string_view switch_string = use_small
|
||||
? switches::kGuestWallpaperSmall
|
||||
: switches::kGuestWallpaperLarge;
|
||||
return command_line->GetSwitchValuePath(switch_string);
|
||||
} else if (user_type == user_manager::USER_TYPE_CHILD) {
|
||||
} else if (user_type == user_manager::UserType::kChild) {
|
||||
const std::string_view switch_string = use_small
|
||||
? switches::kChildWallpaperSmall
|
||||
: switches::kChildWallpaperLarge;
|
||||
@ -998,7 +998,7 @@ void WallpaperControllerImpl::SetCustomizedDefaultWallpaperPaths(
|
||||
auto* active_user_session = GetActiveUserSession();
|
||||
// Login does not have an active session and the expected behavior is that of
|
||||
// a regular user.
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR;
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular;
|
||||
if (active_user_session) {
|
||||
// We expect that this finishes before the user has logged in.
|
||||
LOG(WARNING) << "Set customized default wallpaper after login";
|
||||
@ -1016,8 +1016,8 @@ void WallpaperControllerImpl::SetPolicyWallpaper(
|
||||
if (IsInKioskMode())
|
||||
return;
|
||||
|
||||
DCHECK(user_type == user_manager::USER_TYPE_REGULAR ||
|
||||
user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
DCHECK(user_type == user_manager::UserType::kRegular ||
|
||||
user_type == user_manager::UserType::kPublicAccount);
|
||||
|
||||
// Updates the screen only when the user with this account_id has logged in.
|
||||
const bool show_wallpaper = IsActiveUser(account_id);
|
||||
@ -1050,7 +1050,7 @@ void WallpaperControllerImpl::OnPolicyWallpaperDecoded(
|
||||
wallpaper_metrics_manager_->LogWallpaperResult(WallpaperType::kPolicy,
|
||||
SetWallpaperResult::kSuccess);
|
||||
SaveAndSetWallpaper(
|
||||
account_id, user_type == user_manager::USER_TYPE_PUBLIC_ACCOUNT,
|
||||
account_id, user_type == user_manager::UserType::kPublicAccount,
|
||||
kPolicyWallpaperFile, /*file_path=*/"", WallpaperType::kPolicy,
|
||||
WALLPAPER_LAYOUT_CENTER_CROPPED, show_wallpaper, image);
|
||||
}
|
||||
@ -1241,8 +1241,8 @@ void WallpaperControllerImpl::ShowUserWallpaper(
|
||||
const AccountId& account_id,
|
||||
const user_manager::UserType user_type) {
|
||||
current_user_ = account_id;
|
||||
if (user_type == user_manager::USER_TYPE_KIOSK_APP ||
|
||||
user_type == user_manager::USER_TYPE_ARC_KIOSK_APP) {
|
||||
if (user_type == user_manager::UserType::kKioskApp ||
|
||||
user_type == user_manager::UserType::kArcKioskApp) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1336,7 +1336,7 @@ void WallpaperControllerImpl::ShowSigninWallpaper() {
|
||||
}
|
||||
|
||||
// If we don't have a user, use the regular default.
|
||||
SetDefaultWallpaperImpl(user_manager::USER_TYPE_REGULAR,
|
||||
SetDefaultWallpaperImpl(user_manager::UserType::kRegular,
|
||||
/*show_wallpaper=*/true, base::DoNothing());
|
||||
}
|
||||
|
||||
@ -1516,8 +1516,8 @@ bool WallpaperControllerImpl::ShouldShowWallpaperSetting() {
|
||||
// personalization settings) to avoid unnecessary confusion and surprise when
|
||||
// everything resets.
|
||||
user_manager::UserType active_user_type = active_user_session->user_info.type;
|
||||
return active_user_type == user_manager::USER_TYPE_REGULAR ||
|
||||
active_user_type == user_manager::USER_TYPE_CHILD;
|
||||
return active_user_type == user_manager::UserType::kRegular ||
|
||||
active_user_type == user_manager::UserType::kChild;
|
||||
}
|
||||
|
||||
void WallpaperControllerImpl::OnDisplayConfigurationChanged() {
|
||||
@ -1789,7 +1789,7 @@ void WallpaperControllerImpl::OnActiveUserPrefServiceChanged(
|
||||
}
|
||||
|
||||
void WallpaperControllerImpl::ShowDefaultWallpaperForTesting() {
|
||||
SetDefaultWallpaperImpl(user_manager::USER_TYPE_REGULAR,
|
||||
SetDefaultWallpaperImpl(user_manager::UserType::kRegular,
|
||||
/*show_wallpaper=*/true, base::DoNothing());
|
||||
}
|
||||
|
||||
@ -2693,7 +2693,7 @@ void WallpaperControllerImpl::OnDevicePolicyWallpaperDecoded(
|
||||
// wallpaper.
|
||||
// TODO(crbug.com/1329567): Decide if the regular default is correct. But
|
||||
// this is the current behavior for EmptyAccountId.
|
||||
SetDefaultWallpaperImpl(user_manager::USER_TYPE_REGULAR,
|
||||
SetDefaultWallpaperImpl(user_manager::UserType::kRegular,
|
||||
/*show_wallpaper=*/true, base::DoNothing());
|
||||
} else {
|
||||
wallpaper_metrics_manager_->LogWallpaperResult(
|
||||
|
@ -1508,16 +1508,14 @@ TEST_P(WallpaperControllerTest, EnableShelfColoringNotifiesObservers) {
|
||||
TEST_P(WallpaperControllerTest,
|
||||
OnWallpaperColorsChangedAlwaysCalledOnFirstUpdate) {
|
||||
TestWallpaperControllerObserver observer(controller_);
|
||||
controller_->ShowUserWallpaper(kAccountId1,
|
||||
user_manager::UserType::USER_TYPE_REGULAR);
|
||||
controller_->ShowUserWallpaper(kAccountId1, user_manager::UserType::kRegular);
|
||||
task_environment()->RunUntilIdle();
|
||||
|
||||
// Even though the wallpaper color is invalid, observers should still be
|
||||
// notified for the first update.
|
||||
EXPECT_EQ(observer.colors_changed_count(), 1);
|
||||
|
||||
controller_->ShowUserWallpaper(kAccountId2,
|
||||
user_manager::UserType::USER_TYPE_REGULAR);
|
||||
controller_->ShowUserWallpaper(kAccountId2, user_manager::UserType::kRegular);
|
||||
task_environment()->RunUntilIdle();
|
||||
|
||||
// Observers should not be notified after the first update if the colors do
|
||||
@ -1767,7 +1765,7 @@ TEST_P(
|
||||
// Log in and trigger `OnActiveUserPrefServiceChange`.
|
||||
SimulateUserLogin(kAccountId1);
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId1, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
WallpaperInfo actual_info;
|
||||
@ -1822,7 +1820,7 @@ TEST_P(WallpaperControllerTest, SetAndRemovePolicyWallpaper) {
|
||||
// the wallpaper info is updated.
|
||||
ClearWallpaperCount();
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId1, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(
|
||||
@ -2049,7 +2047,7 @@ TEST_P(WallpaperControllerTest, SetThirdPartyWallpaper_PolicyWallpaper) {
|
||||
// Set a policy wallpaper for |kUser2|. Verify that |kUser2| becomes policy
|
||||
// controlled.
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId2, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId2, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(controller_->IsWallpaperControlledByPolicy(kAccountId2));
|
||||
@ -2270,7 +2268,7 @@ TEST_P(WallpaperControllerTest, SetDefaultWallpaperForRegularAccount) {
|
||||
}
|
||||
|
||||
TEST_P(WallpaperControllerTest, SetDefaultWallpaperForChildAccount) {
|
||||
SimulateUserLogin(kChildAccountId, user_manager::USER_TYPE_CHILD);
|
||||
SimulateUserLogin(kChildAccountId, user_manager::UserType::kChild);
|
||||
|
||||
// Verify the large child wallpaper is set successfully with the correct file
|
||||
// path.
|
||||
@ -2323,7 +2321,7 @@ TEST_P(WallpaperControllerTest,
|
||||
|
||||
const AccountId guest_id =
|
||||
AccountId::FromUserEmail(user_manager::kGuestUserName);
|
||||
SimulateUserLogin(guest_id, user_manager::USER_TYPE_GUEST);
|
||||
SimulateUserLogin(guest_id, user_manager::UserType::kGuest);
|
||||
controller_->SetDefaultWallpaper(guest_id, /*show_wallpaper=*/true,
|
||||
base::DoNothing());
|
||||
RunAllTasksUntilIdle();
|
||||
@ -2346,7 +2344,7 @@ TEST_P(WallpaperControllerTest,
|
||||
// user and verifying that the policy has been applied successfully.
|
||||
WallpaperInfo policy_wallpaper_info;
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId1, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(
|
||||
@ -2377,7 +2375,7 @@ TEST_P(WallpaperControllerTest, SetDefaultWallpaperForGuestSessionAndPreview) {
|
||||
const AccountId guest_id =
|
||||
AccountId::FromUserEmail(user_manager::kGuestUserName);
|
||||
controller_->ShowUserWallpaper(guest_id);
|
||||
SimulateUserLogin(guest_id, user_manager::USER_TYPE_GUEST);
|
||||
SimulateUserLogin(guest_id, user_manager::UserType::kGuest);
|
||||
WallpaperInfo wallpaper_info;
|
||||
EXPECT_TRUE(pref_manager_->GetUserWallpaperInfo(guest_id, &wallpaper_info));
|
||||
EXPECT_EQ(wallpaper_info.type, WallpaperType::kDefault);
|
||||
@ -2397,7 +2395,7 @@ TEST_P(WallpaperControllerTest, SetDefaultWallpaperForGuestSession) {
|
||||
|
||||
const AccountId guest_id =
|
||||
AccountId::FromUserEmail(user_manager::kGuestUserName);
|
||||
SimulateUserLogin(guest_id, user_manager::USER_TYPE_GUEST);
|
||||
SimulateUserLogin(guest_id, user_manager::UserType::kGuest);
|
||||
|
||||
// Verify that during a guest session, |SetDefaultWallpaper| removes the user
|
||||
// custom wallpaper info, but a guest specific wallpaper should be set,
|
||||
@ -2529,7 +2527,7 @@ TEST_P(WallpaperControllerTest, GetSeaPenMetadataInvalidJson) {
|
||||
|
||||
TEST_P(WallpaperControllerTest, IgnoreWallpaperRequestInKioskMode) {
|
||||
gfx::ImageSkia image = CreateImage(640, 480, kWallpaperColor);
|
||||
SimulateUserLogin("kiosk", user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateUserLogin("kiosk", user_manager::UserType::kKioskApp);
|
||||
|
||||
// Verify that |SetDecodedCustomWallpaper| doesn't set wallpaper in kiosk
|
||||
// mode, and |kAccountId1|'s wallpaper info is not updated.
|
||||
@ -2577,7 +2575,7 @@ TEST_P(WallpaperControllerTest, IgnoreWallpaperRequestInKioskMode) {
|
||||
|
||||
// Disable the wallpaper setting for public session since it is ephemeral.
|
||||
TEST_P(WallpaperControllerTest, NotShowWallpaperSettingInPublicSession) {
|
||||
SimulateUserLogin("public_session", user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin("public_session", user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(controller_->ShouldShowWallpaperSetting());
|
||||
}
|
||||
|
||||
@ -2587,7 +2585,7 @@ TEST_P(WallpaperControllerTest, IgnoreWallpaperRequestWhenPolicyIsEnforced) {
|
||||
|
||||
// Set a policy wallpaper for the user. Verify the user is policy controlled.
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId1, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(controller_->IsWallpaperControlledByPolicy(kAccountId1));
|
||||
@ -3084,7 +3082,7 @@ TEST_P(WallpaperControllerTest, IsActiveUserWallpaperControlledByPolicy) {
|
||||
// Set a policy wallpaper for the active user. Verify that the active user
|
||||
// becomes policy controlled.
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_REGULAR,
|
||||
kAccountId1, user_manager::UserType::kRegular,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(controller_->IsActiveUserWallpaperControlledByPolicy());
|
||||
@ -3108,9 +3106,9 @@ TEST_P(WallpaperControllerTest,
|
||||
// Set a policy wallpaper for the managed guest session. Verify that the
|
||||
// managed guest session becomes policy controlled.
|
||||
controller_->SetPolicyWallpaper(
|
||||
kAccountId1, user_manager::USER_TYPE_PUBLIC_ACCOUNT,
|
||||
kAccountId1, user_manager::UserType::kPublicAccount,
|
||||
CreateEncodedImageForTesting(gfx::Size(10, 10)));
|
||||
SimulateUserLogin(kAccountId1, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin(kAccountId1, user_manager::UserType::kPublicAccount);
|
||||
RunAllTasksUntilIdle();
|
||||
EXPECT_TRUE(controller_->IsWallpaperControlledByPolicy(kAccountId1));
|
||||
|
||||
|
@ -29,7 +29,7 @@ bool IsEphemeralUser(const AccountId& account_id) {
|
||||
|
||||
// Public account(e.g. demo mode) should always be ephemeral.
|
||||
return user_session->user_info.is_ephemeral ||
|
||||
user_session->user_info.type == user_manager::USER_TYPE_PUBLIC_ACCOUNT;
|
||||
user_session->user_info.type == user_manager::UserType::kPublicAccount;
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
|
@ -25,14 +25,14 @@ TEST_F(WallpaperEphemeralUserTest, RegularUser) {
|
||||
|
||||
TEST_F(WallpaperEphemeralUserTest, RegularUserLoggedIn) {
|
||||
const AccountId& account_id = user_manager::StubAccountId();
|
||||
const user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR;
|
||||
const user_manager::UserType user_type = user_manager::UserType::kRegular;
|
||||
SimulateUserLogin(account_id, user_type);
|
||||
EXPECT_FALSE(IsEphemeralUser(account_id));
|
||||
}
|
||||
|
||||
TEST_F(WallpaperEphemeralUserTest, PublicAccount) {
|
||||
const AccountId& account_id = AccountId::FromUserEmail("managed_guest@");
|
||||
SimulateUserLogin(account_id, user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SimulateUserLogin(account_id, user_manager::UserType::kPublicAccount);
|
||||
EXPECT_TRUE(IsEphemeralUser(account_id));
|
||||
}
|
||||
|
||||
|
@ -39,14 +39,14 @@ bool IsKioskSession() {
|
||||
session_controller->GetUserSessionByAccountId(account_id)->user_info.type;
|
||||
|
||||
switch (user_type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
case user_manager::UserType::kGuest:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
return false;
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -4912,12 +4912,12 @@ class DesksMultiUserTest : public NoSessionAshTestBase,
|
||||
RegisterUserProfilePrefs(user_2_prefs_->registry(), /*country=*/"",
|
||||
/*for_test=*/true);
|
||||
session_controller->AddUserSession(kUser1Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser1AccountId(),
|
||||
std::move(user_1_prefs));
|
||||
session_controller->AddUserSession(kUser2Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser2AccountId(),
|
||||
std::move(user_2_prefs));
|
||||
|
@ -35,7 +35,7 @@ bool IsGuestSession() {
|
||||
const UserIndex user_index = 0;
|
||||
const UserSession* const user_session =
|
||||
Shell::Get()->session_controller()->GetUserSession(user_index);
|
||||
return user_session->user_info.type == user_manager::USER_TYPE_GUEST;
|
||||
return user_session->user_info.type == user_manager::UserType::kGuest;
|
||||
}
|
||||
|
||||
// Returns true if all windows have bounds.
|
||||
|
@ -452,7 +452,7 @@ class WmGestureHandlerKioskTest : public WmGestureHandlerTest {
|
||||
|
||||
void SetUp() override {
|
||||
WmGestureHandlerTest::SetUp();
|
||||
SimulateKioskMode(user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kWebKioskApp);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -886,7 +886,7 @@ TEST_F(TabletModeMultitaskMenuTest, HidesWhenMinimized) {
|
||||
TEST_F(TabletModeMultitaskMenuTest, NotShownInKioskMode) {
|
||||
// Enter kiosk mode and try swiping down. The multitask menu and cue should
|
||||
// not show.
|
||||
SimulateKioskMode(user_manager::USER_TYPE_KIOSK_APP);
|
||||
SimulateKioskMode(user_manager::UserType::kKioskApp);
|
||||
auto window = CreateAppWindow(gfx::Rect(800, 600));
|
||||
EXPECT_FALSE(
|
||||
GetMultitaskMenuController()->multitask_cue_controller()->cue_layer());
|
||||
|
@ -3193,12 +3193,12 @@ class MultiUserWindowCycleControllerTest
|
||||
RegisterUserProfilePrefs(user_2_prefs_->registry(), /*country=*/"",
|
||||
/*for_test=*/true);
|
||||
session_controller->AddUserSession(kUser1Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser1AccountId(),
|
||||
std::move(user_1_prefs));
|
||||
session_controller->AddUserSession(kUser2Email,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::UserType::kRegular,
|
||||
/*provide_pref_service=*/false);
|
||||
session_controller->SetUserPrefService(GetUser2AccountId(),
|
||||
std::move(user_2_prefs));
|
||||
|
@ -1805,9 +1805,9 @@ class AccessibilityManagerUserTypeTest
|
||||
public WithParamInterface<user_manager::UserType> {
|
||||
protected:
|
||||
AccessibilityManagerUserTypeTest() {
|
||||
if (GetParam() == user_manager::USER_TYPE_GUEST) {
|
||||
if (GetParam() == user_manager::UserType::kGuest) {
|
||||
guest_session_ = std::make_unique<GuestSessionMixin>(&mixin_host_);
|
||||
} else if (GetParam() == user_manager::USER_TYPE_CHILD) {
|
||||
} else if (GetParam() == user_manager::UserType::kChild) {
|
||||
logged_in_user_mixin_ = std::make_unique<LoggedInUserMixin>(
|
||||
&mixin_host_, LoggedInUserMixin::LogInType::kChild,
|
||||
embedded_test_server(), this);
|
||||
@ -1846,13 +1846,14 @@ class AccessibilityManagerUserTypeTest
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(UserTypeInstantiation,
|
||||
AccessibilityManagerUserTypeTest,
|
||||
::testing::Values(user_manager::USER_TYPE_REGULAR,
|
||||
user_manager::USER_TYPE_GUEST,
|
||||
user_manager::USER_TYPE_CHILD));
|
||||
::testing::Values(user_manager::UserType::kRegular,
|
||||
user_manager::UserType::kGuest,
|
||||
user_manager::UserType::kChild));
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) {
|
||||
if (GetParam() == user_manager::USER_TYPE_CHILD)
|
||||
if (GetParam() == user_manager::UserType::kChild) {
|
||||
logged_in_user_mixin_->LogInUser();
|
||||
}
|
||||
|
||||
// This object watches for IME preference changes and reflects those in
|
||||
// the IME framework state.
|
||||
|
@ -328,8 +328,8 @@ bool IsArcBlockedDueToIncompatibleFileSystem(const Profile* profile) {
|
||||
// for ARC kiosk as migration to ext4 should always be triggered.
|
||||
// Without this check it fails to start after browser crash as
|
||||
// compatibility info is stored in RAM.
|
||||
if (user && (user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT ||
|
||||
user->GetType() == user_manager::USER_TYPE_ARC_KIOSK_APP)) {
|
||||
if (user && (user->GetType() == user_manager::UserType::kPublicAccount ||
|
||||
user->GetType() == user_manager::UserType::kArcKioskApp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -75,13 +75,13 @@ class ScopedLogIn {
|
||||
ScopedLogIn(
|
||||
ash::FakeChromeUserManager* fake_user_manager,
|
||||
const AccountId& account_id,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR)
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular)
|
||||
: ScopedLogIn(false, fake_user_manager, account_id, user_type) {}
|
||||
ScopedLogIn(
|
||||
bool isAffiliated,
|
||||
ash::FakeChromeUserManager* fake_user_manager,
|
||||
const AccountId& account_id,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR)
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular)
|
||||
: fake_user_manager_(fake_user_manager), account_id_(account_id) {
|
||||
// Prevent access to DBus. This switch is reset in case set from test SetUp
|
||||
// due massive usage of InitFromArgv.
|
||||
@ -90,16 +90,16 @@ class ScopedLogIn {
|
||||
command_line.AppendSwitch(switches::kTestType);
|
||||
|
||||
switch (user_type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::UserType::kRegular:
|
||||
if (!isAffiliated)
|
||||
LogIn();
|
||||
else
|
||||
LogInWithAffiliatedAccount();
|
||||
break;
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
LogInAsPublicAccount();
|
||||
break;
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
LogInArcKioskApp();
|
||||
break;
|
||||
default:
|
||||
@ -261,7 +261,7 @@ TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_PublicAccount) {
|
||||
{"", "--arc-availability=officially-supported"});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail("public_user@gmail.com"),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_TRUE(IsArcAllowedForProfile(profile()));
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_KioskArcNotAvailable) {
|
||||
base::CommandLine::ForCurrentProcess()->InitFromArgv({""});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail(profile()->GetProfileUserName()),
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
EXPECT_FALSE(
|
||||
ash::ProfileHelper::Get()->GetUserByProfile(profile())->HasGaiaAccount());
|
||||
EXPECT_FALSE(IsArcAllowedForProfileOnFirstCall(profile()));
|
||||
@ -280,7 +280,7 @@ TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_KioskArcInstalled) {
|
||||
{"", "--arc-availability=installed"});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail(profile()->GetProfileUserName()),
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
EXPECT_FALSE(
|
||||
ash::ProfileHelper::Get()->GetUserByProfile(profile())->HasGaiaAccount());
|
||||
EXPECT_TRUE(IsArcAllowedForProfileOnFirstCall(profile()));
|
||||
@ -291,7 +291,7 @@ TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_KioskArcSupported) {
|
||||
{"", "--arc-availability=officially-supported"});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail(profile()->GetProfileUserName()),
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
EXPECT_FALSE(
|
||||
ash::ProfileHelper::Get()->GetUserByProfile(profile())->HasGaiaAccount());
|
||||
EXPECT_TRUE(IsArcAllowedForProfileOnFirstCall(profile()));
|
||||
@ -326,21 +326,21 @@ TEST_F(ChromeArcUtilTest, IsArcBlockedDueToIncompatibleFileSystem) {
|
||||
// Blocked for a regular user.
|
||||
{
|
||||
ScopedLogIn login(GetFakeUserManager(), user_id,
|
||||
user_manager::USER_TYPE_REGULAR);
|
||||
user_manager::UserType::kRegular);
|
||||
EXPECT_TRUE(IsArcBlockedDueToIncompatibleFileSystem(profile()));
|
||||
}
|
||||
|
||||
// Never blocked for an ARC kiosk.
|
||||
{
|
||||
ScopedLogIn login(GetFakeUserManager(), robot_id,
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
EXPECT_FALSE(IsArcBlockedDueToIncompatibleFileSystem(profile()));
|
||||
}
|
||||
|
||||
// Never blocked for a public session.
|
||||
{
|
||||
ScopedLogIn login(GetFakeUserManager(), robot_id,
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(IsArcBlockedDueToIncompatibleFileSystem(profile()));
|
||||
}
|
||||
}
|
||||
@ -591,7 +591,7 @@ TEST_F(ChromeArcUtilTest, IsArcStatsReportingEnabled_PublicAccount) {
|
||||
{"", "--arc-availability=officially-supported"});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail("public_user@gmail.com"),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(IsArcStatsReportingEnabled());
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ TEST_F(ChromeArcUtilTest, ArcStartModeDefaultPublicSession) {
|
||||
command_line->InitFromArgv({"", "--arc-availability=installed"});
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail("public_user@gmail.com"),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(IsPlayStoreAvailable());
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ TEST_F(ChromeArcUtilTest, ArcStartModeDefaultDemoMode) {
|
||||
cros_settings_test_helper_.InstallAttributes()->SetDemoMode();
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail("public_user@gmail.com"),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_TRUE(IsPlayStoreAvailable());
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ TEST_F(ChromeArcUtilTest, ArcStartModeDefaultDemoModeWithoutPlayStore) {
|
||||
cros_settings_test_helper_.InstallAttributes()->SetDemoMode();
|
||||
ScopedLogIn login(GetFakeUserManager(),
|
||||
AccountId::FromUserEmail("public_user@gmail.com"),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_FALSE(IsPlayStoreAvailable());
|
||||
}
|
||||
|
||||
|
@ -347,19 +347,19 @@ class ArcAuthServiceTest : public InProcessBrowserTest,
|
||||
kFakeUserName, signin::GetTestGaiaIdForEmail(kFakeUserName));
|
||||
const user_manager::User* user = nullptr;
|
||||
switch (user_type) {
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kChild:
|
||||
user = fake_user_manager_->AddChildUser(account_id);
|
||||
break;
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::UserType::kRegular:
|
||||
user = fake_user_manager_->AddUser(account_id);
|
||||
break;
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
user = fake_user_manager_->AddPublicAccountUser(account_id);
|
||||
break;
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
user = fake_user_manager_->AddUserWithAffiliationAndTypeAndProfile(
|
||||
account_id, false /*is_affiliated*/,
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP, nullptr /*profile*/);
|
||||
user_manager::UserType::kArcKioskApp, nullptr /*profile*/);
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "Unexpected user type " << user_type;
|
||||
@ -372,7 +372,7 @@ class ArcAuthServiceTest : public InProcessBrowserTest,
|
||||
TestingProfile::Builder profile_builder;
|
||||
profile_builder.SetPath(temp_dir_.GetPath().AppendASCII("TestArcProfile"));
|
||||
profile_builder.SetProfileName(kFakeUserName);
|
||||
if (user_type == user_manager::USER_TYPE_CHILD) {
|
||||
if (user_type == user_manager::UserType::kChild) {
|
||||
profile_builder.SetIsSupervisedProfile();
|
||||
}
|
||||
|
||||
@ -503,7 +503,7 @@ class ArcAuthServiceTest : public InProcessBrowserTest,
|
||||
|
||||
AccountInfo SetupGaiaAccount(const std::string& email,
|
||||
bool make_available_in_arc = true) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
return SeedAccountInfo(email, make_available_in_arc);
|
||||
}
|
||||
|
||||
@ -575,7 +575,7 @@ class ArcAuthServiceTest : public InProcessBrowserTest,
|
||||
};
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForGaiaAccounts) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
const std::pair<std::string, mojom::ChromeAccountType> primary_account =
|
||||
RequestPrimaryAccount();
|
||||
EXPECT_EQ(kFakeUserName, primary_account.first);
|
||||
@ -583,7 +583,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForGaiaAccounts) {
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForChildAccounts) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_CHILD);
|
||||
SetAccountAndProfile(user_manager::UserType::kChild);
|
||||
const std::pair<std::string, mojom::ChromeAccountType> primary_account =
|
||||
RequestPrimaryAccount();
|
||||
EXPECT_EQ(kFakeUserName, primary_account.first);
|
||||
@ -591,7 +591,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForChildAccounts) {
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForPublicAccounts) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SetAccountAndProfile(user_manager::UserType::kPublicAccount);
|
||||
const std::pair<std::string, mojom::ChromeAccountType> primary_account =
|
||||
RequestPrimaryAccount();
|
||||
EXPECT_EQ(std::string(), primary_account.first);
|
||||
@ -601,7 +601,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, GetPrimaryAccountForPublicAccounts) {
|
||||
// Tests that when ARC requests account info for a non-managed account,
|
||||
// Chrome supplies the info configured in SetAccountAndProfile() method.
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, SuccessfulBackgroundFetch) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
GetFakeAuthTokenResponse());
|
||||
|
||||
@ -622,7 +622,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, SuccessfulBackgroundFetch) {
|
||||
// which fetches the auth code to be used for Google Play Store sign-in if the
|
||||
// request has failed because of a unreachable mandatory PAC script.
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, SuccessfulBackgroundProxyBypass) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
int requests_count = 0;
|
||||
test_url_loader_factory()->SetInterceptor(base::BindLambdaForTesting(
|
||||
[&requests_count, this](const network::ResourceRequest& request) {
|
||||
@ -666,7 +666,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, SuccessfulBackgroundProxyBypass) {
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
ReAuthenticatePrimaryAccountSucceeds) {
|
||||
base::HistogramTester tester;
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
GetFakeAuthTokenResponse());
|
||||
|
||||
@ -690,7 +690,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
RetryAuthTokenExchangeRequestOnUnauthorizedError) {
|
||||
base::HistogramTester tester;
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
|
||||
base::RunLoop run_loop;
|
||||
auth_instance().RequestAccountInfo(kFakeUserName, run_loop.QuitClosure());
|
||||
@ -716,7 +716,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
ReAuthenticatePrimaryAccountFailsForInvalidAccount) {
|
||||
base::HistogramTester tester;
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
std::string() /* response */,
|
||||
net::HTTP_UNAUTHORIZED);
|
||||
@ -736,7 +736,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, FetchSecondaryAccountInfoSucceeds) {
|
||||
base::HistogramTester tester;
|
||||
// Add a Secondary Account.
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
GetFakeAuthTokenResponse());
|
||||
@ -763,7 +763,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
FetchSecondaryAccountInfoFailsForInvalidAccounts) {
|
||||
base::HistogramTester tester;
|
||||
// Add a Secondary Account.
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
std::string() /* response */,
|
||||
@ -833,7 +833,7 @@ IN_PROC_BROWSER_TEST_P(
|
||||
ArcAuthServiceTest,
|
||||
FetchSecondaryAccountInfoReturnsErrorForNotFoundAccounts) {
|
||||
base::HistogramTester tester;
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
// Don't add account with kSecondaryAccountEmail.
|
||||
|
||||
base::RunLoop run_loop;
|
||||
@ -851,7 +851,7 @@ IN_PROC_BROWSER_TEST_P(
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, FetchGoogleAccountsFromArc) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
|
||||
EXPECT_FALSE(arc_google_accounts_callback_called());
|
||||
RequestGoogleAccountsInArc();
|
||||
@ -866,7 +866,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, FetchGoogleAccountsFromArc) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
FetchGoogleAccountsFromArcWorksAcrossConnectionResets) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
|
||||
// Close the connection.
|
||||
arc_bridge_service().auth()->CloseInstance(&auth_instance());
|
||||
@ -890,7 +890,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
IN_PROC_BROWSER_TEST_P(
|
||||
ArcAuthServiceTest,
|
||||
PrimaryAccountReauthIsNotAttemptedJustAfterProvisioning) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
const int initial_num_account_upserted_calls =
|
||||
auth_instance().num_account_upserted_calls();
|
||||
const int initial_num_set_accounts_calls =
|
||||
@ -995,7 +995,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, AccountRemovalsArePropagated) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
|
||||
EXPECT_EQ(0, auth_instance().num_account_removed_calls());
|
||||
@ -1023,7 +1023,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
return;
|
||||
}
|
||||
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
|
||||
EXPECT_EQ(0, auth_instance().num_account_removed_calls());
|
||||
@ -1120,7 +1120,7 @@ IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest, GetDemoAccount) {
|
||||
ash::test::LockDemoDeviceInstallAttributes();
|
||||
ash::DemoSession::StartIfInDemoMode();
|
||||
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SetAccountAndProfile(user_manager::UserType::kPublicAccount);
|
||||
|
||||
test_url_loader_factory()->SetInterceptor(
|
||||
base::BindLambdaForTesting([&](const network::ResourceRequest& request) {
|
||||
@ -1146,7 +1146,7 @@ IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest,
|
||||
ash::test::LockDemoDeviceInstallAttributes();
|
||||
ash::DemoSession::StartIfInDemoMode();
|
||||
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SetAccountAndProfile(user_manager::UserType::kPublicAccount);
|
||||
|
||||
test_url_loader_factory()->SetInterceptor(
|
||||
base::BindLambdaForTesting([&](const network::ResourceRequest& request) {
|
||||
@ -1177,7 +1177,7 @@ IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest,
|
||||
ash::test::LockDemoDeviceInstallAttributes();
|
||||
ash::DemoSession::StartIfInDemoMode();
|
||||
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SetAccountAndProfile(user_manager::UserType::kPublicAccount);
|
||||
|
||||
test_url_loader_factory()->SetInterceptor(
|
||||
base::BindLambdaForTesting([&](const network::ResourceRequest& request) {
|
||||
@ -1198,7 +1198,7 @@ IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest,
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest,
|
||||
RequestPublicAccountInfo) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
SetAccountAndProfile(user_manager::UserType::kPublicAccount);
|
||||
profile()->GetProfilePolicyConnector()->OverrideIsManagedForTesting(true);
|
||||
|
||||
test_url_loader_factory()->SetInterceptor(
|
||||
@ -1222,7 +1222,7 @@ IN_PROC_BROWSER_TEST_P(ArcRobotAccountAuthServiceTest,
|
||||
// Tests that when ARC requests account info for a child account and
|
||||
// Chrome supplies the info configured in SetAccountAndProfile() above.
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, ChildAccountFetch) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_CHILD);
|
||||
SetAccountAndProfile(user_manager::UserType::kChild);
|
||||
EXPECT_TRUE(profile()->IsChild());
|
||||
test_url_loader_factory()->AddResponse(arc::kTokenBootstrapEndPoint,
|
||||
GetFakeAuthTokenResponse());
|
||||
@ -1241,7 +1241,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, ChildAccountFetch) {
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, ChildTransition) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_CHILD);
|
||||
SetAccountAndProfile(user_manager::UserType::kChild);
|
||||
|
||||
ArcSessionManager* session = ArcSessionManager::Get();
|
||||
ASSERT_TRUE(session);
|
||||
@ -1349,7 +1349,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest, ChildTransition) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
RegularUserSecondaryAccountsArePropagated) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_REGULAR);
|
||||
SetAccountAndProfile(user_manager::UserType::kRegular);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
if (IsArcAccountRestrictionsEnabled()) {
|
||||
// 1 SetAccounts() call for the Primary account.
|
||||
@ -1368,7 +1368,7 @@ IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
// Tests child account propagation for Family Link user.
|
||||
IN_PROC_BROWSER_TEST_P(ArcAuthServiceTest,
|
||||
ChildUserSecondaryAccountsPropagation) {
|
||||
SetAccountAndProfile(user_manager::USER_TYPE_CHILD);
|
||||
SetAccountAndProfile(user_manager::UserType::kChild);
|
||||
SeedAccountInfo(kSecondaryAccountEmail);
|
||||
EXPECT_TRUE(profile()->IsChild());
|
||||
if (IsArcAccountRestrictionsEnabled()) {
|
||||
|
@ -53,19 +53,19 @@ bool IsAssistantAllowedForUserType(const Profile* profile) {
|
||||
AssistantAllowedState GetErrorForUserType(const Profile* profile) {
|
||||
DCHECK(!IsAssistantAllowedForUserType(profile));
|
||||
switch (GetUser(profile)->GetType()) {
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
return AssistantAllowedState::DISALLOWED_BY_PUBLIC_SESSION;
|
||||
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
return AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE;
|
||||
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::UserType::kGuest:
|
||||
return AssistantAllowedState::DISALLOWED_BY_ACCOUNT_TYPE;
|
||||
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
// This method should only be called for disallowed user types.
|
||||
NOTREACHED();
|
||||
return AssistantAllowedState::DISALLOWED_BY_ACCOUNT_TYPE;
|
||||
|
@ -54,7 +54,7 @@ class ScopedLogIn {
|
||||
ash::FakeChromeUserManager* fake_user_manager,
|
||||
signin::IdentityTestEnvironment* identity_test_env,
|
||||
const AccountId& account_id,
|
||||
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR)
|
||||
user_manager::UserType user_type = user_manager::UserType::kRegular)
|
||||
: fake_user_manager_(fake_user_manager),
|
||||
identity_test_env_(identity_test_env),
|
||||
account_id_(account_id) {
|
||||
@ -83,8 +83,9 @@ class ScopedLogIn {
|
||||
|
||||
void MakeAccountAvailableAsPrimaryAccount(user_manager::UserType user_type) {
|
||||
// Guest user can never be a primary account.
|
||||
if (user_type == user_manager::USER_TYPE_GUEST)
|
||||
if (user_type == user_manager::UserType::kGuest) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!identity_test_env_->identity_manager()->HasPrimaryAccount(
|
||||
signin::ConsentLevel::kSignin)) {
|
||||
@ -98,17 +99,17 @@ class ScopedLogIn {
|
||||
// happen.
|
||||
void RunValidityChecks(user_manager::UserType user_type) const {
|
||||
switch (user_type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild:
|
||||
EXPECT_TRUE(IsGaiaAccount());
|
||||
return;
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
EXPECT_FALSE(IsGaiaAccount());
|
||||
return;
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::UserType::kGuest:
|
||||
// Guest user must use the guest user account id.
|
||||
EXPECT_EQ(account_id_, user_manager::GuestAccountId());
|
||||
return;
|
||||
@ -117,25 +118,25 @@ class ScopedLogIn {
|
||||
|
||||
void AddUser(user_manager::UserType user_type) {
|
||||
switch (user_type) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::UserType::kRegular:
|
||||
fake_user_manager_->AddUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
fake_user_manager_->AddPublicAccountUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::UserType::kKioskApp:
|
||||
fake_user_manager_->AddKioskAppUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
fake_user_manager_->AddArcKioskAppUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP:
|
||||
case user_manager::UserType::kWebKioskApp:
|
||||
fake_user_manager_->AddWebKioskAppUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_CHILD:
|
||||
case user_manager::UserType::kChild:
|
||||
fake_user_manager_->AddChildUser(account_id_);
|
||||
return;
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::UserType::kGuest:
|
||||
fake_user_manager_->AddGuestUser();
|
||||
return;
|
||||
}
|
||||
@ -256,7 +257,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_SecondaryUser) {
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_ChildUser) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_CHILD);
|
||||
user_manager::UserType::kChild);
|
||||
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::ALLOWED,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
@ -265,7 +266,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_ChildUser) {
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_GuestUser) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
user_manager::GuestAccountId(),
|
||||
user_manager::USER_TYPE_GUEST);
|
||||
user_manager::UserType::kGuest);
|
||||
|
||||
EXPECT_EQ(
|
||||
ash::assistant::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER,
|
||||
@ -292,7 +293,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_DemoMode) {
|
||||
profile()->ScopedCrosSettingsTestHelper()->InstallAttributes()->SetDemoMode();
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetNonGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::DISALLOWED_BY_DEMO_MODE,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
|
||||
@ -303,7 +304,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_DemoMode) {
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForProfile_PublicSession) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetNonGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_PUBLIC_ACCOUNT);
|
||||
user_manager::UserType::kPublicAccount);
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::DISALLOWED_BY_PUBLIC_SESSION,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
}
|
||||
@ -339,7 +340,7 @@ TEST_F(ChromeAssistantUtilTest,
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForKiosk_KioskApp) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetNonGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_KIOSK_APP);
|
||||
user_manager::UserType::kKioskApp);
|
||||
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
@ -348,7 +349,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForKiosk_KioskApp) {
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForKiosk_ArcKioskApp) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetNonGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_ARC_KIOSK_APP);
|
||||
user_manager::UserType::kArcKioskApp);
|
||||
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
@ -357,7 +358,7 @@ TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForKiosk_ArcKioskApp) {
|
||||
TEST_F(ChromeAssistantUtilTest, IsAssistantAllowedForKiosk_WebKioskApp) {
|
||||
ScopedLogIn login(GetFakeUserManager(), identity_test_env(),
|
||||
GetNonGaiaUserAccountId(profile()),
|
||||
user_manager::USER_TYPE_WEB_KIOSK_APP);
|
||||
user_manager::UserType::kWebKioskApp);
|
||||
|
||||
EXPECT_EQ(ash::assistant::AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE,
|
||||
IsAssistantAllowedForProfile(profile()));
|
||||
|
@ -95,9 +95,9 @@ void FamilyUserDeviceMetrics::OnUserSessionStarted(bool is_primary_user) {
|
||||
user_manager_->GetPrimaryUser()->GetType();
|
||||
|
||||
NewUserAdded new_user_type = NewUserAdded::kOtherUserAdded;
|
||||
if (type == user_manager::USER_TYPE_CHILD) {
|
||||
if (type == user_manager::UserType::kChild) {
|
||||
new_user_type = NewUserAdded::kFamilyLinkUserAdded;
|
||||
} else if (type == user_manager::USER_TYPE_REGULAR) {
|
||||
} else if (type == user_manager::UserType::kRegular) {
|
||||
new_user_type = NewUserAdded::kRegularUserAdded;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class ScreenTimeControllerTest : public MixinBasedInProcessBrowserTest {
|
||||
const user_manager::UserManager* const user_manager =
|
||||
user_manager::UserManager::Get();
|
||||
EXPECT_EQ(user_manager->GetActiveUser()->GetType(),
|
||||
user_manager::USER_TYPE_CHILD);
|
||||
user_manager::UserType::kChild);
|
||||
child_profile_ =
|
||||
ProfileHelper::Get()->GetProfileByUser(user_manager->GetActiveUser());
|
||||
|
||||
|
@ -1548,8 +1548,8 @@ void BrowserManager::PrepareLacrosPolicies() {
|
||||
policy::CloudPolicyCore* core = nullptr;
|
||||
policy::ComponentCloudPolicyService* component_policy_service = nullptr;
|
||||
switch (user->GetType()) {
|
||||
case user_manager::USER_TYPE_REGULAR:
|
||||
case user_manager::USER_TYPE_CHILD: {
|
||||
case user_manager::UserType::kRegular:
|
||||
case user_manager::UserType::kChild: {
|
||||
Profile* profile = Profile::FromBrowserContext(
|
||||
ash::BrowserContextHelper::Get()->GetBrowserContextByUser(user));
|
||||
DCHECK(profile);
|
||||
@ -1562,9 +1562,9 @@ void BrowserManager::PrepareLacrosPolicies() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case user_manager::USER_TYPE_KIOSK_APP:
|
||||
case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
|
||||
case user_manager::USER_TYPE_WEB_KIOSK_APP: {
|
||||
case user_manager::UserType::kKioskApp:
|
||||
case user_manager::UserType::kPublicAccount:
|
||||
case user_manager::UserType::kWebKioskApp: {
|
||||
policy::DeviceLocalAccountPolicyService* policy_service =
|
||||
g_browser_process->platform_part()
|
||||
->browser_policy_connector_ash()
|
||||
@ -1581,8 +1581,8 @@ void BrowserManager::PrepareLacrosPolicies() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case user_manager::USER_TYPE_GUEST:
|
||||
case user_manager::USER_TYPE_ARC_KIOSK_APP:
|
||||
case user_manager::UserType::kGuest:
|
||||
case user_manager::UserType::kArcKioskApp:
|
||||
break;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user