diff --git a/src/components/gfx/opts.rs b/src/components/gfx/opts.rs index 8ed3e9aa50e..ca9c9cc815b 100644 --- a/src/components/gfx/opts.rs +++ b/src/components/gfx/opts.rs @@ -39,6 +39,7 @@ pub struct Opts { output_file: Option<~str>, headless: bool, + hard_fail: bool, } fn print_usage(app: &str, opts: &[groups::OptGroup]) { @@ -59,6 +60,7 @@ pub fn from_cmdline_args(args: &[~str]) -> Opts { groups::optflagopt("p", "profile", "Profiler flag and output interval", "10"), groups::optflag("x", "exit", "Exit after load flag"), groups::optflag("z", "headless", "Headless mode"), + groups::optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure"), groups::optflag("h", "help", "Print this message") ]; @@ -127,5 +129,6 @@ pub fn from_cmdline_args(args: &[~str]) -> Opts { exit_after_load: opt_match.opt_present("x"), output_file: opt_match.opt_str("o"), headless: opt_match.opt_present("z"), + hard_fail: opt_match.opt_present("f"), } } diff --git a/src/components/main/pipeline.rs b/src/components/main/pipeline.rs index 7b619de378a..77ac8741787 100644 --- a/src/components/main/pipeline.rs +++ b/src/components/main/pipeline.rs @@ -100,6 +100,7 @@ impl Pipeline { // Wrap task creation within a supervised task so that failure will // only tear down those tasks instead of ours. + let hard_fail = opts.hard_fail; let failure_chan = constellation_chan.clone(); let mut supervised_task = task::task(); let task_port = supervised_task.future_result(); @@ -139,6 +140,9 @@ impl Pipeline { match task_port.recv() { Ok(*) => (), Err(*) => { + if hard_fail { + fail!("Pipeline failed in hard-fail mode"); + } failure_chan.send(FailureMsg(id, subpage_id)); } } diff --git a/src/test/harness/contenttest/contenttest.rs b/src/test/harness/contenttest/contenttest.rs index 562ff62589b..bee7e175f4f 100644 --- a/src/test/harness/contenttest/contenttest.rs +++ b/src/test/harness/contenttest/contenttest.rs @@ -93,7 +93,7 @@ fn run_test(file: ~str) { let config = ProcessConfig { program: "./servo", - args: [~"-z", infile.clone()], + args: [~"-z", ~"-f", infile.clone()], env: None, cwd: None, io: [Ignored, stdout, stderr]