Use event polling instead of blocking when outputting to a file.

This stops some ref tests on linux blocking while waiting for
user input events and never outputting the file.

Also mark vertical writing test as flaky on all platforms. Due
to unrelated timing reasons, this fails reliably on mac when glutin
is enabled. The related bug with details on the root cause is #3926.
This commit is contained in:
Glenn Watson 2014-12-23 08:32:53 +10:00
parent 20b961493a
commit 2accabd554
2 changed files with 19 additions and 5 deletions

View file

@ -27,6 +27,7 @@ use std::num::Float;
use std::rc::Rc;
use time::{mod, Timespec};
use util::geometry::ScreenPx;
use util::opts;
use util::opts::{RenderApi, Mesa, OpenGL};
use gleam::gl;
use glutin;
@ -521,10 +522,23 @@ impl Window {
match self.glutin {
WindowHandle::Windowed(ref window) => {
let mut close_event = false;
for event in window.wait_events() {
close_event = self.handle_window_event(event);
if close_event {
break;
// When writing to a file then exiting, use event
// polling so that we don't block on a GUI event
// such as mouse click.
if opts::get().output_file.is_some() {
for event in window.poll_events() {
close_event = self.handle_window_event(event);
if close_event {
break;
}
}
} else {
for event in window.wait_events() {
close_event = self.handle_window_event(event);
if close_event {
break;
}
}
}

View file

@ -95,7 +95,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html
== overflow_simple_a.html overflow_simple_b.html
== noscript.html noscript_ref.html
== pseudo_inherit.html pseudo_inherit_ref.html
flaky_linux,experimental == vertical-lr-blocks.html vertical-lr-blocks_ref.html
flaky_cpu,experimental == vertical-lr-blocks.html vertical-lr-blocks_ref.html
== float_intrinsic_height.html float_intrinsic_height_ref.html
== table_auto_width.html table_auto_width_ref.html
== inline_whitespace_b.html inline_whitespace_ref.html