mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Support taking screenshots when a webdriver server is active.
This commit is contained in:
parent
0af9be9429
commit
e19268c04e
3 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue