Skip to content

Commit

Permalink
Don't wait for x-www-browser to exit before returning
Browse files Browse the repository at this point in the history
(Temporary solution to resolve by far the most likely place for this
command to block in headless test conditions.)
  • Loading branch information
Stephan Sokolow authored and amodm committed Oct 28, 2019
1 parent d7ae427 commit dd2a0bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<ExitStatus> {
.or_else(|_| -> Result<ExitStatus> {
Command::new("kioclient").arg("exec").arg(url).status()
})
.or_else(|_| -> Result<ExitStatus> { Command::new("x-www-browser").arg(url).status() }),
.or_else(|e| -> Result<ExitStatus> {
if let Ok(_child) = Command::new("x-www-browser").arg(url).spawn() {
return Ok(ExitStatusExt::from_raw(0));
}
Err(e)
}),
_ => Err(Error::new(
ErrorKind::NotFound,
"Only the default browser is supported on this platform right now",
Expand Down

0 comments on commit dd2a0bb

Please sign in to comment.