Bug 1485386 - Move feature-enabling preferences out of unittest/user.js into a separate file r=ahal
authorWes Kocher <wkocher@mozilla.com>
Fri, 18 Jan 2019 00:35:43 +0000
changeset 511472 0e2384b8497dbe5af4db59a7b8be7241caf7266d
parent 511471 6fa7cd75df96e93f58d5a175f23255a383605f9f
child 511473 85f355a22192c5ccba2a05c8684e2f04cc7b988e
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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
Bug 1485386 - Move feature-enabling preferences out of unittest/user.js into a separate file r=ahal The unittest/user.js file contained a mix of preferences that ensure tests can run (switching web services to dummy servers to prevent hitting networks, etc) and preferences that enable features that aren't shipping by default (turning on touch events, enabling experimental css features, etc). In the future, we're going to want to run tests of only the features that are being shipped in release builds (or in beta builds, or in esr builds, etc), so we need to move feature-enabling preferences into a different file to make it possible to run tests with various sets of features enabled. This commit just moves feature-enabling prefs into a new file and then includes that file everywhere unittest prefs were already being included, so it should have no functional difference in the set of preferences being set in test runs. It also renames the unittest profile to clarify its purpose, and adds pointers to each profile from the other, and adds comments explaining what they're used for. Differential Revision: https://phabricator.services.mozilla.com/D16123
--- a/testing/profiles/moz.build
+++ b/testing/profiles/moz.build
@@ -6,17 +6,18 @@
 profile_files = [
-    'unittest/*',
+    'unittest-features/*',
+    'unittest-required/*',
 TEST_HARNESS_FILES.reftest.profile_data += profile_files
 TEST_HARNESS_FILES.testing.mochitest.profile_data += profile_files
 TEST_HARNESS_FILES['web-platform'].prefs += profile_files
 with Files("**"):
--- a/testing/profiles/profiles.json
+++ b/testing/profiles/profiles.json
@@ -1,10 +1,10 @@
-    "mochitest": ["base", "common", "unittest"],
-    "profileserver": ["base", "common", "unittest", "profileserver"],
+    "mochitest": ["base", "common", "unittest-required", "unittest-features"],
+    "profileserver": ["base", "common", "unittest-required", "unittest-features", "profileserver"],
     "raptor": ["base", "common", "perf", "raptor"],
     "reftest": ["base", "common", "reftest"],
     "talos": ["base", "common", "perf"],
-    "valgrind": ["base", "common", "unittest"],
+    "valgrind": ["base", "common", "unittest-required", "unittest-features"],
     "xpcshell": ["base", "xpcshell"],
-    "web-platform-tests": ["base", "common", "unittest", "web-platform"]
+    "web-platform-tests": ["base", "common", "unittest-required", "unittest-features", "web-platform"]
rename from testing/profiles/unittest/extensions/README.txt
rename to testing/profiles/unittest-features/extensions/README.txt
new file mode 100644
--- /dev/null
+++ b/testing/profiles/unittest-features/user.js
@@ -0,0 +1,43 @@
+// Base preferences file for enabling unittest features.
+// Not enabling these features cause many unittests that
+// expect these prefs to be set to fail.
+// Ideally, tests depending on these prefs should be setting
+// the prefs themselves in their manifests...
+// NOTE: Setting prefs to enable unittests to run at all
+// should occur in unittest-required/user.js, not here!
+/* globals user_pref */
+// Enable w3c touch events for testing
+user_pref("dom.w3c_touch_events.enabled", 1);
+// Enable CSS 'contain' for testing
+user_pref("layout.css.contain.enabled", true);
+// Enable CSS Grid 'subgrid' feature for testing
+user_pref("layout.css.grid-template-subgrid-value.enabled", true);
+// Enable CSS initial-letter for testing
+user_pref("layout.css.initial-letter.enabled", true);
+// Enable -webkit-{min|max}-device-pixel-ratio media queries for testing
+user_pref("layout.css.prefixes.device-pixel-ratio-webkit", true);
+// Enable webkit prefixed CSS features for testing
+user_pref("layout.css.prefixes.webkit", true);
+// Enable Media Source Extensions for testing
+user_pref("media.mediasource.mp4.enabled", true);
+user_pref("media.mediasource.webm.enabled", true);
+user_pref("media.av1.enabled", true);
+user_pref("media.eme.enabled", true);
+// Enable some form preferences for testing
+user_pref("dom.experimental_forms", true);
+user_pref("dom.forms.color", true);
+user_pref("dom.forms.datetime", true);
+user_pref("dom.forms.datetime.others", true);
+// Enable Gamepad
+user_pref("dom.gamepad.enabled", true);
+user_pref("dom.gamepad.non_standard_events.enabled", true);
+// Enable form autofill feature testing.
+user_pref("extensions.formautofill.available", "on");
+// Enable CSS clip-path `path()` for testing
+user_pref("layout.css.clip-path-path.enabled", true);
+// Enable visualviewport for testing
+user_pref("dom.visualviewport.enabled", true);
+// For Firefox 52 only, ESR will support non-Flash plugins while release will
+// not, so we keep testing the non-Flash pathways
+user_pref("plugin.load_flash_only", false);
copy from testing/profiles/unittest/extensions/README.txt
copy to testing/profiles/unittest-required/extensions/README.txt
rename from testing/profiles/unittest/user.js
rename to testing/profiles/unittest-required/user.js
--- a/testing/profiles/unittest/user.js
+++ b/testing/profiles/unittest-required/user.js
@@ -1,9 +1,11 @@
-// Base preferences file for unittests.
+// Base preferences file to allow unittests to run successfully.
+// NOTE: Toggling prefs for testing features should happen in
+// unittest-features/user.js or in harness/test manifests, not here!
 /* globals user_pref */
 user_pref("accessibility.typeaheadfind.autostart", false);
 // Make sure Shield doesn't hit the network.
 user_pref("app.normandy.api_url", "");
 // Make sure the notification permission migration test doesn't hit the network.
 user_pref("app.support.baseURL", "http://{server}/support-dummy/");
 user_pref("app.update.staging.enabled", false);
 user_pref("app.update.url.android", "");
@@ -33,18 +35,18 @@ user_pref("browser.contentHandlers.types
 user_pref("browser.download.panel.shown", true);
 user_pref("browser.firstrun.show.localepicker", false);
 user_pref("browser.firstrun.show.uidiscovery", false);
 user_pref("browser.newtabpage.activity-stream.default.sites", "");
 user_pref("browser.newtabpage.activity-stream.telemetry", false);
 // Background thumbnails in particular cause grief, and disabling thumbnails
 // in general can't hurt - we re-enable them when tests need them.
 user_pref("browser.pagethumbnails.capturing_disabled", true);
+// Make sure PingCentre doesn't hit the network.
 user_pref("browser.ping-centre.production.endpoint", "");
-// Make sure PingCentre doesn't hit the network.
 user_pref("browser.ping-centre.staging.endpoint", "");
 // 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");
@@ -90,23 +92,16 @@ user_pref("devtools.chrome.enabled", fal
 user_pref("devtools.debugger.prompt-connection", true);
 user_pref("devtools.debugger.remote-enabled", false);
 user_pref("devtools.debugger.remote-port", 6023);
 user_pref("devtools.testing", true);
 // Required to set values in wpt metadata files (bug 1485842)
 user_pref("dom.audioworklet.enabled", false);
 user_pref("dom.allow_scripts_to_close_windows", true);
 user_pref("dom.disable_open_during_load", false);
-user_pref("dom.experimental_forms", true); // on for testing
-user_pref("dom.forms.color", true); // on for testing
-user_pref("dom.forms.datetime", true); // on for testing
-user_pref("dom.forms.datetime.others", true); // on for testing
-// Enable Gamepad
-user_pref("dom.gamepad.enabled", true);
-user_pref("dom.gamepad.non_standard_events.enabled", true);
 user_pref("dom.ipc.reportProcessHangs", false); // process hang monitor
 // Don't forceably kill content processes after a timeout
 user_pref("dom.ipc.tabs.shutdownTimeoutSecs", 0);
 user_pref("dom.min_background_timeout_value", 1000);
 user_pref("dom.popup_maximum", -1);
 user_pref("dom.block_multiple_popups", false);
 user_pref("dom.presentation.testing.simulate-receiver", false);
 // Prevent connection to the push server for tests.
@@ -114,26 +109,22 @@ user_pref("dom.push.connection.enabled",
 user_pref("dom.successive_dialog_time_limit", 0);
 // 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("dom.visualviewport.enabled", true); // on for testing
-user_pref("dom.w3c_touch_events.enabled", 1);
 user_pref("extensions.autoDisableScopes", 0);
 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");
 // XPI extensions are required for test harnesses to load
 user_pref("extensions.defaultProviders.enabled", true);
-// Enable form autofill feature testing.
-user_pref("extensions.formautofill.available", "on");
 // Disable metadata caching for installed add-ons by default
 user_pref("extensions.getAddons.cache.enabled", false);
 // 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.hotfix.url", "http://{server}/extensions-dummy/hotfixURL");
 // Disable intalling any distribution add-ons
@@ -164,56 +155,39 @@ user_pref("gfx.logging.level", 1);
 // 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/");
 // Ditto for all the FxA content root URI.
 user_pref("identity.fxaccounts.remote.root", "https://{server}/");
 user_pref("javascript.options.showInConsole", true);
 user_pref("layout.accessiblecaret.enabled_on_touch", false);
-// Enable CSS clip-path `path()` for testing
-user_pref("layout.css.clip-path-path.enabled", true);
-// Enable CSS 'contain' for testing
-user_pref("layout.css.contain.enabled", true);
-// Enable CSS Grid 'subgrid' feature for testing
-user_pref("layout.css.grid-template-subgrid-value.enabled", true);
-// Enable CSS initial-letter for testing
-user_pref("layout.css.initial-letter.enabled", true);
-// Enable -webkit-{min|max}-device-pixel-ratio media queries for testing
-user_pref("layout.css.prefixes.device-pixel-ratio-webkit", true);
-// Enable webkit prefixed CSS features for testing
-user_pref("layout.css.prefixes.webkit", true);
 // Make sure CSS error reporting is enabled for tests
 user_pref("layout.css.report_errors", true);
 // Disable spammy layout warnings because they pollute test logs
 user_pref("layout.spammy_warnings.enabled", false);
 // Make tests run consistently on DevEdition (which has a lightweight theme
 // selected by default).
 user_pref("lightweightThemes.selectedThemeID", "");
 // Disable all recommended Marionette preferences for Gecko tests.
 // The prefs recommended by Marionette are typically geared towards
 // consumer automation; not vendor testing.
 user_pref("marionette.prefs.recommended", false);
-user_pref("media.av1.enabled", true);
 user_pref("media.cache_size", 1000);
 user_pref("media.dormant-on-pause-timeout-ms", 0); // Enter dormant immediately without waiting for timeout.
 // Set the number of shmems the PChromiumCDM protocol pre-allocates to 0,
 // so that we test the case where we under-estimate how many shmems we need
 // to send decoded video frames from the CDM to Gecko.
 user_pref("media.eme.chromium-api.video-shmems", 0);
-user_pref("media.eme.enabled", true);
 // Make sure GMPInstallManager won't hit the network.
 user_pref("media.gmp-manager.url.override", "http://{server}/dummy-gmp-manager.xml");
 user_pref("media.hls.server.url", "http://{server}/tests/dom/media/test/hls");
 // Don't block old libavcodec libraries when testing, because our test systems
 // cannot easily be upgraded.
 user_pref("media.libavcodec.allow-obsolete", true);
-// Enable Media Source Extensions for testing
-user_pref("media.mediasource.mp4.enabled", true);
-user_pref("media.mediasource.webm.enabled", true);
 user_pref("media.memory_cache_max_size", 32);
 user_pref("media.memory_caches_combined_limit_kb", 256);
 user_pref("media.openUnsupportedTypeWithExternalApp", false);
 user_pref("media.preload.auto", 3); // auto = enough
 user_pref("media.preload.default", 2); // default = metadata
 user_pref("media.suspend-bkgnd-video.enabled", false);
 user_pref("media.test.dumpDebugInfo", true);
 user_pref("media.volume_scale", "0.01");
@@ -229,19 +203,16 @@ user_pref("network.manage-offline-status
 user_pref("network.sntp.maxRetryCount", 1);
 // Make sure SNTP requests don't hit the network
 user_pref("network.sntp.pools", "{server}");
 // Set places maintenance far in the future (the maximum time possible in an
 // int32_t) to avoid it kicking in during tests. The maintenance can take a
 // relatively long time which may cause unnecessary intermittents and slow down
 // tests. This, like many things, will stop working correctly in 2038.
 user_pref("places.database.lastMaintenance", 2147483647);
-// For Firefox 52 only, ESR will support non-Flash plugins while release will
-// not, so we keep testing the non-Flash pathways
-user_pref("plugin.load_flash_only", false);
 user_pref("privacy.trackingprotection.introURL", "http://{server}/trackingprotection/tour");
 user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
 // Existing tests don't wait for the notification button security delay
 user_pref("security.notification_enable_delay", 0);
 // 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");
 user_pref("security.warn_viewing_mixed", false);
 // Ensure blocklist updates don't hit the network