Skip to content

Commit

Permalink
LukeIS: adding default responses to window_handle(s) for iOS to suppo…
Browse files Browse the repository at this point in the history
…rt WebDriverBackedSelenium. Fixes Issue 1590.

r15294
  • Loading branch information
lukeis committed Dec 29, 2011
1 parent 5ccb7cc commit 5f03ddc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions iphone/src/objc/Session.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ - (id) initWithSessionRootAndSessionId:(SessionRoot*)root
[self setResourceToViewMethodGET:@selector(screenshot)
POST:NULL
withName:@"screenshot"];

// Get a window handle
[self setResourceToViewMethodGET:@selector(windowHandle)
POST:NULL
withName:@"window_handle"];

// Get a window handles
[self setResourceToViewMethodGET:@selector(windowHandles)
POST:NULL
withName:@"window_handles"];

// HTML5 Local WebStorage
[self setResource:[Storage storageWithType:LOCAL_STORAGE]
Expand Down
10 changes: 10 additions & 0 deletions iphone/src/objc/WebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ - (void)refresh:(NSDictionary*)ignored {
waitUntilLoad:YES];
}

// Currently only one window handle is supported
// These are just here to support WebDriverBackedSelenium
-(NSString*)windowHandle {
return @"1";
}

-(NSArray*)windowHandles {
return [[NSArray alloc] initWithObjects:@"1", nil];
}

- (id)visible {
// The WebView is always visible.
return [NSNumber numberWithBool:YES];
Expand Down

0 comments on commit 5f03ddc

Please sign in to comment.