Bug 1462040 - Force geckodriver to always use IPv4 to connect to Marionette.
Marionette uses nsIServerSocket which only allows to create a IPv4
listener. On systems where IPv6 has precedence geckodriver will
automatically use the IPv6 address for `localhost` and will fail
to connect to Marionette. As such we should force geckodriver to
connect to "127.0.0.1".
MozReview-Commit-ID: Dg1n6yYIi2N
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -49,17 +49,19 @@ use webdriver::common::{Date, ELEMENT_KE
use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
use webdriver::server::{WebDriverHandler, Session};
use webdriver::httpapi::{WebDriverExtensionRoute};
use capabilities::{FirefoxCapabilities, FirefoxOptions};
use logging;
use prefs;
-const DEFAULT_HOST: &'static str = "localhost";
+// Bind host to IPv4 only because Marionette only listens on that interface
+const DEFAULT_HOST: &'static str = "127.0.0.1";
+
const CHROME_ELEMENT_KEY: &'static str = "chromeelement-9fc5-4b51-a3c8-01716eedeb04";
const LEGACY_ELEMENT_KEY: &'static str = "ELEMENT";
pub fn extension_routes() -> Vec<(Method, &'static str, GeckoExtensionRoute)> {
return vec![(Method::Get, "/session/{sessionId}/moz/context", GeckoExtensionRoute::GetContext),
(Method::Post, "/session/{sessionId}/moz/context", GeckoExtensionRoute::SetContext),
(Method::Post,
"/session/{sessionId}/moz/xbl/{elementId}/anonymous_children",