Implement timeout for url load from WebDriver.

This commit is contained in:
James Graham 2015-06-17 00:25:23 +01:00
parent ee22ae2635
commit 22c06307b8
4 changed files with 23 additions and 11 deletions

View file

@ -19,7 +19,7 @@ use std::collections::HashMap;
use std::sync::mpsc::{channel, Sender, Receiver};
use style::viewport::ViewportConstraints;
use url::Url;
use webdriver_msg::{WebDriverScriptCommand, LoadComplete};
use webdriver_msg::{WebDriverScriptCommand, LoadStatus};
#[derive(Clone)]
pub struct ConstellationChan(pub Sender<Msg>);
@ -328,7 +328,7 @@ impl MozBrowserEvent {
}
pub enum WebDriverCommandMsg {
LoadUrl(PipelineId, LoadData, Sender<LoadComplete>),
LoadUrl(PipelineId, LoadData, Sender<LoadStatus>),
ScriptCommand(PipelineId, WebDriverScriptCommand),
TakeScreenshot(PipelineId, Sender<Option<png::Image>>)
}

View file

@ -53,4 +53,7 @@ impl ToJson for WebDriverJSValue {
}
}
pub struct LoadComplete;
pub enum LoadStatus {
LoadComplete,
LoadTimeout
}