@@ -689,21 +689,22 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileNull) {
689
689
user = auth_->current_user ();
690
690
EXPECT_EQ (user.display_name (), kDisplayName );
691
691
EXPECT_EQ (user.photo_url (), kPhotoUrl );
692
+ // Setting the entries to null should leave the old values
692
693
firebase::auth::User::UserProfile user_profile_null;
693
- user_profile_null.display_name = kDisplayName ;
694
+ user_profile_null.display_name = nullptr ;
694
695
user_profile_null.photo_url = nullptr ;
695
696
firebase::Future<void > update_profile_null = user.UpdateUserProfile (user_profile_null);
696
697
WaitForCompletion (update_profile_null, " UpdateUserProfileNull" );
697
698
user = auth_->current_user ();
698
699
EXPECT_EQ (user.display_name (), kDisplayName );
699
- EXPECT_EQ (user.photo_url (), " " );
700
+ EXPECT_EQ (user.photo_url (), kPhotoUrl );
700
701
SignOut ();
701
702
WaitForCompletion (
702
703
auth_->SignInWithEmailAndPassword (email.c_str (), kTestPassword ),
703
704
" SignInWithEmailAndPassword" );
704
705
user = auth_->current_user ();
705
706
EXPECT_EQ (user.display_name (), kDisplayName );
706
- EXPECT_EQ (user.photo_url (), " " );
707
+ EXPECT_EQ (user.photo_url (), kPhotoUrl );
707
708
DeleteUser ();
708
709
}
709
710
@@ -725,20 +726,21 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileEmpty) {
725
726
user = auth_->current_user ();
726
727
EXPECT_EQ (user.display_name (), kDisplayName );
727
728
EXPECT_EQ (user.photo_url (), kPhotoUrl );
728
- firebase::auth::User::UserProfile user_profile_null;
729
- user_profile_null.display_name = kDisplayName ;
730
- user_profile_null.photo_url = " " ;
731
- firebase::Future<void > update_profile_null = user.UpdateUserProfile (user_profile_null);
732
- WaitForCompletion (update_profile_null, " UpdateUserProfileEmpty" );
729
+ // Setting the fields to empty should clear it.
730
+ firebase::auth::User::UserProfile user_profile_empty;
731
+ user_profile_empty.display_name = " " ;
732
+ user_profile_empty.photo_url = " " ;
733
+ firebase::Future<void > update_profile_empty = user.UpdateUserProfile (user_profile_empty);
734
+ WaitForCompletion (update_profile_empty, " UpdateUserProfileEmpty" );
733
735
user = auth_->current_user ();
734
- EXPECT_EQ (user.display_name (), kDisplayName );
736
+ EXPECT_EQ (user.display_name (), " " );
735
737
EXPECT_EQ (user.photo_url (), " " );
736
738
SignOut ();
737
739
WaitForCompletion (
738
740
auth_->SignInWithEmailAndPassword (email.c_str (), kTestPassword ),
739
741
" SignInWithEmailAndPassword" );
740
742
user = auth_->current_user ();
741
- EXPECT_EQ (user.display_name (), kDisplayName );
743
+ EXPECT_EQ (user.display_name (), " " );
742
744
EXPECT_EQ (user.photo_url (), " " );
743
745
DeleteUser ();
744
746
}
0 commit comments