summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2019-07-12 15:09:08 -0700
committerjmkiley <jordan.kiley@mapbox.com>2019-07-12 15:09:08 -0700
commit89dd08408b8da71ce1a399d645b64495fbef5ec2 (patch)
tree4509ea50a9dc83c54babac415f0fd1859c89da85
parentaa39bc27c21e1fa69464d5a7a914a4d76ed0af4b (diff)
downloadqtlocation-mapboxgl-89dd08408b8da71ce1a399d645b64495fbef5ec2.tar.gz
[ios] fix inconsistent completionhandler
-rw-r--r--platform/darwin/src/MGLOfflineStorage.h6
-rw-r--r--platform/darwin/src/MGLOfflineStorage.mm6
-rw-r--r--platform/darwin/test/MGLOfflineStorageTests.mm8
3 files changed, 10 insertions, 10 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.h b/platform/darwin/src/MGLOfflineStorage.h
index 0e4e16254e..a52d64714c 100644
--- a/platform/darwin/src/MGLOfflineStorage.h
+++ b/platform/darwin/src/MGLOfflineStorage.h
@@ -379,7 +379,7 @@ MGL_EXPORT
has been set. This handler is executed synchronously on the main queue.
*/
-- (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCallback:(void (^)(NSError *_Nullable error))completion;
+- (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCompletionHandler:(void (^)(NSError *_Nullable error))completion;
/**
Checks that the tiles in the ambient cache match those from the server. Local
@@ -394,7 +394,7 @@ MGL_EXPORT
been revalidated. This handler is executed asynchronously on the main queue.
*/
-- (void)invalidateAmbientCacheWithCompletion:(void (^)(NSError *_Nullable error))completion;
+- (void)invalidateAmbientCacheWithCompletionHandler:(void (^)(NSError *_Nullable error))completion;
/**
Erase resources from the ambient cache.
@@ -406,7 +406,7 @@ MGL_EXPORT
cleared. This handler is executed asynchronously on the main queue.
*/
-- (void)clearAmbientCacheWithCompletion:(void (^)(NSError *_Nullable error))completion;
+- (void)clearAmbientCacheWithCompletionHandler:(void (^)(NSError *_Nullable error))completion;
/**
Delete the existing database, which includes both the ambient cache and offline packs,
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm
index 9948deb67e..8aa4d172a8 100644
--- a/platform/darwin/src/MGLOfflineStorage.mm
+++ b/platform/darwin/src/MGLOfflineStorage.mm
@@ -509,7 +509,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
#pragma mark - Ambient Cache management
-- (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCallback:(void (^)(NSError * _Nullable))completion {
+- (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCompletionHandler:(void (^)(NSError * _Nullable))completion {
_mbglFileSource->setMaximumAmbientCacheSize(cacheSize, [&, completion](std::exception_ptr exception) {
NSError *error;
if (exception) {
@@ -525,7 +525,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
});
}
-- (void)invalidateAmbientCacheWithCompletion:(void (^)(NSError *_Nullable))completion {
+- (void)invalidateAmbientCacheWithCompletionHandler:(void (^)(NSError *_Nullable))completion {
_mbglFileSource->invalidateAmbientCache([&, completion](std::exception_ptr exception){
NSError *error;
if (exception) {
@@ -542,7 +542,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
});
}
-- (void)clearAmbientCacheWithCompletion:(void (^)(NSError *_Nullable error))completion {
+- (void)clearAmbientCacheWithCompletionHandler:(void (^)(NSError *_Nullable error))completion {
_mbglFileSource->clearAmbientCache([&, completion](std::exception_ptr exception){
NSError *error;
if (exception) {
diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm
index b300b0c682..4bb9bc6776 100644
--- a/platform/darwin/test/MGLOfflineStorageTests.mm
+++ b/platform/darwin/test/MGLOfflineStorageTests.mm
@@ -228,17 +228,17 @@
- (void)testSetMaximumAmbientCache {
XCTestExpectation *expectation = [self expectationWithDescription:@"Expect maximum cache size to be raised without an error."];
- [[MGLOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:500000 withCallback:^(NSError * _Nullable error) {
+ [[MGLOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:0 withCompletionHandler:^(NSError * _Nullable error) {
XCTAssertNil(error);
[expectation fulfill];
}];
- [self waitForExpectationsWithTimeout:20 handler:nil];
+ [self waitForExpectationsWithTimeout:30 handler:nil];
}
- (void)testInvalidateAmbientCache {
XCTestExpectation *expectation = [self expectationWithDescription:@"Expect cache to be invalidated without an error."];
- [[MGLOfflineStorage sharedOfflineStorage] invalidateAmbientCacheWithCompletion:^(NSError * _Nullable error) {
+ [[MGLOfflineStorage sharedOfflineStorage] invalidateAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) {
XCTAssertNil(error);
[expectation fulfill];
}];
@@ -247,7 +247,7 @@
- (void)testClearCache {
XCTestExpectation *expectation = [self expectationWithDescription:@"Expect cache to be cleared without an error."];
- [[MGLOfflineStorage sharedOfflineStorage] clearAmbientCacheWithCompletion:^(NSError * _Nullable error) {
+ [[MGLOfflineStorage sharedOfflineStorage] clearAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) {
XCTAssertNil(error);
[expectation fulfill];
}];