mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make WebDriver Get() command wait on pages loading before returning.
This makes using WebDriver significantly less racy. Also refactors the message structure a little
This commit is contained in:
parent
7e022b25a8
commit
28ac0abf6a
7 changed files with 87 additions and 39 deletions
|
@ -18,7 +18,7 @@ use util::geometry::{PagePx, ViewportPx};
|
|||
use std::collections::HashMap;
|
||||
use std::sync::mpsc::{channel, Sender, Receiver};
|
||||
use style::viewport::ViewportConstraints;
|
||||
use webdriver_traits::WebDriverScriptCommand;
|
||||
use webdriver_traits::{WebDriverScriptCommand, LoadComplete};
|
||||
use url::Url;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
@ -237,11 +237,9 @@ pub enum Msg {
|
|||
/// Requests that the constellation retrieve the current contents of the clipboard
|
||||
GetClipboardContents(Sender<String>),
|
||||
/// Dispatch a webdriver command
|
||||
WebDriverCommand(PipelineId, WebDriverScriptCommand),
|
||||
WebDriverCommand(WebDriverCommandMsg),
|
||||
/// Notifies the constellation that the viewport has been constrained in some manner
|
||||
ViewportConstrained(PipelineId, ViewportConstraints),
|
||||
/// Create a PNG of the window contents
|
||||
CompositePng(Sender<Option<png::Image>>),
|
||||
/// Query the constellation to see if the current compositor output is stable
|
||||
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
||||
/// Notification that this iframe should be removed.
|
||||
|
@ -319,6 +317,11 @@ impl MozBrowserEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub enum WebDriverCommandMsg {
|
||||
LoadUrl(PipelineId, LoadData, Sender<LoadComplete>),
|
||||
ScriptCommand(PipelineId, WebDriverScriptCommand),
|
||||
TakeScreenshot(Sender<Option<png::Image>>)
|
||||
}
|
||||
|
||||
/// Similar to net::resource_task::LoadData
|
||||
/// can be passed to LoadUrl to load a page with GET/POST
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue