geckodriver: marionette: append X11 style -marionette flag when starting browser
authorAndreas Tolfsen <ato@mozilla.com>
Wed, 12 Apr 2017 14:51:16 +0100
changeset 581790 0663affcced9ec002c219ec077d62817c6a4ae9a
parent 581789 44089bdc00398d1ab45759c955b346242a0201a3
child 581791 d62542532dc1b6a196b6f24a821e1fa08de6fe27
push id59896
push userhikezoe@mozilla.com
push dateFri, 19 May 2017 23:30:01 +0000
milestone55.0a1
geckodriver: 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 Source-Repo: https://github.com/mozilla/geckodriver Source-Revision: 7c577c04176c1cc7b5bd45928b3a36bd1818c5ae committer: jgraham <james@hoppipolla.co.uk>
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -309,16 +309,20 @@ impl MarionetteHandler {
                                         'moz:firefoxOptions.binary' capability provided, and \
                                         no binary flag set on the command line")));
 
         let custom_profile = options.profile.is_some();
 
         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);
         };
 
         try!(self.set_prefs(port, &mut runner.profile, custom_profile, options.prefs)
             .map_err(|e| {
                 WebDriverError::new(ErrorStatus::SessionNotCreated,
                                     format!("Failed to set preferences: {}", e))