From 8ef8af034f75e9aa27bdcf746622ecdd4e4668ff Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Wed, 12 Apr 2017 14:22:09 +0100 Subject: [PATCH] marionette: append X11 style -marionette flag when starting browser https://github.com/jgraham/rust_mozrunner/pull/7 was recently submitted to make mozrunner not imply starting the Marionette server by passing the --marionette flag. This patch appends -marionette, with a single dash, so that it will be accepted on Windows systems. More discussion around this in https://github.com/mozilla/geckodriver/commit/2e0054b90ecf1acbe8b442af54441e3cc746933f. Fixes: https://github.com/mozilla/geckodriver/issues/640 --- src/marionette.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/marionette.rs b/src/marionette.rs index a0b904ce..b9aef246 100644 --- a/src/marionette.rs +++ b/src/marionette.rs @@ -314,6 +314,10 @@ impl MarionetteHandler { let mut runner = try!(FirefoxRunner::new(&binary, options.profile.take()) .map_err(|e| WebDriverError::new(ErrorStatus::SessionNotCreated, e.description().to_owned()))); + + // double-dashed flags are not accepted on Windows systems + runner.args().push("-marionette"); + if let Some(args) = options.args.take() { runner.args().extend(args); };