Bug 1476853 - Set autoplay to allowed for testing purposes. r?jmaher
We're going to enable block autoplay of HTMLMediaElements by default in Nightly,
but lots of our tests assume they are allowed to playback media without requiring
user interaction. After we've enabled block autoplay that assumption won't be valid.
So configure the prefs that control block autoplay so that we allow media to
autoplay.
This means the existing tests we have don't need to be rewritten to work when
we enable block autoplay by default.
MozReview-Commit-ID: 50yydubQjkS
--- a/testing/profiles/common/user.js
+++ b/testing/profiles/common/user.js
@@ -37,8 +37,13 @@ user_pref("extensions.update.enabled", f
user_pref("general.useragent.updates.enabled", false);
user_pref("hangmonitor.timeout", 0); // no hang monitor
user_pref("media.gmp-manager.updateEnabled", false);
// Make enablePrivilege continue to work for test code. :-(
user_pref("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", true);
user_pref("xpinstall.signatures.required", false);
// Prevent Remote Settings to issue non local connections.
user_pref("services.settings.server", "http://localhost/remote-settings-dummy/v1");
+// Ensure autoplay is enabled for all platforms.
+user_pref("media.autoplay.default", 0); // 0=Allowed, 1=Blocked, 2=Prompt
+user_pref("media.autoplay.enabled.user-gestures-needed", true);
+user_pref("media.autoplay.ask-permission", false);
+user_pref("media.autoplay.block-webaudio", false);
--- a/testing/profiles/reftest/user.js
+++ b/testing/profiles/reftest/user.js
@@ -61,18 +61,16 @@ user_pref("layout.interruptible-reflow.e
// Disable the fade out (over time) of overlay scrollbars, since we
// can't guarantee taking both reftest snapshots at the same point
// during the fade.
user_pref("layout.testing.overlay-scrollbars.always-visible", true);
// 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);
-// Ensure autoplay is enabled for all platforms.
-user_pref("media.autoplay.enabled", true);
user_pref("media.gmp-manager.url.override", "http://localhost/dummy-gmp-manager.xml");
user_pref("media.openUnsupportedTypeWithExternalApp", false);
// Reftests load a lot of URLs very quickly. This puts avoidable and
// unnecessary I/O pressure on the Places DB (measured to be in the
// gigabytes).
user_pref("places.history.enabled", false);
// For Firefox 52 only, ESR will support non-Flash plugins while release will
// not, so we keep testing the non-Flash pathways
--- a/testing/profiles/unittest/user.js
+++ b/testing/profiles/unittest/user.js
@@ -185,17 +185,16 @@ user_pref("layout.css.shape-outside.enab
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.autoplay.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.