@@ -649,6 +649,7 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfile) {
649
649
auth_->CreateUserWithEmailAndPassword (email.c_str (), kTestPassword );
650
650
WaitForCompletion (create_user, " CreateUserWithEmailAndPassword" );
651
651
EXPECT_TRUE (auth_->current_user ().is_valid ());
652
+
652
653
// Set some user profile properties.
653
654
firebase::auth::User user = create_user.result ()->user ;
654
655
const char kDisplayName [] = " Hello World" ;
@@ -661,6 +662,8 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfile) {
661
662
user = auth_->current_user ();
662
663
EXPECT_EQ (user.display_name (), kDisplayName );
663
664
EXPECT_EQ (user.photo_url (), kPhotoUrl );
665
+
666
+ // Validate that the new properties are present after signing out and in.
664
667
SignOut ();
665
668
WaitForCompletion (
666
669
auth_->SignInWithEmailAndPassword (email.c_str (), kTestPassword ),
@@ -677,6 +680,7 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileNull) {
677
680
auth_->CreateUserWithEmailAndPassword (email.c_str (), kTestPassword );
678
681
WaitForCompletion (create_user, " CreateUserWithEmailAndPassword" );
679
682
EXPECT_TRUE (auth_->current_user ().is_valid ());
683
+
680
684
// Set some user profile properties.
681
685
firebase::auth::User user = create_user.result ()->user ;
682
686
const char kDisplayName [] = " Hello World" ;
@@ -689,6 +693,7 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileNull) {
689
693
user = auth_->current_user ();
690
694
EXPECT_EQ (user.display_name (), kDisplayName );
691
695
EXPECT_EQ (user.photo_url (), kPhotoUrl );
696
+
692
697
// Setting the entries to null should leave the old values
693
698
firebase::auth::User::UserProfile user_profile_null;
694
699
user_profile_null.display_name = nullptr ;
@@ -699,6 +704,8 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileNull) {
699
704
user = auth_->current_user ();
700
705
EXPECT_EQ (user.display_name (), kDisplayName );
701
706
EXPECT_EQ (user.photo_url (), kPhotoUrl );
707
+
708
+ // Validate that the new properties are present after signing out and in.
702
709
SignOut ();
703
710
WaitForCompletion (
704
711
auth_->SignInWithEmailAndPassword (email.c_str (), kTestPassword ),
@@ -715,6 +722,7 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileEmpty) {
715
722
auth_->CreateUserWithEmailAndPassword (email.c_str (), kTestPassword );
716
723
WaitForCompletion (create_user, " CreateUserWithEmailAndPassword" );
717
724
EXPECT_TRUE (auth_->current_user ().is_valid ());
725
+
718
726
// Set some user profile properties.
719
727
firebase::auth::User user = create_user.result ()->user ;
720
728
const char kDisplayName [] = " Hello World" ;
@@ -727,6 +735,7 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileEmpty) {
727
735
user = auth_->current_user ();
728
736
EXPECT_EQ (user.display_name (), kDisplayName );
729
737
EXPECT_EQ (user.photo_url (), kPhotoUrl );
738
+
730
739
// Setting the fields to empty should clear it.
731
740
firebase::auth::User::UserProfile user_profile_empty;
732
741
user_profile_empty.display_name = " " ;
@@ -737,6 +746,8 @@ TEST_F(FirebaseAuthTest, TestUpdateUserProfileEmpty) {
737
746
user = auth_->current_user ();
738
747
EXPECT_EQ (user.display_name (), " " );
739
748
EXPECT_EQ (user.photo_url (), " " );
749
+
750
+ // Validate that the properties are cleared out after signing out and in.
740
751
SignOut ();
741
752
WaitForCompletion (
742
753
auth_->SignInWithEmailAndPassword (email.c_str (), kTestPassword ),
0 commit comments