Bug 1149137 - Make Loop's Marionette unit tests run in e10s mode. r=mikedeboer, a=test-only
authorMark Banner <standard8@mozilla.com>
Mon, 30 Mar 2015 17:02:27 +0100
changeset 266803 7fc36f96d989a6d28298ee24d3bc03d252c0cb22
parent 266802 1f5e12301c9808c5da180426dd5f18127a33410a
child 266804 88f03622f0584b512974a8a35fafb3fa9e565082
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, test-only
Bug 1149137 - Make Loop's Marionette unit tests run in e10s mode. r=mikedeboer, a=test-only
--- a/browser/components/loop/test/shared/frontend_tester.py
+++ b/browser/components/loop/test/shared/frontend_tester.py
@@ -6,17 +6,16 @@ import SocketServer
 import BaseHTTPServer
 import socket
 import urllib
 import urlparse
 import os
 DEBUG = False
 # XXX Once we're on a branch with bug 993478 landed, we may want to get
 # rid of this HTTP server and just use the built-in one from Marionette,
 # since there will less code to maintain, and it will be faster.  We'll
 # need to consider whether this code wants to be shared with WebDriver tests
 # for other browsers, though.
 class ThreadingSimpleServer(SocketServer.ThreadingMixIn,
@@ -56,16 +55,26 @@ class BaseTestFrontendUnits(MarionetteTe
         # test class.  Even though this is class-static, each subclass gets
         # its own instance of this stuff.
         cls.server_thread = None
         cls.server = None
     def setUp(self):
         super(BaseTestFrontendUnits, self).setUp()
+        # Unfortunately, enforcing preferences currently comes with the side
+        # effect of launching and restarting the browser before running the
+        # real functional tests.  Bug 1048554 has been filed to track this.
+        #
+        # Note: when e10s is enabled by default, this pref can go away. The automatic
+        # restart will also go away if this is still the only pref set here.
+        self.marionette.enforce_gecko_prefs({
+            "browser.tabs.remote.autostart": True
+        })
         # This extends the timeout for find_element. We need this as the tests
         # take an amount of time to run after loading, which we have to wait for.
     # srcdir_path should be the directory relative to this file.
     def set_server_prefix(self, srcdir_path):
         # We may be run from a different path than topsrcdir, e.g. in the case
         # of packaged tests. If so, then we have to work out the right directory