Skip to content

Commit

Permalink
JasonLeyba: The iPhoneDriver should return a proper WebDriver respons…
Browse files Browse the repository at this point in the history
…e object for /session/:sessionId/screenshot.

r14500
  • Loading branch information
jleyba committed Nov 2, 2011
1 parent 3bc3951 commit f74fd7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iphone/src/objc/WebDriverResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import "WebDriverResponse.h"
#import "HTTPJSONResponse.h"
#import "HTTPPNGResponse.h"
#import "NSData+Base64.h"
#import "NSException+WebDriver.h"
#import "errorcodes.h"

Expand Down Expand Up @@ -97,11 +98,10 @@ - (void)createResponse {
[response_ release];

if ([value_ isKindOfClass:[UIImage class]]) {
response_ = [[HTTPPNGResponse alloc] initWithImage:value_];
} else {
NSDictionary *dict = [self convertToDictionary];
response_ = [[HTTPJSONResponse alloc] initWithObject:(id)dict];
value_ = [UIImagePNGRepresentation(value_) base64EncodedString];
}
NSDictionary *dict = [self convertToDictionary];
response_ = [[HTTPJSONResponse alloc] initWithObject:(id)dict];
}

// Return the response_ object (create it if necessary).
Expand Down

0 comments on commit f74fd7b

Please sign in to comment.