From bc86ea7a96e9c6d8d1c60adfe689c82dc22b86bd Mon Sep 17 00:00:00 2001 From: Ashutosh Singhal <macinashutosh@google.com> Date: Fri, 28 Mar 2025 13:28:30 -0700 Subject: [PATCH] Enable CRD unattended feature flags by default. The following feature flags are enabled by default: * EnableAutoApproveEnterpriseSharedSessions * EnableCrdSharedSessionToUnattendedDevice Bug: b:390164145 Change-Id: Idd7d84f01ae8fab97283e35759bd676ef50d27ea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6397021 Reviewed-by: Joe Downing <joedow@chromium.org> Commit-Queue: Ashutosh Singhal <macinashutosh@google.com> Reviewed-by: Jeroen Dhollander <jeroendh@google.com> Cr-Commit-Position: refs/heads/main@{#1439670} --- ...etch_crd_availability_info_job_unittest.cc | 17 ++--- ..._command_start_crd_session_job_unittest.cc | 62 +++---------------- remoting/host/chromeos/features.cc | 4 +- 3 files changed, 20 insertions(+), 63 deletions(-) diff --git a/chrome/browser/ash/policy/remote_commands/crd/device_command_fetch_crd_availability_info_job_unittest.cc b/chrome/browser/ash/policy/remote_commands/crd/device_command_fetch_crd_availability_info_job_unittest.cc index 233be7b7a4746..0f399ee22a273 100644 --- a/chrome/browser/ash/policy/remote_commands/crd/device_command_fetch_crd_availability_info_job_unittest.cc +++ b/chrome/browser/ash/policy/remote_commands/crd/device_command_fetch_crd_availability_info_job_unittest.cc @@ -223,9 +223,6 @@ class DeviceCommandFetchCrdAvailabilityInfoJobTestParameterizedOverSessionType CrdSessionAvailability GetExpectedRemoteSupportAvailabilityFor( TestSessionType session_type) { switch (session_type) { - // TODO(b:393521569) Update session availability on default enabled state - // for CRD unattended feature flag. - case TestSessionType::kNoSession: case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: return CrdSessionAvailability:: @@ -237,6 +234,7 @@ class DeviceCommandFetchCrdAvailabilityInfoJobTestParameterizedOverSessionType case TestSessionType::kAutoLaunchedKioskSession: case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return CrdSessionAvailability::AVAILABLE; } } @@ -310,15 +308,15 @@ TEST_F(DeviceCommandFetchCrdAvailabilityInfoJobTest, } TEST_F(DeviceCommandFetchCrdAvailabilityInfoJobTest, - AllowRemoteSupportSessionAtLoginScreenIfEnabledByFeatureFlag) { + DontAllowRemoteSupportSessionAtLoginScreenIfDisabledByFeatureFlag) { base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(kEnableCrdSharedSessionToUnattendedDevice); + feature_list.InitAndDisableFeature(kEnableCrdSharedSessionToUnattendedDevice); StartSessionOfType(TestSessionType::kNoSession); Result result = CreateAndRunJob(); EXPECT_EQ(ParseJsonDict(result.payload).FindInt("remoteSupportAvailability"), - CrdSessionAvailability::AVAILABLE); + CrdSessionAvailability::UNAVAILABLE_UNSUPPORTED_USER_SESSION_TYPE); } TEST_P(DeviceCommandFetchCrdAvailabilityInfoJobTestParameterizedOverSessionType, @@ -371,7 +369,10 @@ TEST_P(DeviceCommandFetchCrdAvailabilityInfoJobTestParameterizedOverSessionType, const base::Value::List expected = [&]() { switch (session_type) { case TestSessionType::kNoSession: - return ToList({CrdSessionType::REMOTE_ACCESS_SESSION}); + return ToList({ + CrdSessionType::REMOTE_SUPPORT_SESSION, + CrdSessionType::REMOTE_ACCESS_SESSION, + }); case TestSessionType::kManuallyLaunchedWebKioskSession: case TestSessionType::kManuallyLaunchedKioskSession: @@ -428,12 +429,12 @@ TEST_P(DeviceCommandFetchCrdAvailabilityInfoJobTestParameterizedOverSessionType, const CrdSessionAvailability expected = [&]() { switch (session_type) { - case TestSessionType::kNoSession: case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: return CrdSessionAvailability:: UNAVAILABLE_UNSUPPORTED_USER_SESSION_TYPE; + case TestSessionType::kNoSession: case TestSessionType::kManuallyLaunchedWebKioskSession: case TestSessionType::kManuallyLaunchedKioskSession: case TestSessionType::kAutoLaunchedWebKioskSession: diff --git a/chrome/browser/ash/policy/remote_commands/crd/device_command_start_crd_session_job_unittest.cc b/chrome/browser/ash/policy/remote_commands/crd/device_command_start_crd_session_job_unittest.cc index b139f3b6ef41f..2d3636211d2a4 100644 --- a/chrome/browser/ash/policy/remote_commands/crd/device_command_start_crd_session_job_unittest.cc +++ b/chrome/browser/ash/policy/remote_commands/crd/device_command_start_crd_session_job_unittest.cc @@ -143,13 +143,11 @@ bool SupportsRemoteSupport(TestSessionType user_session_type) { case TestSessionType::kAutoLaunchedKioskSession: case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return true; case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: - // TODO(b:393521569) Update session type supported on default enabled - // state for CRD unattended feature flag. - case TestSessionType::kNoSession: return false; } } @@ -446,13 +444,11 @@ TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, case TestSessionType::kAutoLaunchedKioskSession: case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return true; case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: - // TODO(b:393521569) Update session type supported on default enabled - // state for CRD unattended feature flag. - case TestSessionType::kNoSession: return false; } }(); @@ -483,13 +479,11 @@ TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, case TestSessionType::kAutoLaunchedKioskSession: case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return true; case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: - case TestSessionType::kNoSession: - // TODO(b:393521569) Update session type supported on default enabled - // state for CRD unattended feature flag. return false; } }(); @@ -661,15 +655,16 @@ TEST_P(DeviceCommandStartCrdSessionJobTestBoolParameterized, } TEST_F(DeviceCommandStartCrdSessionJobTest, - AllowRemoteSupportSessionAtLoginScreenIfEnabledByFeatureFlag) { - EnableFeature(kEnableCrdSharedSessionToUnattendedDevice); + DontAllowRemoteSupportSessionAtLoginScreenIfDisabledByFeatureFlag) { + DisableFeature(kEnableCrdSharedSessionToUnattendedDevice); StartSessionOfType(TestSessionType::kNoSession); Result result = RunJobAndWaitForResult( Payload().Set("crdSessionType", CrdSessionType::REMOTE_SUPPORT_SESSION)); - EXPECT_SUCCESS(result); + EXPECT_ERROR(result, + StartCrdSessionResultCode::FAILURE_UNSUPPORTED_USER_TYPE); } TEST_F(DeviceCommandStartCrdSessionJobTest, @@ -705,13 +700,11 @@ TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return false; case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: - // TODO(b:393521569) Update session type supported on default enabled - // state for CRD unattended feature flag. - case TestSessionType::kNoSession: // Unsupported session types NOTREACHED(); } @@ -742,17 +735,6 @@ TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, EXPECT_FALSE(delegate().session_parameters().terminate_upon_input); } -TEST_F(DeviceCommandStartCrdSessionJobTest, - ShouldNotTerminateUponInputForRemoteSupportAtLoginScreen) { - EnableFeature(kEnableCrdSharedSessionToUnattendedDevice); - - StartSessionOfType(TestSessionType::kNoSession); - Result result = RunJobAndWaitForResult(); - - EXPECT_SUCCESS(result); - EXPECT_FALSE(delegate().session_parameters().terminate_upon_input); -} - TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, TestShowConfirmationDialogForRemoteSupport) { TestSessionType user_session_type = GetParam(); @@ -777,13 +759,11 @@ TEST_P(DeviceCommandStartCrdSessionJobTestParameterized, case TestSessionType::kManagedGuestSession: case TestSessionType::kAffiliatedUserSession: + case TestSessionType::kNoSession: return true; case TestSessionType::kGuestSession: case TestSessionType::kUnaffiliatedUserSession: - // TODO(b:393521569) Update session type supported on default enabled - // state for CRD unattended feature flag. - case TestSessionType::kNoSession: // Unsupported session types NOTREACHED(); } @@ -807,7 +787,6 @@ TEST_F(DeviceCommandStartCrdSessionJobTest, TEST_F(DeviceCommandStartCrdSessionJobTest, TestConnectionAutoApproveTimeoutForSharedSessions) { - EnableFeature(kAutoApproveEnterpriseSharedSessions); AddActiveManagedNetwork(); SetDeviceIdleTime(kAutoApproveDeviceIdlenessCutoff); @@ -846,7 +825,6 @@ TEST_F(DeviceCommandStartCrdSessionJobTest, TEST_F( DeviceCommandStartCrdSessionJobTest, ShouldNotSetConnectionAutoApproveTimeoutIfDeviceIsIdleMoreThanTheCutoff) { - EnableFeature(kAutoApproveEnterpriseSharedSessions); AddActiveManagedNetwork(); SetDeviceIdleTime(kAutoApproveDeviceIdlenessCutoff + 1); @@ -861,7 +839,6 @@ TEST_F( TEST_F( DeviceCommandStartCrdSessionJobTest, ShouldNotSetConnectionAutoApproveTimeoutIfDeviceIsNotConnectedToManagedNetwork) { - EnableFeature(kAutoApproveEnterpriseSharedSessions); SetDeviceIdleTime(kAutoApproveDeviceIdlenessCutoff); LogInAsAffiliatedUser(); @@ -1300,16 +1277,6 @@ TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, EXPECT_FALSE(delegate().session_parameters().terminate_upon_input); } -TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, - ShouldNotTerminateUponInputEvenIfEnabledByCrdUnattendedFeatureFlag) { - EnableFeature(kEnableCrdSharedSessionToUnattendedDevice); - - AddActiveManagedNetwork(); - - EXPECT_SUCCESS(RunJobAndWaitForResult()); - EXPECT_FALSE(delegate().session_parameters().terminate_upon_input); -} - TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, ShouldNotShowConfirmationDialog) { AddActiveManagedNetwork(); @@ -1318,16 +1285,6 @@ TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, EXPECT_FALSE(delegate().session_parameters().show_confirmation_dialog); } -TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, - ShouldNotShowConfirmationDialogEvenIfEnabledByCrdUnattendedFeatureFlag) { - EnableFeature(kEnableCrdSharedSessionToUnattendedDevice); - - AddActiveManagedNetwork(); - - EXPECT_SUCCESS(RunJobAndWaitForResult(RemoteAccessPayload())); - EXPECT_FALSE(delegate().session_parameters().show_confirmation_dialog); -} - TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, ShouldNotLimitSessionDuration) { AddActiveManagedNetwork(); @@ -1340,7 +1297,6 @@ TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest, ShouldNotSetConnectionAutoApproveTimeout) { - EnableFeature(kAutoApproveEnterpriseSharedSessions); AddActiveManagedNetwork(); SetDeviceIdleTime(kAutoApproveDeviceIdlenessCutoff); diff --git a/remoting/host/chromeos/features.cc b/remoting/host/chromeos/features.cc index 398c38ab70d66..84ff54d683a76 100644 --- a/remoting/host/chromeos/features.cc +++ b/remoting/host/chromeos/features.cc @@ -18,10 +18,10 @@ BASE_FEATURE(kEnableCrdFileTransferForKiosk, BASE_FEATURE(kEnableCrdSharedSessionToUnattendedDevice, "EnableCrdSharedSessionToUnattendedDevice", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kAutoApproveEnterpriseSharedSessions, "EnableAutoApproveEnterpriseSharedSessions", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); } // namespace remoting::features