@@ -62,10 +62,10 @@ const char* kStorageUrl = nullptr;
6262
6363#if FIREBASE_PLATFORM_DESKTOP
6464// Use a larger file on desktop...
65- const int kLargeFileMegabytes = 32 ;
65+ const int kLargeFileMegabytes = 64 ;
6666#else
6767// ...and a smaller file on mobile.
68- const int kLargeFileMegabytes = 16 ;
68+ const int kLargeFileMegabytes = 32 ;
6969#endif
7070
7171const char kRootNodeName [] = " integration_test_data" ;
@@ -1428,7 +1428,20 @@ TEST_F(FirebaseStorageTest, TestLargeFilePauseResumeAndDownloadCancel) {
14281428
14291429 LogDebug (" Cancelling download." );
14301430 EXPECT_TRUE (controller.Cancel ());
1431+ #if FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
1432+ // TODO(b/255839066): Change this to expect kErrorCancelled once iOS SDK
1433+ // returns the correct error code.
1434+ //
1435+ // iOS/tvOS SDK doesn't always report kErrorCancelled, so ensure that
1436+ // either it was reported as cancelled, or the file was not fully uploaded.
1437+ WaitForCompletionAnyResult (future, " GetBytes" );
1438+ EXPECT_TRUE (
1439+ future.error () == firebase::storage::kErrorCancelled ||
1440+ future.error () == firebase::storage::kErrorUnknown ||
1441+ (future.error () == 0 && controller.bytes_transferred () < kLargeFileSize ));
1442+ #else
14311443 WaitForCompletion (future, " GetBytes" , firebase::storage::kErrorCancelled );
1444+ #endif
14321445
14331446 FLAKY_TEST_SECTION_END ();
14341447}
@@ -1464,7 +1477,14 @@ TEST_F(FirebaseStorageTest, TestLargeFileCancelUpload) {
14641477#if FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
14651478 // TODO(b/255839066): Change this to expect kErrorCancelled once iOS SDK
14661479 // returns the correct error code.
1467- WaitForCompletion (future, " PutBytes" , firebase::storage::kErrorUnknown );
1480+ //
1481+ // iOS/tvOS SDK doesn't always report kErrorCancelled, so ensure that
1482+ // either it was reported as cancelled, or the file was not fully uploaded.
1483+ WaitForCompletionAnyResult (future, " PutBytes" );
1484+ EXPECT_TRUE (
1485+ future.error () == firebase::storage::kErrorCancelled ||
1486+ future.error () == firebase::storage::kErrorUnknown ||
1487+ (future.error () == 0 && controller.bytes_transferred () < kLargeFileSize ));
14681488#else
14691489 WaitForCompletion (future, " PutBytes" , firebase::storage::kErrorCancelled );
14701490#endif // FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
0 commit comments