diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-11-07 23:48:15 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-11-08 14:40:23 -0800 |
commit | d13cd54af64b9bcac9ae076b33d56b2af8313803 (patch) | |
tree | 9b50d72d5f1eccded9a0935650a922d04e95716c /platform/darwin/test/MGLOfflineStorageTests.mm | |
parent | ad235d3f6c12e784511893a8219f32a004fe158b (diff) | |
download | qtlocation-mapboxgl-d13cd54af64b9bcac9ae076b33d56b2af8313803.tar.gz |
[ios, macos] Renamed ambient cache prewarming method
Renamed the method for prewarming the ambient cache to conform to Cocoa and Swift naming conventions.
Diffstat (limited to 'platform/darwin/test/MGLOfflineStorageTests.mm')
-rw-r--r-- | platform/darwin/test/MGLOfflineStorageTests.mm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index f01e6854b7..d7c592d668 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -395,12 +395,13 @@ } --(void) testPutResourceForURL { +- (void)testPutResourceForURL { NSURL *styleURL = [NSURL URLWithString:@"https://api.mapbox.com/some/thing"]; MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; std::string testData("test data"); - [os putResourceWithUrl:styleURL data:[NSData dataWithBytes:testData.c_str() length:testData.length()] modified:nil expires:nil etag:nil mustRevalidate:NO]; + NSData *data = [NSData dataWithBytes:testData.c_str() length:testData.length()]; + [os preloadData:data forURL:styleURL modificationDate:nil expirationDate:nil eTag:nil mustRevalidate:NO]; auto fs = os.mbglFileSource; const mbgl::Resource resource { mbgl::Resource::Unknown, "https://api.mapbox.com/some/thing" }; @@ -420,14 +421,15 @@ CFRunLoopRun(); } --(void) testPutResourceForURLWithTimestamps { +- (void)testPutResourceForURLWithTimestamps { NSURL *styleURL = [NSURL URLWithString:@"https://api.mapbox.com/some/thing"]; MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; std::string testData("test data"); - NSDate* now = [NSDate date]; - NSDate* future = [now dateByAddingTimeInterval:600]; - [os putResourceWithUrl:styleURL data:[NSData dataWithBytes:testData.c_str() length:testData.length()] modified:now expires:future etag:@"some etag" mustRevalidate:YES]; + NSDate *now = [NSDate date]; + NSDate *future = [now dateByAddingTimeInterval:600]; + NSData *data = [NSData dataWithBytes:testData.c_str() length:testData.length()]; + [os preloadData:data forURL:styleURL modificationDate:now expirationDate:future eTag:@"some etag" mustRevalidate:YES]; auto fs = os.mbglFileSource; const mbgl::Resource resource { mbgl::Resource::Unknown, "https://api.mapbox.com/some/thing" }; |