Skip to content

cl/361880889: Uncomment Firestore test RestartFirestoreLeadsToNewInstance for Android now that auth is a soft dependency #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions firestore/integration_test_internal/src/firestore_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1269,24 +1269,16 @@ TEST_F(FirestoreIntegrationTest, MaintainsPersistenceAfterRestarting) {
EXPECT_TRUE(snap->exists());
}

// TODO(b/173730469) Enable this test on Android once the Auth issue is fixed.
#if !defined(__ANDROID__)
TEST_F(FirestoreIntegrationTest, RestartFirestoreLeadsToNewInstance) {
// Get App and Settings objects to use in the test.
Firestore* db_template = TestFirestore("restart_firestore_new_instance_test");
App* app = db_template->app();
Settings settings = db_template->settings();
DeleteFirestore(db_template);

// Get the Auth object so that it can be explicitly deleted to avoid a leak.
// This memory leak avoidance hack can be removed once Auth becomes a soft
// dependency (b/147772264).
InitResult init_result;
Auth* auth = Auth::GetAuth(app, &init_result);
ASSERT_EQ(kInitResultSuccess, init_result);

// Verify that GetInstance() returns the same instance when specified the same
// App.
InitResult init_result;
Firestore* db1 = Firestore::GetInstance(app, &init_result);
ASSERT_EQ(kInitResultSuccess, init_result);
Firestore* db1_copy = Firestore::GetInstance(app, &init_result);
Expand Down Expand Up @@ -1318,9 +1310,7 @@ TEST_F(FirestoreIntegrationTest, RestartFirestoreLeadsToNewInstance) {

delete db2;
delete db1;
delete auth;
}
#endif // if !defined(__ANDROID__)

TEST_F(FirestoreIntegrationTest, CanStopListeningAfterTerminate) {
auto instance = TestFirestore();
Expand Down