Improve the stability of tests run using WebDriver.

* Wait for the correct pipeline to return a LoadComplete message
  before signalling a load is complete, and ensure that the root
  pipeline is the one corresponding to the active document of the top
  level browsing context, even if this has not yet painted.

* Ensure that TakeScreenshot operates on the correct pipeline

* Reset the screenshot ready flag whenever we decide that we are ready
  to take a screenshot.
This commit is contained in:
James Graham 2015-05-22 15:58:48 +01:00
parent ec79881471
commit aa0f7a7a12
4 changed files with 42 additions and 12 deletions

View file

@ -420,6 +420,7 @@ impl Handler {
fn handle_take_screenshot(&self) -> WebDriverResult<WebDriverResponse> {
let mut img = None;
let pipeline_id = try!(self.get_root_pipeline());
let interval = 20;
let iterations = 30_000 / interval;
@ -427,7 +428,7 @@ impl Handler {
for _ in 0..iterations {
let (sender, reciever) = channel();
let ConstellationChan(ref const_chan) = self.constellation_chan;
let cmd_msg = WebDriverCommandMsg::TakeScreenshot(sender);
let cmd_msg = WebDriverCommandMsg::TakeScreenshot(pipeline_id, sender);
const_chan.send(ConstellationMsg::WebDriverCommand(cmd_msg)).unwrap();
if let Some(x) = reciever.recv().unwrap() {