Backed out 4 changesets (bug 1451159) for linux build bustages CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Fri, 04 May 2018 00:25:56 +0300
changeset 472918 baf0ff2fb10ea14a68e12b9a1f8f73cb4ea7fa1f
parent 472917 b5aa7e44cdb460a70876f8f964fe2981d7a3a419
child 472919 c470f035fe635060d93fd483d553eee462fed99b
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1451159
milestone61.0a1
backs out72926ae685af24250b0b65fdfac4e3cace9f2a90
f90a996823820e36e1ba66a48afb5c5c5db1e88d
3914937893dee9b5370128bddfa41d4f3627d8db
79931e4a2bfb5e81ec7c5e89c5aaeddc732b6e33
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1451159) for linux build bustages CLOSED TREE Backed out changeset 72926ae685af (bug 1451159) Backed out changeset f90a99682382 (bug 1451159) Backed out changeset 3914937893de (bug 1451159) Backed out changeset 79931e4a2bfb (bug 1451159)
CLOBBER
browser/base/content/test/general/browser_audioTabIcon.js
browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser_policy_disable_fxscreenshots.js
browser/extensions/pocket/test/head.js
build/automation.py.in
build/pgo/profileserver.py
build/valgrind/mach_commands.py
taskcluster/ci/source-test/python.yml
testing/mochitest/runjunit.py
testing/mochitest/runtests.py
testing/mochitest/tests/python/python.ini
testing/mochitest/tests/python/test_build_profile.py
testing/mozbase/mozprofile/mozprofile/profile.py
testing/mozbase/mozprofile/tests/files/dummy-profile/.eslintrc.js
testing/mozbase/mozprofile/tests/files/dummy-profile/Preferences
testing/mozbase/mozprofile/tests/files/dummy-profile/extensions/empty.xpi
testing/mozbase/mozprofile/tests/files/dummy-profile/prefs.js
testing/mozbase/mozprofile/tests/files/dummy-profile/user.js
testing/mozbase/mozprofile/tests/test_profile.py
testing/profiles/common/extensions/README.txt
testing/profiles/common/user.js
testing/profiles/moz.build
testing/profiles/prefs_general.js
testing/testsuite-targets.mk
testing/web-platform/tests/tools/wpt/browser.py
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1451159 - Moved testing/profiles/prefs_general.js (prevents symlinked file does not exist)
+Bug 1453317 - Update VS2017 used for builds in automation to version 15.6.6.
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -71,19 +71,18 @@ async function pause(tab, options) {
       await awaitDOMAudioPlaybackStopped;
       ok(tab.hasAttribute("soundplaying"), "The tab should still have the soundplaying attribute immediately after DOMAudioPlaybackStopped");
     }
 
     await wait_for_tab_playing_event(tab, false);
     ok(!tab.hasAttribute("soundplaying"), "The tab should not have the soundplaying attribute after the timeout has resolved");
   } finally {
     // Make sure other tests don't timeout if an exception gets thrown above.
-    // Need to use setIntPref instead of clearUserPref because
-    // testing/profiles/common/user.js overrides the default value to help this and
-    // other tests run faster.
+    // Need to use setIntPref instead of clearUserPref because prefs_general.js
+    // overrides the default value to help this and other tests run faster.
     Services.prefs.setIntPref(TABATTR_REMOVAL_PREFNAME, INITIAL_TABATTR_REMOVAL_DELAY_MS);
   }
 }
 
 async function hide_tab(tab) {
   let tabHidden = BrowserTestUtils.waitForEvent(tab, "TabHide");
   gBrowser.hideTab(tab);
   return tabHidden;
--- a/browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser_policy_disable_fxscreenshots.js
+++ b/browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser_policy_disable_fxscreenshots.js
@@ -11,19 +11,19 @@ async function checkScreenshots(shouldBe
   }, "Expecting screenshots to be " + shouldBeEnabled);
 }
 
 add_task(async function test_disable_firefox_screenshots() {
   // Dynamically toggling the PREF_DISABLE_FX_SCREENSHOTS is very finicky, because
   // that pref is being watched, and it makes the Firefox Screenshots system add-on
   // to start or stop, causing intermittency.
   //
-  // Firefox Screenshots is disabled by default on tests (in
-  // testing/profiles/common/user.js). What we do here to test this policy is to enable
-  // it on this specific test folder (through browser.ini) and then we let the policy
-  // engine be responsible for disabling Firefox Screenshots in this case.
+  // Firefox Screenshots is disabled by default on tests (in prefs_general.js).
+  // What we do here to test this policy is to enable it on this specific
+  // test folder (through browser.ini) and then we let the policy engine
+  // be responsible for disabling Firefox Screenshots in this case.
 
   is(Services.prefs.getBoolPref(PREF_DISABLE_FX_SCREENSHOTS), true, "Screenshots pref is disabled");
 
   await BrowserTestUtils.withNewTab("data:text/html,Test", async function() {
     await checkScreenshots(false);
   });
 });
