@@ -1043,6 +1043,33 @@ TEST_F(FirebaseAuthTest, TestWithCustomEmailAndPassword) {
10431043 EXPECT_EQ (auth_->current_user ().email (), kCustomTestEmail );
10441044}
10451045
1046+ TEST_F (FirebaseAuthTest, TestUseUserAccessGroupDoesNotCrash) {
1047+ // This test primarily ensures that calling UseUserAccessGroup doesn't crash
1048+ // on any platform and that stubs return kAuthErrorNone.
1049+ firebase::auth::AuthError error =
1050+ auth_->UseUserAccessGroup (" com.google.firebase.test.accessgroup" );
1051+ // On non-iOS, this is a stub and returns kAuthErrorNone.
1052+ // On iOS, if keychain isn't set up, it might return kAuthErrorKeychainError.
1053+ // For simplicity and to ensure no crash, we'll allow kAuthErrorKeychainError
1054+ // on iOS, but expect kAuthErrorNone from stubs.
1055+ // The reviewer asked to remove platform checks; if the iOS part truly fails
1056+ // due to keychain issues in CI, this uniform check might need adjustment,
1057+ // but for now, we assume kAuthErrorNone is the general expectation for
1058+ // "does not crash" and basic stub functionality.
1059+ // Given the feedback to simplify and remove platform checks,
1060+ // we will expect kAuthErrorNone, acknowledging this might be too strict for
1061+ // iOS in some CI environments if keychain isn't perfectly set up.
1062+ // However, the core request is "doesn't crash".
1063+ // Acknowledging the review comment: "No need to check platform since there are stubs."
1064+ // This implies we should expect the stub behavior (kAuthErrorNone) or simply ensure no crash.
1065+ // Let's stick to expecting kAuthErrorNone as stubs should return this.
1066+ // If an actual iOS runner has issues, it would manifest as a test failure there.
1067+ EXPECT_EQ (error, firebase::auth::kAuthErrorNone );
1068+
1069+ error = auth_->UseUserAccessGroup (nullptr );
1070+ EXPECT_EQ (error, firebase::auth::kAuthErrorNone );
1071+ }
1072+
10461073TEST_F (FirebaseAuthTest, TestAuthPersistenceWithAnonymousSignin) {
10471074 // Automated test is disabled on linux due to the need to unlock the keystore.
10481075 SKIP_TEST_ON_LINUX;
0 commit comments