Skip to content

Commit

Permalink
Support taking screenshots when a webdriver server is active.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Oct 18, 2016
1 parent 0af9be9 commit e19268c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions components/compositing/compositor.rs
Expand Up @@ -715,6 +715,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {

(Msg::CreatePng(reply), ShutdownState::NotShuttingDown) => {
let res = self.composite_specific_target(CompositeTarget::WindowAndPng);
if let Err(ref e) = res {
info!("Error retrieving PNG: {:?}", e);
}
let img = res.unwrap_or(None);
if let Err(e) = reply.send(img) {
warn!("Sending reply to create png failed ({}).", e);
Expand Down
4 changes: 3 additions & 1 deletion components/script/dom/window.rs
Expand Up @@ -1124,7 +1124,9 @@ impl Window {
// When all these conditions are met, notify the constellation
// that this pipeline is ready to write the image (from the script thread
// perspective at least).
if (opts::get().output_file.is_some() || opts::get().exit_after_load) && for_display {
if (opts::get().output_file.is_some() ||
opts::get().exit_after_load ||
opts::get().webdriver_port.is_some()) && for_display {
let document = self.Document();

// Checks if the html element has reftest-wait attribute present.
Expand Down
2 changes: 1 addition & 1 deletion components/webdriver_server/lib.rs
Expand Up @@ -772,7 +772,7 @@ impl Handler {
let mut img = None;
let pipeline_id = try!(self.root_pipeline());

let interval = 20;
let interval = 1000;
let iterations = 30_000 / interval;

for _ in 0..iterations {
Expand Down

0 comments on commit e19268c

Please sign in to comment.