Ben Copsey

Reinstate part of throttle test

... ... @@ -21,7 +21,7 @@
#import "ASIInputStream.h"
// Automatically set on build
NSString *ASIHTTPRequestVersion = @"v1.2-39 2009-12-17";
NSString *ASIHTTPRequestVersion = @"v1.2-40 2009-12-17";
NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
... ... @@ -525,9 +525,6 @@ static BOOL isiPhoneOS2;
return [self inProgress];
}
#pragma mark request logic
// Create the request
... ...
... ... @@ -1095,11 +1095,9 @@
success = (interval < -3);
GHAssertTrue(success,@"Failed to throttle upload");
GHAssertNil([request error],@"Request generated an error - timeout?");
}
- (void)testFetchToInvalidPath
{
// Test gzipped content
... ...
... ... @@ -899,23 +899,23 @@ IMPORTANT
// We'll test first without throttling
int i;
// for (i=0; i<5; i++) {
// // This image is around 18KB in size, for 90KB total download size
// ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]];
// [networkQueue addOperation:request];
// }
//
for (i=0; i<5; i++) {
// This image is around 18KB in size, for 90KB total download size
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]];
[networkQueue addOperation:request];
}
NSDate *date = [NSDate date];
// [networkQueue go];
//
// while (!complete) {
// [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.25]];
// }
//
//
[networkQueue go];
while (!complete) {
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.25]];
}
NSTimeInterval interval =[date timeIntervalSinceNow];
BOOL success = (interval > -6);
// GHAssertTrue(success,@"Downloaded the data too slowly - either this is a bug, or your internet connection is too slow to run this test (must be able to download 90KB in less than 6 seconds, without throttling)");
GHAssertTrue(success,@"Downloaded the data too slowly - either this is a bug, or your internet connection is too slow to run this test (must be able to download 90KB in less than 6 seconds, without throttling)");
// Reset the queue
... ...