From d10421e5117038111dca5058e8e1272bdc744978 Mon Sep 17 00:00:00 2001 From: Carson McDonald Date: Thu, 25 Jul 2013 11:34:50 -0400 Subject: [PATCH 1/4] Set async timeout to longer than request timeout --- Tests/AFHTTPRequestOperationTests.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/AFHTTPRequestOperationTests.m b/Tests/AFHTTPRequestOperationTests.m index b1ffa08..20fc05c 100644 --- a/Tests/AFHTTPRequestOperationTests.m +++ b/Tests/AFHTTPRequestOperationTests.m @@ -76,6 +76,8 @@ } - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock { + [Expecta setAsynchronousTestTimeout:10.0]; + __block NSError *blockError = nil; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]]; From ef44858189fda20e0a7ca9948c388b358d6f4f0c Mon Sep 17 00:00:00 2001 From: Carson McDonald Date: Thu, 25 Jul 2013 11:35:50 -0400 Subject: [PATCH 2/4] Set error when cancel happens before start finishes --- AFNetworking/AFURLConnectionOperation.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 58c305e..4498513 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -528,6 +528,11 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { }); if ([self isCancelled]) { + NSDictionary *userInfo = nil; + if ([self.request URL]) { + userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey]; + } + self.error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; [self finish]; } } From 0cb8ceea43faaf7e6ee3a838fb5b7f77f99d5e71 Mon Sep 17 00:00:00 2001 From: Carson McDonald Date: Thu, 8 Aug 2013 21:34:16 -0400 Subject: [PATCH 3/4] Update Podfile.lock to 1.3.2 --- Tests/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Podfile.lock b/Tests/Podfile.lock index 6e9fc9d..8b3b896 100644 --- a/Tests/Podfile.lock +++ b/Tests/Podfile.lock @@ -1,7 +1,7 @@ PODS: - AFHTTPRequestOperationLogger (0.10.0): - AFNetworking (>= 0.9.0) - - AFNetworking (1.3.1) + - AFNetworking (1.3.2) - Expecta (0.2.1) - OCMock (2.1.1) @@ -17,7 +17,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AFHTTPRequestOperationLogger: 34ba125cb9eeb77a3b67aaaca105720ba3a0798c - AFNetworking: 9ec8aafb9269236a7630bd8d9838ce2ba30fa2a0 + AFNetworking: 91bb494e2bd884a93d60a7a3126bc65b873486b4 Expecta: d46fb1bd78c90a83da0158b9b1e108de106e369f OCMock: 79212e5e328378af5cfd6edb5feacfd6c49cd8a3 From 56625c466eec93182bc385c9ca9a86ff7f1f045f Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Sat, 10 Aug 2013 20:38:23 -0400 Subject: [PATCH 4/4] Drop Podfile.lock from Git so that we don't have to deal with updating it as revisions change --- .gitignore | 1 + Tests/Podfile.lock | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 Tests/Podfile.lock diff --git a/.gitignore b/.gitignore index bd5adc7..d9b2144 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ profile DerivedData .idea/ Tests/Pods +Tests/Podfile.lock Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/ diff --git a/Tests/Podfile.lock b/Tests/Podfile.lock deleted file mode 100644 index 8b3b896..0000000 --- a/Tests/Podfile.lock +++ /dev/null @@ -1,24 +0,0 @@ -PODS: - - AFHTTPRequestOperationLogger (0.10.0): - - AFNetworking (>= 0.9.0) - - AFNetworking (1.3.2) - - Expecta (0.2.1) - - OCMock (2.1.1) - -DEPENDENCIES: - - AFHTTPRequestOperationLogger (~> 0.10.0) - - AFNetworking (from `../`) - - Expecta (~> 0.2.1) - - OCMock (~> 2.1.1) - -EXTERNAL SOURCES: - AFNetworking: - :path: ../ - -SPEC CHECKSUMS: - AFHTTPRequestOperationLogger: 34ba125cb9eeb77a3b67aaaca105720ba3a0798c - AFNetworking: 91bb494e2bd884a93d60a7a3126bc65b873486b4 - Expecta: d46fb1bd78c90a83da0158b9b1e108de106e369f - OCMock: 79212e5e328378af5cfd6edb5feacfd6c49cd8a3 - -COCOAPODS: 0.22.2