@@ -105,7 +105,7 @@ - (void)test06CancellAll {
105
105
106
106
- (void )test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
107
107
XCTestExpectation *expectation = [self expectationWithDescription: @" Image download twice with SDWebImageRefresh failed" ];
108
- NSURL *originalImageURL = [NSURL URLWithString: @" http ://via.placeholder.com/10x10.png" ];
108
+ NSURL *originalImageURL = [NSURL URLWithString: @" https ://via.placeholder.com/10x10.png" ];
109
109
__block BOOL firstCompletion = NO ;
110
110
[[SDWebImageManager sharedManager ] loadImageWithURL: originalImageURL options: SDWebImageRefreshCached progress: nil completed: ^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
111
111
expect (image).toNot .beNil ();
@@ -115,7 +115,7 @@ - (void)test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
115
115
// Because we call completion before remove the operation from queue, so need a dispatch to avoid get the same operation again. Attention this trap.
116
116
// One way to solve this is use another `NSURL instance` because we use `NSURL` as key but not `NSString`. However, this is implementation detail and no guarantee in the future.
117
117
dispatch_async (dispatch_get_main_queue (), ^{
118
- NSURL *newImageURL = [NSURL URLWithString: @" http ://via.placeholder.com/10x10.png" ];
118
+ NSURL *newImageURL = [NSURL URLWithString: @" https ://via.placeholder.com/10x10.png" ];
119
119
[[SDWebImageManager sharedManager ] loadImageWithURL: newImageURL options: SDWebImageRefreshCached progress: nil completed: ^(UIImage * _Nullable image2, NSData * _Nullable data2, NSError * _Nullable error2, SDImageCacheType cacheType2, BOOL finished2, NSURL * _Nullable imageURL2) {
120
120
expect (image2).toNot .beNil ();
121
121
expect (error2).to .beNil ();
@@ -132,7 +132,7 @@ - (void)test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
132
132
133
133
- (void )test08ThatImageTransformerWork {
134
134
XCTestExpectation *expectation = [self expectationWithDescription: @" Image transformer work" ];
135
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/80x60.png" ];
135
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/80x60.png" ];
136
136
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc ] init ];
137
137
138
138
transformer.testImage = [[UIImage alloc ] initWithContentsOfFile: [self testJPEGPath ]];
@@ -293,7 +293,7 @@ - (void)test12ThatStoreCacheTypeWork {
293
293
294
294
- (void )test13ThatScaleDownLargeImageUseThumbnailDecoding {
295
295
XCTestExpectation *expectation = [self expectationWithDescription: @" SDWebImageScaleDownLargeImages should translate to thumbnail decoding" ];
296
- NSURL *originalImageURL = [NSURL URLWithString: @" http ://via.placeholder.com/3999x3999 .png" ]; // Max size for this API
296
+ NSURL *originalImageURL = [NSURL URLWithString: @" https ://via.placeholder.com/2000x2000 .png" ]; // Max size for this API
297
297
NSUInteger defaultLimitBytes = SDImageCoderHelper.defaultScaleDownLimitBytes ;
298
298
SDImageCoderHelper.defaultScaleDownLimitBytes = 1000 * 1000 * 4 ; // Limit 1000x1000 pixel
299
299
// From v5.5.0, the `SDWebImageScaleDownLargeImages` translate to `SDWebImageContextImageThumbnailPixelSize`, and works for progressive loading
@@ -336,7 +336,7 @@ - (void)test13ThatScaleDownLargeImageEXIFOrientationImage {
336
336
337
337
- (void )test14ThatCustomCacheAndLoaderWorks {
338
338
XCTestExpectation *expectation = [self expectationWithDescription: @" Custom Cache and Loader during manger query" ];
339
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/100x100.png" ];
339
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/100x100.png" ];
340
340
SDWebImageContext *context = @{
341
341
SDWebImageContextImageCache : SDWebImageTestCache.sharedCache ,
342
342
SDWebImageContextImageLoader : SDWebImageTestLoader.sharedLoader
@@ -360,7 +360,7 @@ - (void)test14ThatCustomCacheAndLoaderWorks {
360
360
361
361
- (void )test15ThatQueryCacheTypeWork {
362
362
XCTestExpectation *expectation = [self expectationWithDescription: @" Image query cache type works" ];
363
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/101x101.png" ];
363
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/101x101.png" ];
364
364
NSString *key = [SDWebImageManager.sharedManager cacheKeyForURL: url];
365
365
NSData *testImageData = [NSData dataWithContentsOfFile: [self testJPEGPath ]];
366
366
[SDImageCache.sharedImageCache storeImageDataToDisk: testImageData forKey: key];
@@ -383,7 +383,7 @@ - (void)test15ThatQueryCacheTypeWork {
383
383
384
384
- (void )test15ThatOriginalQueryCacheTypeWork {
385
385
XCTestExpectation *expectation = [self expectationWithDescription: @" Image original query cache type with transformer works" ];
386
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/102x102.png" ];
386
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/102x102.png" ];
387
387
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc ] init ];
388
388
transformer.testImage = [[UIImage alloc ] initWithContentsOfFile: [self testJPEGPath ]];
389
389
NSString *originalKey = [SDWebImageManager.sharedManager cacheKeyForURL: url];
@@ -419,7 +419,7 @@ - (void)test15ThatOriginalQueryCacheTypeWork {
419
419
420
420
- (void )test16ThatTransformerUseDifferentCacheForOriginalAndTransformedImage {
421
421
XCTestExpectation *expectation = [self expectationWithDescription: @" Image transformer use different cache instance for original image and transformed image works" ];
422
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/103x103.png" ];
422
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/103x103.png" ];
423
423
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc ] init ];
424
424
transformer.testImage = [[UIImage alloc ] initWithContentsOfFile: [self testJPEGPath ]];
425
425
NSString *originalKey = [SDWebImageManager.sharedManager cacheKeyForURL: url];
@@ -505,7 +505,7 @@ - (void)test18ThatThumbnailLoadingCanUseFullSizeCache {
505
505
CGContextFillRect (context, CGRectMake (0 , 0 , fullSize.width , fullSize.height ));
506
506
}];
507
507
expect (fullSizeImage.size ).equal (fullSize);
508
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/500x500.png" ];
508
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/500x500.png" ];
509
509
NSString *fullSizeKey = [SDWebImageManager.sharedManager cacheKeyForURL: url];
510
510
NSData *fullSizeData = fullSizeImage.sd_imageData ;
511
511
[SDImageCache.sharedImageCache storeImageDataToDisk: fullSizeData forKey: fullSizeKey];
@@ -535,7 +535,7 @@ - (void)test19ThatDifferentThumbnailLoadShouldCallbackDifferentSize {
535
535
// We move the logic into SDWebImageDownloaderOperation, which decode each callback's thumbnail size with different decoding pipeline, and callback independently
536
536
// Note the progressiveLoad does not support this and always callback first size
537
537
538
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/501x501.png" ];
538
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/501x501.png" ];
539
539
NSString *fullSizeKey = [SDWebImageManager.sharedManager cacheKeyForURL: url];
540
540
[SDImageCache.sharedImageCache removeImageFromDiskForKey: fullSizeKey];
541
541
for (int i = 490 ; i < 500 ; i++) {
@@ -563,7 +563,7 @@ - (void)test19ThatDifferentThumbnailLoadShouldCallbackDifferentSize {
563
563
564
564
- (void )test20ThatContextPassDecodeOptionsWorks {
565
565
XCTestExpectation *expectation = [self expectationWithDescription: @" The SDWebImageContextImageDecodeOptions should passed to the coder" ];
566
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/502x502.png" ];
566
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/502x502.png" ];
567
567
SDImageCoderOptions *originalDecodeOptions = @{@" Foo" : @" Bar" , SDImageCoderDecodeScaleFactor : @(2 )}; // This will be override
568
568
569
569
[SDWebImageManager.sharedManager loadImageWithURL: url options: 0 context: @{SDWebImageContextImageScaleFactor : @(1 ), SDWebImageContextImageDecodeOptions : originalDecodeOptions} progress: nil completed: ^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
@@ -579,7 +579,7 @@ - (void)test20ThatContextPassDecodeOptionsWorks {
579
579
- (void )test21ThatQueryOriginalDiskCacheFromThumbnailShouldNotWriteBackDiskCache {
580
580
XCTestExpectation *expectation = [self expectationWithDescription: @" Using original disk cache to do thumbnail decoding or transformer, should not save back disk data again" ];
581
581
582
- NSURL *url = [NSURL URLWithString: @" http ://via.placeholder.com/503x503.png" ];
582
+ NSURL *url = [NSURL URLWithString: @" https ://via.placeholder.com/503x503.png" ];
583
583
NSString *originalKey = url.absoluteString ;
584
584
// 1. Store the disk data to original cache
585
585
CGSize fullSize = CGSizeMake (503 , 503 );
0 commit comments