Skip to content

Commit 31e40b2

Browse files
authored
Merge branch 'dev' into bugfix/integration-tests-mac-openssl-error
2 parents eba69c8 + 08f1456 commit 31e40b2

File tree

17 files changed

+93
-49
lines changed

17 files changed

+93
-49
lines changed

admob/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase AdMob test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/AdMob', '6.24.0'
7+
pod 'Firebase/AdMob', '7.0.0'
88
end
99

1010
post_install do |installer|

analytics/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase Analytics test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Analytics', '6.24.0'
7+
pod 'Firebase/Analytics', '7.0.0'
88
end
99

1010
post_install do |installer|

app/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase App test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Analytics', '6.24.0'
7+
pod 'Firebase/Analytics', '7.0.0'
88
end
99

1010
post_install do |installer|

auth/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase Auth test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Auth', '6.24.0'
7+
pod 'Firebase/Auth', '7.0.0'
88
end
99

1010
post_install do |installer|

database/integration_test/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase Realtime Database test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Database', '6.24.0'
8-
pod 'Firebase/Auth', '6.24.0'
7+
pod 'Firebase/Database', '7.0.0'
8+
pod 'Firebase/Auth', '7.0.0'
99
end
1010

1111
post_install do |installer|

database/integration_test/src/integration_test.cc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ class FirebaseDatabaseTest : public FirebaseTest {
137137
// Sign in an anonymous user.
138138
static void SignIn();
139139
// Sign out the current user, if applicable.
140+
// If this is an anonymous user, deletes the user instead,
141+
// to avoid polluting the user list.
140142
static void SignOut();
141143

142144
// Initialize Firebase Database.
@@ -341,12 +343,19 @@ void FirebaseDatabaseTest::SignOut() {
341343
// Already signed out.
342344
return;
343345
}
344-
345-
shared_auth_->SignOut();
346-
347-
// Wait for the sign-out to finish.
348-
while (shared_auth_->current_user() != nullptr) {
349-
if (ProcessEvents(100)) break;
346+
if (shared_auth_->current_user()->is_anonymous()) {
347+
// If signed in anonymously, delete the anonymous user.
348+
WaitForCompletion(shared_auth_->current_user()->Delete(), "DeleteAnonymousUser");
349+
}
350+
else {
351+
// If not signed in anonymously (e.g. if the tests were modified to sign in
352+
// as an actual user), just sign out normally.
353+
shared_auth_->SignOut();
354+
355+
// Wait for the sign-out to finish.
356+
while (shared_auth_->current_user() != nullptr) {
357+
if (ProcessEvents(100)) break;
358+
}
350359
}
351360
EXPECT_EQ(shared_auth_->current_user(), nullptr);
352361
}
@@ -1180,16 +1189,22 @@ TEST_F(FirebaseDatabaseTest, TestInfoConnected) {
11801189
}
11811190
LogDebug("Disconnecting...");
11821191
database_->GoOffline();
1192+
// Pause a moment to give the SDK time to realize we are disconnected.
1193+
ProcessEvents(1000);
11831194
{
11841195
auto disconnected = info.GetValue();
11851196
WaitForCompletion(disconnected, "GetValue 3");
11861197
EXPECT_EQ(disconnected.result()->value(), false);
11871198
}
11881199
LogDebug("Reconnecting...");
11891200
database_->GoOnline();
1201+
// Pause a moment to give the SDK time to realize we are reconnected.
11901202
ProcessEvents(1000);
11911203
// Force getting a value so that we reconnect to the database.
11921204
WaitForCompletion(ref.GetValue(), "GetValue 4 [ignored]");
1205+
// Pause another moment to REALLY give the SDK time to realize we are
1206+
// reconnected.
1207+
ProcessEvents(1000);
11931208
{
11941209
auto reconnected = info.GetValue();
11951210
WaitForCompletion(reconnected, "GetValue 5");

dynamic_links/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase Dynamic Links test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/DynamicLinks', '6.24.0'
7+
pod 'Firebase/DynamicLinks', '7.0.0'
88
end
99

1010
post_install do |installer|

firestore/integration_test/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Firebase Realtime Firestore test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Firestore', '6.32.2'
8-
pod 'Firebase/Auth', '6.32.2'
7+
pod 'Firebase/Firestore', '7.0.0'
8+
pod 'Firebase/Auth', '7.0.0'
99
end
1010

1111
post_install do |installer|

firestore/integration_test/src/integration_test.cc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class FirebaseFirestoreBasicTest : public FirebaseTest {
7676
// Sign in an anonymous user.
7777
static void SignIn();
7878
// Sign out the current user, if applicable.
79+
// If this is an anonymous user, deletes the user instead,
80+
// to avoid polluting the user list.
7981
static void SignOut();
8082

8183
// Initialize Firestore.
@@ -282,11 +284,19 @@ void FirebaseFirestoreBasicTest::SignOut() {
282284
return;
283285
}
284286

285-
shared_auth_->SignOut();
286-
287-
// Wait for the sign-out to finish.
288-
while (shared_auth_->current_user() != nullptr) {
289-
if (ProcessEvents(100)) break;
287+
if (shared_auth_->current_user()->is_anonymous()) {
288+
// If signed in anonymously, delete the anonymous user.
289+
WaitForCompletion(shared_auth_->current_user()->Delete(), "DeleteAnonymousUser");
290+
}
291+
else {
292+
// If not signed in anonymously (e.g. if the tests were modified to sign in
293+
// as an actual user), just sign out normally.
294+
shared_auth_->SignOut();
295+
296+
// Wait for the sign-out to finish.
297+
while (shared_auth_->current_user() != nullptr) {
298+
if (ProcessEvents(100)) break;
299+
}
290300
}
291301
EXPECT_EQ(shared_auth_->current_user(), nullptr);
292302
}

functions/integration_test/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '8.0'
3+
platform :ios, '10.0'
44
# Cloud Functions for Firebase test application.
55

66
target 'integration_test' do
7-
pod 'Firebase/Functions', '6.24.0'
8-
pod 'Firebase/Auth', '6.24.0'
7+
pod 'Firebase/Functions', '7.0.0'
8+
pod 'Firebase/Auth', '7.0.0'
99
end
1010

1111
post_install do |installer|

0 commit comments

Comments
 (0)