--- a/browser/extensions/pocket/test/head.js
+++ b/browser/extensions/pocket/test/head.js
@@ -21,17 +21,17 @@ function promisePocketEnabled() {
 
 function promisePocketDisabled() {
   if (Services.prefs.getPrefType("extensions.pocket.enabled") == Services.prefs.PREF_INVALID ||
       !Services.prefs.getBoolPref("extensions.pocket.enabled")) {
     info("pocket-button already disabled");
     return Promise.resolve(true);
   }
   info("reset pocket enabled pref");
-  // testing/profiles/common/user.js uses user_pref to disable pocket, set
+  // testing/profiles/prefs_general.js uses user_pref to disable pocket, set
   // back to false.
   Services.prefs.setBoolPref("extensions.pocket.enabled", false);
   return BrowserTestUtils.waitForCondition(() => {
     return !PageActions.actionForID("pocket");
   }).then(() => {
     // wait for a full unload of pocket
     return BrowserTestUtils.waitForCondition(() => {
       return !window.hasOwnProperty("pktUI");
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -30,16 +30,18 @@ if os.path.isdir(mozbase):
             sys.path.append(package_path)
 
 import mozcrash
 from mozscreenshot import printstatus, dump_screen
 
 
 # ---------------------------------------------------------------
 
+_DEFAULT_PREFERENCE_FILE = os.path.join(SCRIPT_DIR, 'prefs_general.js')
+
 _DEFAULT_WEB_SERVER = "127.0.0.1"
 _DEFAULT_HTTP_PORT = 8888
 _DEFAULT_SSL_PORT = 4443
 _DEFAULT_WEBSOCKET_PORT = 9988
 
 #expand _DIST_BIN = __XPC_BIN_PATH__
 #expand _IS_WIN32 = len("__WIN32__") != 0
 #expand _IS_MAC = __IS_MAC__ != 0
--- a/build/pgo/profileserver.py
+++ b/build/pgo/profileserver.py
@@ -39,27 +39,27 @@ if __name__ == '__main__':
     locations = ServerLocations()
     locations.add_host(host='127.0.0.1',
                        port=PORT,
                        options='primary,privileged')
 
     with TemporaryDirectory() as profilePath:
         # TODO: refactor this into mozprofile
         prefpath = os.path.join(
-            build.topsrcdir, "testing", "profiles", "common", "user.js")
+            build.topsrcdir, "testing", "profiles", "prefs_general.js")
         overridepath = os.path.join(
             build.topsrcdir, "build", "pgo", "prefs_override.js")
 
         prefs = {}
         prefs.update(Preferences.read_prefs(prefpath))
         prefs.update(Preferences.read_prefs(overridepath))
 
         interpolation = {"server": "%s:%d" % httpd.httpd.server_address,
                          "OOP": "false"}
-        prefs = json.loads(json.dumps(prefs).format(**interpolation))
+        prefs = json.loads(json.dumps(prefs) % interpolation)
         for pref in prefs:
             prefs[pref] = Preferences.cast(prefs[pref])
 
         profile = FirefoxProfile(profile=profilePath,
                                  preferences=prefs,
                                  addons=[os.path.join(
                                      build.topsrcdir, 'tools', 'quitter', 'quitter@mozilla.org.xpi')],
                                  locations=locations)
--- a/build/valgrind/mach_commands.py
+++ b/build/valgrind/mach_commands.py
@@ -60,22 +60,22 @@ class MachCommands(MachCommandBase):
 
         # XXX: currently we just use the PGO inputs for Valgrind runs.  This may
         # change in the future.
         httpd = MozHttpd(docroot=os.path.join(build_dir, 'pgo'))
         httpd.start(block=False)
 
         with TemporaryDirectory() as profilePath:
             #TODO: refactor this into mozprofile
-            prefpath = os.path.join(self.topsrcdir, 'testing', 'profiles', 'common', 'user.js')
+            prefpath = os.path.join(self.topsrcdir, 'testing', 'profiles', 'prefs_general.js')
             prefs = {}
             prefs.update(Preferences.read_prefs(prefpath))
             interpolation = { 'server': '%s:%d' % httpd.httpd.server_address,
                               'OOP': 'false'}
-            prefs = json.loads(json.dumps(prefs).format(**interpolation))
+            prefs = json.loads(json.dumps(prefs) % interpolation)
             for pref in prefs:
                 prefs[pref] = Preferences.cast(prefs[pref])
 
             quitter = os.path.join(self.topsrcdir, 'tools', 'quitter', 'quitter@mozilla.org.xpi')
 
             locations = ServerLocations()
             locations.add_host(host='127.0.0.1',
                                port=httpd.httpd.server_port,
--- a/taskcluster/ci/source-test/python.yml
+++ b/taskcluster/ci/source-test/python.yml
@@ -67,17 +67,17 @@ mochitest-harness:
             ./mach python-test --subsuite mochitest
     when:
         files-changed:
             - 'testing/mochitest/**'
             - 'testing/mozbase/moztest/moztest/selftest/**'
             - 'testing/mozharness/mozharness/base/log.py'
             - 'testing/mozharness/mozharness/mozilla/structuredlog.py'
             - 'testing/mozharness/mozharness/mozilla/testing/errors.py'
-            - 'testing/profiles/**'
+            - 'testing/profiles/prefs_general.js'
 
 mozbase:
     description: testing/mozbase unit tests
     treeherder:
         symbol: py(mb)
     run:
         mach: python-test --subsuite mozbase
     when:
--- a/testing/mochitest/runjunit.py
+++ b/testing/mochitest/runjunit.py
@@ -1,27 +1,28 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import argparse
+import json
 import os
 import posixpath
 import re
 import shutil
 import sys
 import tempfile
 import traceback
 
 import mozcrash
 import mozinfo
 import mozlog
 import moznetwork
 from mozdevice import ADBAndroid
-from mozprofile import Profile, DEFAULT_PORTS
+from mozprofile import Profile, Preferences, DEFAULT_PORTS
 from mozprofile.permissions import ServerLocations
 from runtests import MochitestDesktop, update_mozinfo
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 try:
     from mozbuild.base import (
         MozbuildObject,
@@ -93,23 +94,43 @@ class JUnitTestRunner(MochitestDesktop):
             self.options.certPath = os.path.join(build_obj.topsrcdir,
                                                  'build', 'pgo', 'certs')
 
     def build_profile(self):
         """
            Create a local profile with test prefs and proxy definitions and
            push it to the remote device.
         """
+        preferences = [
+            os.path.join(
+                here,
+                'profile_data',
+                'prefs_general.js')]
 
-        self.profile = Profile(locations=self.locations, proxy=self.proxy(self.options))
-        self.options.profilePath = self.profile.profile
+        prefs = {}
+        for path in preferences:
+            prefs.update(Preferences.read_prefs(path))
+
+        interpolation = {
+            "server": "%s:%s" %
+            (self.options.webServer, self.options.httpPort)}
 
-        # Set preferences
-        self.merge_base_profiles(self.options)
-        self.profile.set_preferences(self.extraPrefs(self.options.extraPrefs))
+        prefs = json.loads(json.dumps(prefs) % interpolation)
+        for pref in prefs:
+            prefs[pref] = Preferences.cast(prefs[pref])
+
+        proxy = {'remote': self.options.webServer,
+                 'http': self.options.httpPort,
+                 'https': self.options.sslPort,
+                 'ws': self.options.sslPort
+                 }
+
+        self.profile = Profile(locations=self.locations, preferences=prefs,
+                               proxy=proxy)
+        self.options.profilePath = self.profile.profile
 
         if self.fillCertificateDB(self.options):
             self.log.error("Certificate integration failed")
 
         self.device.mkdir(self.remote_profile, parents=True)
         self.device.push(self.profile.profile, self.remote_profile)
         self.log.debug("profile %s -> %s" %
                        (str(self.profile.profile), str(self.remote_profile)))
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -846,17 +846,16 @@ class MochitestDesktop(object):
     CHROME_PATH = "redirect.html"
 
     certdbNew = False
     sslTunnel = None
     DEFAULT_TIMEOUT = 60.0
     mediaDevices = None
 
     patternFiles = {}
-    base_profiles = ('common',)
 
     # XXX use automation.py for test name to avoid breaking legacy
     # TODO: replace this with 'runtests.py' or 'mochitest' or the like
     test_name = 'automation.py'
 
     def __init__(self, flavor, logger_options, quiet=False):
         update_mozinfo()
         self.flavor = flavor
@@ -905,30 +904,25 @@ class MochitestDesktop(object):
         self.result = {}
 
         self.start_script = os.path.join(here, 'start_desktop.js')
 
     def environment(self, **kwargs):
         kwargs['log'] = self.log
         return test_environment(**kwargs)
 
-    def extraPrefs(self, prefs):
-        """Interpolate extra preferences from option strings"""
+    def extraPrefs(self, extraPrefs):
+        """interpolate extra preferences from option strings"""
 
         try:
-            prefs = dict(parseKeyValue(prefs, context='--setpref='))
+            return dict(parseKeyValue(extraPrefs, context='--setpref='))
         except KeyValueParseError as e:
             print(str(e))
             sys.exit(1)
 
-        for pref, value in prefs.items():
-            value = Preferences.cast(value)
-            prefs[pref] = value
-        return prefs
-
     def getFullPath(self, path):
         " Get an absolute path relative to self.oldcwd."
         return os.path.normpath(
             os.path.join(
                 self.oldcwd,
                 os.path.expanduser(path)))
 
     def getLogFilePath(self, logFile):
@@ -1820,128 +1814,132 @@ toolbar#nav-bar {
             elif ext == ".client":
                 call([pk12util, "-i", os.path.join(options.certPath, item),
                       "-w", pwfilePath, "-d", certdbPath],
                      env=toolsEnv)
 
         os.unlink(pwfilePath)
         return 0
 
-    def proxy(self, options):
-        # proxy
-        # use SSL port for legacy compatibility; see
-        # - https://bugzilla.mozilla.org/show_bug.cgi?id=688667#c66
-        # - https://bugzilla.mozilla.org/show_bug.cgi?id=899221
-        # - https://github.com/mozilla/mozbase/commit/43f9510e3d58bfed32790c82a57edac5f928474d
-        #             'ws': str(self.webSocketPort)
-        return {
-            'remote': options.webServer,
-            'http': options.httpPort,
-            'https': options.sslPort,
-            'ws': options.sslPort,
-        }
-
-    def merge_base_profiles(self, options):
-        """Merge extra profile data from testing/profiles."""
-        profile_data_dir = os.path.join(SCRIPT_DIR, 'profile_data')
-
-        # If possible, read profile data from topsrcdir. This prevents us from
-        # requiring a re-build to pick up newly added extensions in the
-        # <profile>/extensions directory.
-        if build_obj:
-            path = os.path.join(build_obj.topsrcdir, 'testing', 'profiles')
-            if os.path.isdir(path):
-                profile_data_dir = path
-
-        # values to use when interpolating preferences
-        interpolation = {
-            "server": "%s:%s" % (options.webServer, options.httpPort),
-        }
-
-        for profile in self.base_profiles:
-            path = os.path.join(profile_data_dir, profile)
-            self.profile.merge(path, interpolation=interpolation)
-
     def buildProfile(self, options):
         """ create the profile and add optional chrome bits and files if requested """
+        if options.flavor == 'browser' and options.timeout:
+            options.extraPrefs.append(
+                "testing.browserTestHarness.timeout=%d" %
+                options.timeout)
+        # browser-chrome tests use a fairly short default timeout of 45 seconds;
+        # this is sometimes too short on asan and debug, where we expect reduced
+        # performance.
+        if (mozinfo.info["asan"] or mozinfo.info["debug"]) and \
+                options.flavor == 'browser' and options.timeout is None:
+            self.log.info("Increasing default timeout to 90 seconds")
+            options.extraPrefs.append("testing.browserTestHarness.timeout=90")
+
+        options.extraPrefs.append(
+            "browser.tabs.remote.autostart=%s" %
+            ('true' if options.e10s else 'false'))
+
+        options.extraPrefs.append(
+            "dom.ipc.tabs.nested.enabled=%s" %
+            ('true' if options.nested_oop else 'false'))
+
+        options.extraPrefs.append(
+            "idle.lastDailyNotification=%d" %
+            int(time.time()))
+
+        # Enable tracing output for detailed failures in case of
+        # failing connection attempts, and hangs (bug 1397201)
+        options.extraPrefs.append("marionette.log.level=%s" % "TRACE")
+
+        if getattr(self, 'testRootAbs', None):
+            options.extraPrefs.append(
+                "mochitest.testRoot=%s" %
+                self.testRootAbs)
+
         # get extensions to install
         extensions = self.getExtensionsToInstall(options)
 
+        # preferences
+        preferences = [
+            os.path.join(
+                SCRIPT_DIR,
+                'profile_data',
+                'prefs_general.js')]
+
+        prefs = {}
+        for path in preferences:
+            prefs.update(Preferences.read_prefs(path))
+
+        prefs.update(self.extraPrefs(options.extraPrefs))
+
+        # Bug 1262954: For windows XP + e10s disable acceleration
+        if platform.system() in ("Windows", "Microsoft") and \
+           '5.1' in platform.version() and options.e10s:
+            prefs['layers.acceleration.disabled'] = True
+
         # Whitelist the _tests directory (../..) so that TESTING_JS_MODULES work
         tests_dir = os.path.dirname(os.path.dirname(SCRIPT_DIR))
         sandbox_whitelist_paths = [tests_dir] + options.sandboxReadWhitelist
         if (platform.system() == "Linux" or
             platform.system() in ("Windows", "Microsoft")):
             # Trailing slashes are needed to indicate directories on Linux and Windows
             sandbox_whitelist_paths = map(lambda p: os.path.join(p, ""),
                                           sandbox_whitelist_paths)
 
-        # Create the profile
+        # interpolate preferences
+        interpolation = {
+            "server": "%s:%s" %
+            (options.webServer, options.httpPort)}
+
+        prefs = json.loads(json.dumps(prefs) % interpolation)
+        for pref in prefs:
+            prefs[pref] = Preferences.cast(prefs[pref])
+        # TODO: make this less hacky
+        # https://bugzilla.mozilla.org/show_bug.cgi?id=913152
+
+        # proxy
+        # use SSL port for legacy compatibility; see
+        # - https://bugzilla.mozilla.org/show_bug.cgi?id=688667#c66
+        # - https://bugzilla.mozilla.org/show_bug.cgi?id=899221
+        # - https://github.com/mozilla/mozbase/commit/43f9510e3d58bfed32790c82a57edac5f928474d
+        #             'ws': str(self.webSocketPort)
+        proxy = {'remote': options.webServer,
+                 'http': options.httpPort,
+                 'https': options.sslPort,
+                 'ws': options.sslPort
+                 }
+
+        # See if we should use fake media devices.
+        if options.useTestMediaDevices:
+            prefs['media.audio_loopback_dev'] = self.mediaDevices['audio']
+            prefs['media.video_loopback_dev'] = self.mediaDevices['video']
+
+        # create a profile
         self.profile = Profile(profile=options.profilePath,
                                addons=extensions,
                                locations=self.locations,
-                               proxy=self.proxy(options),
-                               whitelistpaths=sandbox_whitelist_paths,
+                               preferences=prefs,
+                               proxy=proxy,
+                               whitelistpaths=sandbox_whitelist_paths
                                )
 
         # Fix options.profilePath for legacy consumers.
         options.profilePath = self.profile.profile
 
         manifest = self.addChromeToProfile(options)
         self.copyExtraFilesToProfile(options)
 
         # create certificate database for the profile
         # TODO: this should really be upstreamed somewhere, maybe mozprofile
         certificateStatus = self.fillCertificateDB(options)
         if certificateStatus:
             self.log.error(
                 "TEST-UNEXPECTED-FAIL | runtests.py | Certificate integration failed")
             return None
 
-        # Set preferences in the following order (latter overrides former):
-        # 1) Preferences from base profile (e.g from testing/profiles)
-        # 2) Prefs hardcoded in this function
-        # 3) Prefs from --setpref
-
-        # Prefs from base profiles
-        self.merge_base_profiles(options)
-
-        # Hardcoded prefs (TODO move these into a base profile)
-        prefs = {
-            "browser.tabs.remote.autostart": options.e10s,
-            "dom.ipc.tabs.nested.enabled": options.nested_oop,
-            "idle.lastDailyNotification": int(time.time()),
-            # Enable tracing output for detailed failures in case of
-            # failing connection attempts, and hangs (bug 1397201)
-            "marionette.log.level": "TRACE",
-        }
-
-        if options.flavor == 'browser' and options.timeout:
-            prefs["testing.browserTestHarness.timeout"] = options.timeout
-
-        # browser-chrome tests use a fairly short default timeout of 45 seconds;
-        # this is sometimes too short on asan and debug, where we expect reduced
-        # performance.
-        if (mozinfo.info["asan"] or mozinfo.info["debug"]) and \
-                options.flavor == 'browser' and options.timeout is None:
-            self.log.info("Increasing default timeout to 90 seconds")
-            prefs["testing.browserTestHarness.timeout"] = 90
-
-        if getattr(self, 'testRootAbs', None):
-            prefs['mochitest.testRoot'] = self.testRootAbs
-
-        # See if we should use fake media devices.
-        if options.useTestMediaDevices:
-            prefs['media.audio_loopback_dev'] = self.mediaDevices['audio']
-            prefs['media.video_loopback_dev'] = self.mediaDevices['video']
-
-        self.profile.set_preferences(prefs)
-
-        # Extra prefs from --setpref
-        self.profile.set_preferences(self.extraPrefs(options.extraPrefs))
         return manifest
 
     def getGMPPluginPath(self, options):
         if options.gmp_path:
             return options.gmp_path
 
         gmp_parentdirs = [
             # For local builds, GMP plugins will be under dist/bin.
--- a/testing/mochitest/tests/python/python.ini
+++ b/testing/mochitest/tests/python/python.ini
@@ -1,7 +1,6 @@
 [DEFAULT]
 subsuite = mochitest
+sequential = true
 
 [test_basic_mochitest_plain.py]
-sequential = true
 [test_get_active_tests.py]
-[test_build_profile.py]
deleted file mode 100644
--- a/testing/mochitest/tests/python/test_build_profile.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from __future__ import print_function, unicode_literals
-
-import os
-from argparse import Namespace
-
-from mozprofile.prefs import Preferences
-from mozprofile import Profile
-from six import string_types
-
-import mozunit
-import pytest
-from conftest import setup_args
-
-
-@pytest.fixture
-def build_profile(setup_test_harness, parser):
-    setup_test_harness(*setup_args)
-    runtests = pytest.importorskip('runtests')
-    md = runtests.MochitestDesktop('plain', {'log_tbpl': '-'})
-
-    options = parser.parse_args([])
-    parser.validate(options)
-    options = vars(options)
-
-    def inner(**kwargs):
-        opts = options.copy()
-        opts.update(kwargs)
-
-        return md, md.buildProfile(Namespace(**opts))
-
-    return inner
-
-
-@pytest.fixture
-def profile_data_dir(build_obj):
-    return os.path.join(build_obj.topsrcdir, 'testing', 'profiles')
-
-
-def test_common_prefs_are_all_set(build_profile, profile_data_dir):
-    # We set e10s=False here because MochitestDesktop.buildProfile overwrites
-    # the value defined in the base profile.
-    # TODO stop setting browser.tabs.remote.autostart in the base profile
-    md, result = build_profile(e10s=False)
-
-    # build the expected prefs
-    expected_prefs = {}
-    for profile in md.base_profiles:
-        for name in Profile.preference_file_names:
-            path = os.path.join(profile_data_dir, profile, name)
-            if os.path.isfile(path):
-                expected_prefs.update(Preferences.read_prefs(path))
-
-    # read the actual prefs
-    actual_prefs = {}
-    for name in Profile.preference_file_names:
-        path = os.path.join(md.profile.profile, name)
-        if os.path.isfile(path):
-            actual_prefs.update(Preferences.read_prefs(path))
-
-    # keep this in sync with the values in MochitestDesktop.merge_base_profiles
-    interpolation = {
-        'server': '127.0.0.1:8888',
-    }
-    for k, v in expected_prefs.items():
-        if isinstance(v, string_types):
-            v = v.format(**interpolation)
-
-        assert k in actual_prefs
-        assert k and actual_prefs[k] == v
-
-
-if __name__ == '__main__':
-    mozunit.main()
--- a/testing/mozbase/mozprofile/mozprofile/profile.py
+++ b/testing/mozbase/mozprofile/mozprofile/profile.py
@@ -5,17 +5,17 @@
 from __future__ import absolute_import
 
 import json
 import os
 import platform
 import tempfile
 import time
 import uuid
-from abc import ABCMeta, abstractmethod, abstractproperty
+from abc import ABCMeta, abstractmethod
 from shutil import copytree
 
 import mozfile
 from six import string_types
 
 from .addons import AddonManager
 from .permissions import Permissions
 from .prefs import Preferences
@@ -27,28 +27,17 @@ from .prefs import Preferences
            'ThunderbirdProfile',
            'create_profile']
 
 
 class BaseProfile(object):
     __metaclass__ = ABCMeta
 
     def __init__(self, profile=None, addons=None, preferences=None, restore=True):
-        """Create a new Profile.
-
-        All arguments are optional.
-
-        :param profile: Path to a profile. If not specified, a new profile
-                        directory will be created.
-        :param addons: List of paths to addons which should be installed in the profile.
-        :param preferences: Dict of preferences to set in the profile.
-        :param restore: Whether or not to clean up any modifications made to this profile
-                        (default True).
-        """
-        self._addons = addons or []
+        self._addons = addons
 
         # Prepare additional preferences
         if preferences:
             if isinstance(preferences, dict):
                 # unordered
                 preferences = preferences.items()
 
             # sanity check
@@ -89,50 +78,16 @@ class BaseProfile(object):
 
     def reset(self):
         """
         reset the profile to the beginning state
         """
         self.cleanup()
         self._reset()
 
-    @abstractmethod
-    def set_preferences(self, preferences, filename='user.js'):
-        pass
-
-    @abstractproperty
-    def preference_file_names(self):
-        """A tuple of file basenames expected to contain preferences."""
-
-    def merge(self, other, interpolation=None):
-        """Merges another profile into this one.
-
-        This will handle pref files matching the profile's
-        `preference_file_names` property, and any addons in the
-        other/extensions directory.
-        """
-        for basename in os.listdir(other):
-            if basename not in self.preference_file_names:
-                continue
-
-            path = os.path.join(other, basename)
-            try:
-                prefs = Preferences.read_json(path)
-            except ValueError:
-                prefs = Preferences.read_prefs(path, interpolation=interpolation)
-            self.set_preferences(prefs, filename=basename)
-
-        extension_dir = os.path.join(other, 'extensions')
-        for basename in os.listdir(extension_dir):
-            path = os.path.join(extension_dir, basename)
-
-            if self.addons.is_addon(path):
-                self._addons.append(path)
-                self.addons.install(path)
-
     @classmethod
     def clone(cls, path_from, path_to=None, ignore=None, **kwargs):
         """Instantiate a temporary profile via cloning
         - path: path of the basis to clone
         - ignore: callable passed to shutil.copytree
         - kwargs: arguments to the profile constructor
         """
         if not path_to:
@@ -168,32 +123,31 @@ class Profile(BaseProfile):
     can ensure this method is called (even in the case of exception) by using
     the profile as a context manager: ::
 
       with Profile() as profile:
           # do things with the profile
           pass
       # profile.cleanup() has been called here
     """
-    preference_file_names = ('user.js', 'prefs.js')
 
     def __init__(self, profile=None, addons=None, preferences=None, locations=None,
-                 proxy=None, restore=True, whitelistpaths=None, **kwargs):
+                 proxy=None, restore=True, whitelistpaths=None):
         """
         :param profile: Path to the profile
         :param addons: String of one or list of addons to install
         :param preferences: Dictionary or class of preferences
         :param locations: ServerLocations object
         :param proxy: Setup a proxy
         :param restore: Flag for removing all custom settings during cleanup
         :param whitelistpaths: List of paths to pass to Firefox to allow read
             access to from the content process sandbox.
         """
         super(Profile, self).__init__(
-            profile=profile, addons=addons, preferences=preferences, restore=restore, **kwargs)
+            profile=profile, addons=addons, preferences=preferences, restore=restore)
 
         self._locations = locations
         self._proxy = proxy
         self._whitelistpaths = whitelistpaths
 
         # Initialize all class members
         self._reset()
 
@@ -267,32 +221,37 @@ class Profile(BaseProfile):
             while True:
                 if not self.pop_preferences(filename):
                     break
 
     # methods for preferences
 
     def set_preferences(self, preferences, filename='user.js'):
         """Adds preferences dict to profile preferences"""
+
+        # append to the file
         prefs_file = os.path.join(self.profile, filename)
-        with open(prefs_file, 'a') as f:
-            if not preferences:
-                return
+        f = open(prefs_file, 'a')
+
+        if preferences:
 
             # note what files we've touched
             self.written_prefs.add(filename)
 
             # opening delimeter
             f.write('\n%s\n' % self.delimeters[0])
 
+            # write the preferences
             Preferences.write(f, preferences)
 
             # closing delimeter
             f.write('%s\n' % self.delimeters[1])
 
+        f.close()
+
     def set_persistent_preferences(self, preferences):
         """
         Adds preferences dict to profile preferences and save them during a
         profile reset
         """
 
         # this is a dict sometimes, convert
         if isinstance(preferences, dict):
@@ -481,61 +440,49 @@ class ThunderbirdProfile(Profile):
                    'browser.warnOnQuit': False,
                    'browser.sessionstore.resume_from_crash': False,
                    # prevents the 'new e-mail address' wizard on new profile
                    'mail.provider.enabled': False,
                    }
 
 
 class ChromeProfile(BaseProfile):
-    preference_file_names = ('Preferences',)
-
     class AddonManager(list):
         def install(self, addons):
             if isinstance(addons, string_types):
                 addons = [addons]
             self.extend(addons)
 
-        @classmethod
-        def is_addon(self, addon):
-            # TODO Implement this properly
-            return os.path.exists(addon)
-
     def __init__(self, **kwargs):
         super(ChromeProfile, self).__init__(**kwargs)
 
         if self.create_new:
             self.profile = os.path.join(self.profile, 'Default')
         self._reset()
 
     def _reset(self):
         if not os.path.isdir(self.profile):
             os.makedirs(self.profile)
 
         if self._preferences:
-            self.set_preferences(self._preferences)
+            pref_file = os.path.join(self.profile, 'Preferences')
+
+            prefs = {}
+            if os.path.isfile(pref_file):
+                with open(pref_file, 'r') as fh:
+                    prefs.update(json.load(fh))
+
+            prefs.update(self._preferences)
+            with open(pref_file, 'w') as fh:
+                json.dump(prefs, fh)
 
         self.addons = self.AddonManager()
         if self._addons:
             self.addons.install(self._addons)
 
-    def set_preferences(self, preferences, filename='Preferences', **values):
-        pref_file = os.path.join(self.profile, filename)
-
-        prefs = {}
-        if os.path.isfile(pref_file):
-            with open(pref_file, 'r') as fh:
-                prefs.update(json.load(fh))
-
-        prefs.update(preferences)
-        with open(pref_file, 'w') as fh:
-            prefstr = json.dumps(prefs)
-            prefstr % values  # interpolate prefs with values
-            fh.write(prefstr)
-
 
 profile_class = {
     'chrome': ChromeProfile,
     'firefox': FirefoxProfile,
     'thunderbird': ThunderbirdProfile,
 }
 
 
deleted file mode 100644
--- a/testing/mozbase/mozprofile/tests/files/dummy-profile/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
-  globals: {
-    user_pref: true,
-  }
-};
deleted file mode 100644
--- a/testing/mozbase/mozprofile/tests/files/dummy-profile/Preferences
+++ /dev/null
@@ -1,1 +0,0 @@
-{"Preferences": 1}
deleted file mode 100644
index 26f28f099d24bec509e3abd991ff453c667543d6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/testing/mozbase/mozprofile/tests/files/dummy-profile/prefs.js
+++ /dev/null
@@ -1,1 +0,0 @@
-user_pref("prefs.js", 1);
deleted file mode 100644
--- a/testing/mozbase/mozprofile/tests/files/dummy-profile/user.js
+++ /dev/null
@@ -1,1 +0,0 @@
-user_pref("user.js", 1);
--- a/testing/mozbase/mozprofile/tests/test_profile.py
+++ b/testing/mozbase/mozprofile/tests/test_profile.py
@@ -6,28 +6,25 @@
 
 from __future__ import absolute_import
 
 import os
 
 import mozunit
 import pytest
 
-from mozprofile.prefs import Preferences
 from mozprofile import (
     BaseProfile,
     Profile,
     ChromeProfile,
     FirefoxProfile,
     ThunderbirdProfile,
     create_profile,
 )
 
-here = os.path.abspath(os.path.dirname(__file__))
-
 
 def test_with_profile_should_cleanup():
     with Profile() as profile:
         assert os.path.exists(profile.profile)
 
     # profile is cleaned
     assert not os.path.exists(profile.profile)
 
@@ -57,42 +54,10 @@ def test_create_profile(tmpdir, app, cls
         return
 
     profile = create_profile(app, profile=path)
     assert isinstance(profile, BaseProfile)
     assert profile.__class__ == cls
     assert profile.profile == path
 
 
-@pytest.mark.parametrize('cls', [
-    Profile,
-    ChromeProfile,
-])
-def test_merge_profile(cls):
-    profile = cls(preferences={'foo': 'bar'})
-    assert profile._addons == []
-    assert os.path.isfile(os.path.join(profile.profile, profile.preference_file_names[0]))
-
-    other_profile = os.path.join(here, 'files', 'dummy-profile')
-    profile.merge(other_profile)
-
-    # make sure to add a pref file for each preference_file_names in the dummy-profile
-    prefs = {}
-    for name in profile.preference_file_names:
-        path = os.path.join(profile.profile, name)
-        assert os.path.isfile(path)
-
-        try:
-            prefs.update(Preferences.read_json(path))
-        except ValueError:
-            prefs.update(Preferences.read_prefs(path))
-
-    assert 'foo' in prefs
-    assert len(prefs) == len(profile.preference_file_names) + 1
-    assert all(name in prefs for name in profile.preference_file_names)
-
-    assert len(profile._addons) == 1
-    assert profile._addons[0].endswith('empty.xpi')
-    assert os.path.exists(profile._addons[0])
-
-
 if __name__ == '__main__':
     mozunit.main()
deleted file mode 100644
--- a/testing/profiles/common/extensions/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Dropping extensions here will get them installed in all test harnesses
-that make use of this profile.
--- a/testing/profiles/moz.build
+++ b/testing/profiles/moz.build
@@ -1,15 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-profiles = [
-    'common/*',
+mochitest_profile_files = [
+    'prefs_general.js',
 ]
 
-TEST_HARNESS_FILES.testing.mochitest.profile_data += profiles
-TEST_HARNESS_FILES['web-platform'].prefs += ['common/user.js']
+TEST_HARNESS_FILES.testing.mochitest.profile_data += mochitest_profile_files
+TEST_HARNESS_FILES['web-platform'].prefs += mochitest_profile_files
 
 with Files("**"):
     BUG_COMPONENT = ("Testing", "Mochitest")
rename from testing/profiles/common/user.js
rename to testing/profiles/prefs_general.js
--- a/testing/profiles/common/user.js
+++ b/testing/profiles/prefs_general.js
@@ -54,19 +54,19 @@ user_pref("media.volume_scale", "0.01");
 user_pref("media.test.dumpDebugInfo", true);
 user_pref("media.dormant-on-pause-timeout-ms", 0); // Enter dormant immediately without waiting for timeout.
 user_pref("media.suspend-bkgnd-video.enabled", false);
 user_pref("security.warn_viewing_mixed", false);
 user_pref("app.update.enabled", false);
 user_pref("app.update.staging.enabled", false);
 user_pref("app.update.url.android", "");
 // Make sure GMPInstallManager won't hit the network.
-user_pref("media.gmp-manager.url.override", "http://{server}/dummy-gmp-manager.xml");
+user_pref("media.gmp-manager.url.override", "http://%(server)s/dummy-gmp-manager.xml");
 user_pref("media.gmp-manager.updateEnabled", false);
-user_pref("media.hls.server.url", "http://{server}/tests/dom/media/test/hls");
+user_pref("media.hls.server.url", "http://%(server)s/tests/dom/media/test/hls");
 user_pref("dom.w3c_touch_events.enabled", 1);
 user_pref("layout.accessiblecaret.enabled_on_touch", false);
 user_pref("dom.webcomponents.shadowdom.enabled", false);
 user_pref("dom.webcomponents.customelements.enabled", true);
 // Existing tests assume there is no font size inflation.
 user_pref("font.size.inflation.emPerLine", 0);
 user_pref("font.size.inflation.minTwips", 0);
 // Disable the caret blinking so we get stable snapshot
@@ -84,85 +84,85 @@ user_pref("extensions.autoDisableScopes"
 user_pref("extensions.getAddons.cache.enabled", false);
 // Disable intalling any distribution add-ons
 user_pref("extensions.installDistroAddons", false);
 // XPI extensions are required for test harnesses to load
 user_pref("extensions.defaultProviders.enabled", true);
 user_pref("xpinstall.signatures.required", false);
 user_pref("extensions.legacy.enabled", true);
 
-user_pref("geo.wifi.uri", "http://{server}/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
+user_pref("geo.wifi.uri", "http://%(server)s/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
 user_pref("geo.wifi.timeToWaitBeforeSending", 2000);
 user_pref("geo.wifi.scan", false);
 user_pref("geo.wifi.logging.enabled", true);
 
 // Prevent connection to the push server for tests.
 user_pref("dom.push.connection.enabled", false);
 
 // Point the url-classifier to the local testing server for fast failures
-user_pref("browser.safebrowsing.downloads.remote.url", "http://{server}/safebrowsing-dummy/update");
-user_pref("browser.safebrowsing.provider.google.gethashURL", "http://{server}/safebrowsing-dummy/gethash");
-user_pref("browser.safebrowsing.provider.google.updateURL", "http://{server}/safebrowsing-dummy/update");
-user_pref("browser.safebrowsing.provider.google4.gethashURL", "http://{server}/safebrowsing4-dummy/gethash");
-user_pref("browser.safebrowsing.provider.google4.updateURL", "http://{server}/safebrowsing4-dummy/update");
-user_pref("browser.safebrowsing.provider.mozilla.gethashURL", "http://{server}/safebrowsing-dummy/gethash");
-user_pref("browser.safebrowsing.provider.mozilla.updateURL", "http://{server}/safebrowsing-dummy/update");
-user_pref("privacy.trackingprotection.introURL", "http://{server}/trackingprotection/tour");
+user_pref("browser.safebrowsing.downloads.remote.url", "http://%(server)s/safebrowsing-dummy/update");
+user_pref("browser.safebrowsing.provider.google.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
+user_pref("browser.safebrowsing.provider.google.updateURL", "http://%(server)s/safebrowsing-dummy/update");
+user_pref("browser.safebrowsing.provider.google4.gethashURL", "http://%(server)s/safebrowsing4-dummy/gethash");
+user_pref("browser.safebrowsing.provider.google4.updateURL", "http://%(server)s/safebrowsing4-dummy/update");
+user_pref("browser.safebrowsing.provider.mozilla.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
+user_pref("browser.safebrowsing.provider.mozilla.updateURL", "http://%(server)s/safebrowsing-dummy/update");
+user_pref("privacy.trackingprotection.introURL", "http://%(server)s/trackingprotection/tour");
 // Point update checks to the local testing server for fast failures
-user_pref("extensions.update.url", "http://{server}/extensions-dummy/updateURL");
-user_pref("extensions.update.background.url", "http://{server}/extensions-dummy/updateBackgroundURL");
-user_pref("extensions.blocklist.detailsURL", "http://{server}/extensions-dummy/blocklistDetailsURL");
-user_pref("extensions.blocklist.itemURL", "http://{server}/extensions-dummy/blocklistItemURL");
-user_pref("extensions.blocklist.url", "http://{server}/extensions-dummy/blocklistURL");
-user_pref("extensions.hotfix.url", "http://{server}/extensions-dummy/hotfixURL");
-user_pref("extensions.systemAddon.update.url", "http://{server}/dummy-system-addons.xml");
+user_pref("extensions.update.url", "http://%(server)s/extensions-dummy/updateURL");
+user_pref("extensions.update.background.url", "http://%(server)s/extensions-dummy/updateBackgroundURL");
+user_pref("extensions.blocklist.detailsURL", "http://%(server)s/extensions-dummy/blocklistDetailsURL");
+user_pref("extensions.blocklist.itemURL", "http://%(server)s/extensions-dummy/blocklistItemURL");
+user_pref("extensions.blocklist.url", "http://%(server)s/extensions-dummy/blocklistURL");
+user_pref("extensions.hotfix.url", "http://%(server)s/extensions-dummy/hotfixURL");
+user_pref("extensions.systemAddon.update.url", "http://%(server)s/dummy-system-addons.xml");
 // Turn off extension updates so they don't bother tests
 user_pref("extensions.update.enabled", false);
 // Make sure opening about:addons won't hit the network
-user_pref("extensions.webservice.discoverURL", "http://{server}/extensions-dummy/discoveryURL");
+user_pref("extensions.webservice.discoverURL", "http://%(server)s/extensions-dummy/discoveryURL");
 // Make sure AddonRepository won't hit the network
-user_pref("extensions.getAddons.get.url", "http://{server}/extensions-dummy/repositoryGetURL");
-user_pref("extensions.getAddons.getWithPerformance.url", "http://{server}/extensions-dummy/repositoryGetWithPerformanceURL");
-user_pref("extensions.getAddons.search.browseURL", "http://{server}/extensions-dummy/repositoryBrowseURL");
+user_pref("extensions.getAddons.get.url", "http://%(server)s/extensions-dummy/repositoryGetURL");
+user_pref("extensions.getAddons.getWithPerformance.url", "http://%(server)s/extensions-dummy/repositoryGetWithPerformanceURL");
+user_pref("extensions.getAddons.search.browseURL", "http://%(server)s/extensions-dummy/repositoryBrowseURL");
 // Ensure blocklist updates don't hit the network
-user_pref("services.settings.server", "http://{server}/dummy-kinto/v1");
+user_pref("services.settings.server", "http://%(server)s/dummy-kinto/v1");
 // Make sure SNTP requests don't hit the network
-user_pref("network.sntp.pools", "{server}");
+user_pref("network.sntp.pools", "%(server)s");
 // We know the SNTP request will fail, since localhost isn't listening on
 // port 135. The default number of retries (10) is excessive, but retrying
 // at least once will mean that codepath is still tested in automation.
 user_pref("network.sntp.maxRetryCount", 1);
 
 // Make sure the notification permission migration test doesn't hit the network.
-user_pref("app.support.baseURL", "http://{server}/support-dummy/");
+user_pref("app.support.baseURL", "http://%(server)s/support-dummy/");
 
 // Existing tests don't wait for the notification button security delay
 user_pref("security.notification_enable_delay", 0);
 
 // Make enablePrivilege continue to work for test code. :-(
 user_pref("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", true);
 
 // In the default configuration, we bypass XBL scopes (a security feature) for
 // domains whitelisted for remote XUL, so that intranet apps and such continue
 // to work without major rewrites. However, we also use the whitelist mechanism
 // to run our XBL tests in automation, in which case we really want to be testing
 // the configuration that we ship to users without special whitelisting. So we
 // use an additional pref here to allow automation to use the "normal" behavior.
 user_pref("dom.use_xbl_scopes_for_remote_xul", true);
 
-user_pref("captivedetect.canonicalURL", "http://{server}/captive-detect/success.txt");
+user_pref("captivedetect.canonicalURL", "http://%(server)s/captive-detect/success.txt");
 
 // We do not wish to display datareporting policy notifications as it might
 // cause other tests to fail. Tests that wish to test the notification functionality
 // should explicitly disable this pref.
 user_pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true);
 
 // Point Firefox Health Report at a local server. We don't care if it actually
 // works. It just can't hit the default production endpoint.
-user_pref("datareporting.healthreport.documentServerURI", "http://{server}/healthreport/");
+user_pref("datareporting.healthreport.documentServerURI", "http://%(server)s/healthreport/");
 
 // Make sure CSS error reporting is enabled for tests
 user_pref("layout.css.report_errors", true);
 
 // Enable CSS Grid 'subgrid' feature for testing
 user_pref("layout.css.grid-template-subgrid-value.enabled", true);
 
 // Enable CSS 'contain' for testing
@@ -208,34 +208,34 @@ user_pref("browser.webapps.testing", tru
 
 // Disable android snippets
 user_pref("browser.snippets.enabled", false);
 user_pref("browser.snippets.syncPromo.enabled", false);
 user_pref("browser.snippets.firstrunHomepage.enabled", false);
 
 // Disable useragent updates.
 user_pref("general.useragent.updates.enabled", false);
-user_pref("general.useragent.updates.url", "https://example.com/0/%APP_ID%");
+user_pref("general.useragent.updates.url", "https://example.com/0/%%APP_ID%%");
 
 // Disable webapp updates.  Yes, it is supposed to be an integer.
 user_pref("browser.webapps.checkForUpdates", 0);
 
 user_pref("dom.presentation.testing.simulate-receiver", false);
 
 // Don't connect to Yahoo! for RSS feed tests.
 // en-US only uses .types.0.uri, but set all of them just to be sure.
-user_pref("browser.contentHandlers.types.0.uri", "http://test1.example.org/rss?url=%s");
-user_pref("browser.contentHandlers.types.1.uri", "http://test1.example.org/rss?url=%s");
-user_pref("browser.contentHandlers.types.2.uri", "http://test1.example.org/rss?url=%s");
-user_pref("browser.contentHandlers.types.3.uri", "http://test1.example.org/rss?url=%s");
-user_pref("browser.contentHandlers.types.4.uri", "http://test1.example.org/rss?url=%s");
-user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?url=%s");
+user_pref("browser.contentHandlers.types.0.uri", "http://test1.example.org/rss?url=%%s");
+user_pref("browser.contentHandlers.types.1.uri", "http://test1.example.org/rss?url=%%s");
+user_pref("browser.contentHandlers.types.2.uri", "http://test1.example.org/rss?url=%%s");
+user_pref("browser.contentHandlers.types.3.uri", "http://test1.example.org/rss?url=%%s");
+user_pref("browser.contentHandlers.types.4.uri", "http://test1.example.org/rss?url=%%s");
+user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?url=%%s");
 
 // We want to collect telemetry, but we don't want to send in the results.
-user_pref("toolkit.telemetry.server", "https://{server}/telemetry-dummy/");
+user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy/");
 user_pref("datareporting.healthreport.uploadEnabled", false);
 // Don't send 'new-profile' ping on new profiles during tests, otherwise the testing framework
 // might wait on the pingsender to finish and slow down tests.
 user_pref("toolkit.telemetry.newProfilePing.enabled", false);
 // Don't send 'bhr' ping during tests, otherwise the testing framework might
 // wait on the pingsender to finish and slow down tests.
 user_pref("toolkit.telemetry.bhrPing.enabled", false);
 // Don't send the 'shutdown' ping using the pingsender on the first session using
@@ -251,51 +251,51 @@ user_pref("toolkit.telemetry.firstShutdo
 // A couple of preferences with default values to test that telemetry preference
 // watching is working.
 user_pref("toolkit.telemetry.test.pref1", true);
 user_pref("toolkit.telemetry.test.pref2", false);
 
 // We don't want to hit the real Firefox Accounts server for tests.  We don't
 // actually need a functioning FxA server, so just set it to something that
 // resolves and accepts requests, even if they all fail.
-user_pref("identity.fxaccounts.auth.uri", "https://{server}/fxa-dummy/");
+user_pref("identity.fxaccounts.auth.uri", "https://%(server)s/fxa-dummy/");
 
 // Ditto for all the FxA content root URI.
-user_pref("identity.fxaccounts.remote.root", "https://{server}/");
+user_pref("identity.fxaccounts.remote.root", "https://%(server)s/");
 
 // Increase the APZ content response timeout in tests to 1 minute.
 // This is to accommodate the fact that test environments tends to be slower
 // than production environments (with the b2g emulator being the slowest of them
 // all), resulting in the production timeout value sometimes being exceeded
 // and causing false-positive test failures. See bug 1176798, bug 1177018,
 // bug 1210465.
 user_pref("apz.content_response_timeout", 60000);
 
 // Make sure SSL Error reports don't hit the network
 user_pref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/ssl_error_reports.sjs?succeed");
 
 // Make sure Translation won't hit the network.
-user_pref("browser.translation.bing.authURL", "http://{server}/browser/browser/components/translation/test/bing.sjs");
-user_pref("browser.translation.bing.translateArrayURL", "http://{server}/browser/browser/components/translation/test/bing.sjs");
-user_pref("browser.translation.yandex.translateURLOverride", "http://{server}/browser/browser/components/translation/test/yandex.sjs");
+user_pref("browser.translation.bing.authURL", "http://%(server)s/browser/browser/components/translation/test/bing.sjs");
+user_pref("browser.translation.bing.translateArrayURL", "http://%(server)s/browser/browser/components/translation/test/bing.sjs");
+user_pref("browser.translation.yandex.translateURLOverride", "http://%(server)s/browser/browser/components/translation/test/yandex.sjs");
 user_pref("browser.translation.engine", "bing");
 
 // Make sure we don't try to load snippets from the network.
 user_pref("browser.aboutHomeSnippets.updateUrl", "nonexistent://test");
 
 // Use an empty list of sites to avoid fetching
 user_pref("browser.newtabpage.activity-stream.default.sites", "");
 user_pref("browser.newtabpage.activity-stream.telemetry", false);
 user_pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", "");
 user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
 user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
 
 // Ensure UITour won't hit the network
-user_pref("browser.uitour.pinnedTabUrl", "http://{server}/uitour-dummy/pinnedTab");
-user_pref("browser.uitour.url", "http://{server}/uitour-dummy/tour");
+user_pref("browser.uitour.pinnedTabUrl", "http://%(server)s/uitour-dummy/pinnedTab");
+user_pref("browser.uitour.url", "http://%(server)s/uitour-dummy/tour");
 
 // Tell the search service we are running in the US.  This also has the desired
 // side-effect of preventing our geoip lookup.
 user_pref("browser.search.isUS", true);
 user_pref("browser.search.countryCode", "US");
 // This will prevent HTTP requests for region defaults.
 user_pref("browser.search.geoSpecificDefaults", false);
 
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -238,17 +238,17 @@ ifdef STRIP_COMPILED_TESTS
 else
 	cp -RL $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittest
 endif
 
 stage-steeplechase: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/steeplechase/
 	cp -RL $(DEPTH)/_tests/steeplechase $(PKG_STAGE)/steeplechase/tests
 	cp -RL $(DIST)/xpi-stage/specialpowers $(PKG_STAGE)/steeplechase
-	cp -RL $(topsrcdir)/testing/profiles/common/user.js $(PKG_STAGE)/steeplechase/prefs_general.js
+	cp -RL $(topsrcdir)/testing/profiles/prefs_general.js $(PKG_STAGE)/steeplechase
 
 TEST_EXTENSIONS := \
     specialpowers@mozilla.org.xpi \
 	$(NULL)
 
 stage-extensions: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/extensions/
 	@$(foreach ext,$(TEST_EXTENSIONS), cp -RL $(DIST)/xpi-stage/$(ext) $(PKG_STAGE)/extensions;)
--- a/testing/web-platform/tests/tools/wpt/browser.py
+++ b/testing/web-platform/tests/tools/wpt/browser.py
@@ -200,28 +200,28 @@ class Firefox(Browser):
             if channel == "beta":
                 tag = "FIREFOX_%s_BETA" % version.split(".", 1)[0]
             else:
                 # Always use tip as the tag for nightly; this isn't quite right
                 # but to do better we need the actual build revision, which we
                 # can get if we have an application.ini file
                 tag = "tip"
 
-        return "%s/raw-file/%s/testing/profiles/common/user.js" % (repo, tag)
+        return "%s/raw-file/%s/testing/profiles/prefs_general.js" % (repo, tag)
 
     def install_prefs(self, binary, dest=None):
         version, channel = self.get_version_number(binary)
 
         if dest is None:
             dest = os.pwd
 
-        dest = os.path.join(dest, "profiles", "common")
+        dest = os.path.join(dest, "profiles")
         if not os.path.exists(dest):
             os.makedirs(dest)
-        prefs_file = os.path.join(dest, "user.js")
+        prefs_file = os.path.join(dest, "prefs_general.js")
         cache_file = os.path.join(dest,
                                   "%s-%s.cache" % (version, channel)
                                   if channel != "nightly"
                                   else "nightly.cache")
 
         have_cache = False
         if os.path.exists(cache_file):
             if channel != "nightly":
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -240,17 +240,17 @@ class FirefoxBrowser(Browser):
         self.logger.debug("Starting Firefox")
 
         self.runner.start(debug_args=debug_args, interactive=self.debug_info and self.debug_info.interactive)
         self.logger.debug("Firefox Started")
 
     def load_prefs(self):
         prefs = Preferences()
 
-        prefs_path = os.path.join(self.prefs_root, "user.js")
+        prefs_path = os.path.join(self.prefs_root, "prefs_general.js")
         if os.path.exists(prefs_path):
             prefs.add(Preferences.read_prefs(prefs_path))
         else:
             self.logger.warning("Failed to find base prefs file in %s" % prefs_path)
 
         # Add any custom preferences
         prefs.add(self.extra_prefs, cast=True)