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-07 23:54:09 -0800 |
commit | 6d9f13ec28da8dacac33577b4e830e83f87a55c0 (patch) | |
tree | 4f159dd474bde9a841b62e4fd4f55c53d4e04acf /platform/darwin/test/MGLOfflineStorageTests.mm | |
parent | daccbaffbc902f4a9d69975ce06e76b9d8a62dde (diff) | |
download | qtlocation-mapboxgl-upstream/1ec5-offline-put-rename.tar.gz |
[ios, macos] Renamed ambient cache prewarming methodupstream/1ec5-offline-put-rename
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" }; |