Add enough Webdriver support to enable Get().

This is incomplete in several ways:

* It assumes that there's only one constellation (i.e. top level browsing context), ever.
* The session support is very basic indeed (no capabilities)
* Passing channels over channels may not sit well with IPC
* The error handling is mostly missing
This commit is contained in:
James Graham 2015-04-03 23:23:52 +01:00
parent 7fddf4aa13
commit 009e2baaf0
10 changed files with 164 additions and 18 deletions

View file

@ -109,6 +109,7 @@ dependencies = [
"time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"webdriver_server 0.0.1",
]
[[package]]
@ -932,6 +933,7 @@ dependencies = [
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"hyper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net 0.0.1",
"net_traits 0.0.1",
"profile 0.0.1",
@ -1003,7 +1005,7 @@ dependencies = [
[[package]]
name = "webdriver"
version = "0.0.1"
source = "git+https://github.com/jgraham/webdriver-rust.git#906806d51783b5caad89432bf8ce008f2f4968fc"
source = "git+https://github.com/jgraham/webdriver-rust.git#4f543416a269b9d0d7ee5332db489768c2a769dd"
dependencies = [
"hyper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1016,6 +1018,11 @@ dependencies = [
name = "webdriver_server"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"uuid 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver 0.0.1 (git+https://github.com/jgraham/webdriver-rust.git)",
]

View file

@ -104,10 +104,6 @@ impl Browser {
devtools::start_server(port)
});
if let Some(port) = opts.webdriver_port {
webdriver_server::start_server(port);
}
// Create the constellation, which maintains the engine
// pipelines, including the script and layout threads, as well
// as the navigation context.
@ -118,6 +114,10 @@ impl Browser {
mem_profiler_chan.clone(),
shared_task_pool);
if let Some(port) = opts.webdriver_port {
webdriver_server::start_server(port, constellation_chan.clone());
};
// The compositor coordinates with the client window to create the final
// rendered page and display it somewhere.
let compositor = CompositorTask::create(window,