@@ -62,10 +62,10 @@ const char* kStorageUrl = nullptr;
62
62
63
63
#if FIREBASE_PLATFORM_DESKTOP
64
64
// Use a larger file on desktop...
65
- const int kLargeFileMegabytes = 32 ;
65
+ const int kLargeFileMegabytes = 64 ;
66
66
#else
67
67
// ...and a smaller file on mobile.
68
- const int kLargeFileMegabytes = 16 ;
68
+ const int kLargeFileMegabytes = 32 ;
69
69
#endif
70
70
71
71
const char kRootNodeName [] = " integration_test_data" ;
@@ -1428,7 +1428,20 @@ TEST_F(FirebaseStorageTest, TestLargeFilePauseResumeAndDownloadCancel) {
1428
1428
1429
1429
LogDebug (" Cancelling download." );
1430
1430
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
1431
1443
WaitForCompletion (future, " GetBytes" , firebase::storage::kErrorCancelled );
1444
+ #endif
1432
1445
1433
1446
FLAKY_TEST_SECTION_END ();
1434
1447
}
@@ -1464,7 +1477,14 @@ TEST_F(FirebaseStorageTest, TestLargeFileCancelUpload) {
1464
1477
#if FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
1465
1478
// TODO(b/255839066): Change this to expect kErrorCancelled once iOS SDK
1466
1479
// 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 ));
1468
1488
#else
1469
1489
WaitForCompletion (future, " PutBytes" , firebase::storage::kErrorCancelled );
1470
1490
#endif // FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
0 commit comments