Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip
20 changes: 16 additions & 4 deletions storage/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,10 @@ TEST_F(FirebaseStorageTest, TestLargeFilePauseResumeAndDownloadCancel) {
// operation.
ASSERT_TRUE(controller.is_valid());

ProcessEvents(500);
while(controller.bytes_transferred() == 0)
{
ProcessEvents(1);
}
// After waiting a moment for the operation to start, pause the operation
// and verify it was successfully paused. Note that pause might not take
// effect immediately, so we give it a few moments to pause before
Expand Down Expand Up @@ -638,7 +641,11 @@ TEST_F(FirebaseStorageTest, TestLargeFilePauseResumeAndDownloadCancel) {
ref.GetBytes(&buffer[0], kLargeFileSize, &listener, &controller);
ASSERT_TRUE(controller.is_valid());

ProcessEvents(500);
while(controller.bytes_transferred() == 0)
{
ProcessEvents(1);
}

LogDebug("Pausing download.");
EXPECT_TRUE(controller.Pause()) << "Download pause";

Expand Down Expand Up @@ -691,7 +698,12 @@ TEST_F(FirebaseStorageTest, TestLargeFilePauseResumeAndDownloadCancel) {
firebase::Future<size_t> future =
ref.GetBytes(&buffer[0], kLargeFileSize, &listener, &controller);
ASSERT_TRUE(controller.is_valid());
ProcessEvents(500);

while(controller.bytes_transferred() == 0)
{
ProcessEvents(1);
}

LogDebug("Cancelling download.");
EXPECT_TRUE(controller.Cancel());
WaitForCompletion(future, "GetBytes", firebase::storage::kErrorCancelled);
Expand Down Expand Up @@ -773,4 +785,4 @@ TEST_F(FirebaseStorageTest, TestInvalidatingReferencesWhenDeletingApp) {
EXPECT_FALSE(metadata.is_valid());
}

} // namespace firebase_testapp_automated
} // namespace firebase_testapp_automated