Skip to content

Commit

Permalink
webdriver: Implement Fullscreen command support (#100)
Browse files Browse the repository at this point in the history
* Implement Fullscreen command support

This adds the HTTP endpoint and command structures for supporting the
Fullscreen command as in
https://w3c.github.io/webdriver/webdriver-spec.html#fullscreen-window

Source-Repo: https://github.com/mozilla/webdriver-rust
Source-Revision: 7ce4ae6266c73547a50b974355e1ef5fa426924c

committer: jgraham <[email protected]>

--HG--
extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000
extra : subtree_revision : ce4f326dd0c9b52fda1bb8c553e6912d11034a1b
  • Loading branch information
AutomatedTester committed Jun 7, 2017
1 parent 353c4dd commit 287db9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testing/webdriver/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub enum WebDriverCommand<T: WebDriverExtensionCommand> {
GetWindowRect,
SetWindowRect(WindowRectParameters),
MaximizeWindow,
// FullscreenWindow // Not supported in marionette
FullscreenWindow,
SwitchToWindow(SwitchToWindowParameters),
SwitchToFrame(SwitchToFrameParameters),
SwitchToParentFrame,
Expand Down Expand Up @@ -136,6 +136,7 @@ impl<U: WebDriverExtensionRoute> WebDriverMessage<U> {
WebDriverCommand::SetWindowRect(parameters)
},
Route::MaximizeWindow => WebDriverCommand::MaximizeWindow,
Route::FullscreenWindow => WebDriverCommand::FullscreenWindow,
Route::SwitchToWindow => {
let parameters: SwitchToWindowParameters = try!(Parameters::from_json(&body_data));
WebDriverCommand::SwitchToWindow(parameters)
Expand Down Expand Up @@ -401,6 +402,7 @@ impl <U:WebDriverExtensionRoute> ToJson for WebDriverMessage<U> {
WebDriverCommand::IsEnabled(_) |
WebDriverCommand::IsSelected(_) |
WebDriverCommand::MaximizeWindow |
WebDriverCommand::FullscreenWindow |
WebDriverCommand::NewSession(_) |
WebDriverCommand::Refresh |
WebDriverCommand::Status |
Expand Down
2 changes: 2 additions & 0 deletions testing/webdriver/src/httpapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn standard_routes<U:WebDriverExtensionRoute>() -> Vec<(Method, &'static str, Ro
(Get, "/session/{sessionId}/window/rect", Route::GetWindowRect),
(Post, "/session/{sessionId}/window/rect", Route::SetWindowRect),
(Post, "/session/{sessionId}/window/maximize", Route::MaximizeWindow),
(Post, "/session/{sessionId}/window/fullscreen", Route::FullscreenWindow),
(Post, "/session/{sessionId}/window", Route::SwitchToWindow),
(Post, "/session/{sessionId}/frame", Route::SwitchToFrame),
(Post, "/session/{sessionId}/frame/parent", Route::SwitchToParentFrame),
Expand Down Expand Up @@ -90,6 +91,7 @@ pub enum Route<U:WebDriverExtensionRoute> {
GetWindowRect,
SetWindowRect,
MaximizeWindow,
FullscreenWindow,
SwitchToWindow,
SwitchToFrame,
SwitchToParentFrame,
Expand Down

0 comments on commit 287db9a

Please sign in to comment.