Skip to content

Commit

Permalink
Auto merge of #13186 - andreastt:webdriver-0.14, r=SimonSapin,larsberg
Browse files Browse the repository at this point in the history
Update webdriver-rust library to 0.14

<!-- Please describe your changes on the following line: -->

This updates the _webdriver-rust_ library to 0.14 and makes the necessary API changes to make it compile with Servo.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is a library upgrade

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13186)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Sep 7, 2016
2 parents dd33be4 + 8a4a90a commit 5b0a199
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 5 additions & 3 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/webdriver_server/Cargo.toml
Expand Up @@ -23,5 +23,5 @@ script_traits = {path = "../script_traits"}
url = {version = "1.2", features = ["heap_size"]}
util = {path = "../util"}
uuid = { version = "0.3.1", features = ["v4"] }
webdriver = "0.9"
webdriver = "0.14"
cookie = {version = "0.2.5", features = ["serialize-rustc"]}
18 changes: 9 additions & 9 deletions components/webdriver_server/lib.rs
Expand Up @@ -15,6 +15,8 @@ extern crate euclid;
extern crate hyper;
extern crate image;
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate msg;
extern crate regex;
extern crate rustc_serialize;
Expand Down Expand Up @@ -78,10 +80,6 @@ fn cookie_msg_to_cookie(cookie: cookie_rs::Cookie) -> Cookie {
Some(time) => Nullable::Value(Date::new(time.to_timespec().sec as u64)),
None => Nullable::Null
},
maxAge: match cookie.max_age {
Some(time) => Nullable::Value(Date::new(time)),
None => Nullable::Null
},
secure: cookie.secure,
httpOnly: cookie.httponly,
}
Expand All @@ -91,8 +89,10 @@ pub fn start_server(port: u16, constellation_chan: Sender<ConstellationMsg>) {
let handler = Handler::new(constellation_chan);
spawn_named("WebdriverHttpServer".to_owned(), move || {
let address = SocketAddrV4::new("0.0.0.0".parse().unwrap(), port);
server::start(SocketAddr::V4(address), handler,
extension_routes());
match server::start(SocketAddr::V4(address), handler, extension_routes()) {
Ok(listening) => info!("WebDriver server listening on {}", listening.socket),
Err(_) => panic!("Unable to start WebDriver HTTPD server"),
}
});
}

Expand Down Expand Up @@ -847,18 +847,18 @@ impl Handler {
impl WebDriverHandler<ServoExtensionRoute> for Handler {
fn handle_command(&mut self,
_session: &Option<Session>,
msg: &WebDriverMessage<ServoExtensionRoute>) -> WebDriverResult<WebDriverResponse> {
msg: WebDriverMessage<ServoExtensionRoute>) -> WebDriverResult<WebDriverResponse> {
// Unless we are trying to create a new session, we need to ensure that a
// session has previously been created
match msg.command {
WebDriverCommand::NewSession => {},
WebDriverCommand::NewSession(_) => {},
_ => {
try!(self.session());
}
}

match msg.command {
WebDriverCommand::NewSession => self.handle_new_session(),
WebDriverCommand::NewSession(_) => self.handle_new_session(),
WebDriverCommand::DeleteSession => self.handle_delete_session(),
WebDriverCommand::AddCookie(ref parameters) => self.handle_add_cookie(parameters),
WebDriverCommand::Get(ref parameters) => self.handle_get(parameters),
Expand Down
8 changes: 5 additions & 3 deletions ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b0a199

Please sign in to comment.