Bug 1513039 - part11 : remove pref 'media.autoplay.ask-permission'. r=cpearce
authoralwu <alwu@mozilla.com>
Mon, 07 Jan 2019 18:41:58 +0000
changeset 512763 df38df5ce11e
parent 512762 2e48b6769911
child 512764 b67708aaec68
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1513039
milestone66.0a1
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 1513039 - part11 : remove pref 'media.autoplay.ask-permission'. r=cpearce Depends on D14335 Differential Revision: https://phabricator.services.mozilla.com/D14336
browser/app/profile/firefox.js
browser/components/extensions/test/browser/browser_ext_autoplayInBackground.js
dom/media/test/test_autoplay_policy_permission.html
mobile/android/app/mobile.js
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/MediaElementTest.kt
toolkit/content/tests/browser/browser_autoplay_videoDocument.js
toolkit/content/tests/browser/browser_block_autoplay_media.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1460,26 +1460,23 @@ pref("media.gmp.trial-create.enabled", t
 #ifdef MOZ_WIDEVINE_EME
 pref("media.gmp-widevinecdm.visible", true);
 pref("media.gmp-widevinecdm.enabled", true);
 #endif
 
 #ifdef NIGHTLY_BUILD
 // Switch block autoplay logic to v2, and enable UI.
 pref("media.autoplay.enabled.user-gestures-needed", true);
-// Allow asking for permission to autoplay to appear in UI.
-pref("media.autoplay.ask-permission", false);
 // Set Firefox to block autoplay, asking for permission by default.
 pref("media.autoplay.default", 1); // 0=Allowed, 1=Blocked
 // Block WebAudio from playing automatically.
 pref("media.autoplay.block-webaudio", true);
 #else
 pref("media.autoplay.default", 0); // 0=Allowed, 1=Blocked
 pref("media.autoplay.enabled.user-gestures-needed", false);
-pref("media.autoplay.ask-permission", false);
 pref("media.autoplay.block-webaudio", false);
 #endif
 
 
 // Play with different values of the decay time and get telemetry,
 // 0 means to randomize (and persist) the experiment value in users' profiles,
 // -1 means no experiment is run and we use the preferred value for frecency (6h)
 pref("browser.cache.frecency_experiment", 0);
--- a/browser/components/extensions/test/browser/browser_ext_autoplayInBackground.js
+++ b/browser/components/extensions/test/browser/browser_ext_autoplayInBackground.js
@@ -1,15 +1,14 @@
 "use strict";
 
 function setup_test_preference(enableScript) {
   return SpecialPowers.pushPrefEnv({"set": [
     ["media.autoplay.default", 1],
     ["media.autoplay.enabled.user-gestures-needed", true],
-    ["media.autoplay.ask-permission", true],
     ["media.autoplay.allow-extension-background-pages", enableScript],
   ]});
 }
 
 async function testAutoplayInBackgroundScript(enableScript) {
   info(`- setup test preference, enableScript=${enableScript} -`);
   await setup_test_preference(enableScript);
 
--- a/dom/media/test/test_autoplay_policy_permission.html
+++ b/dom/media/test/test_autoplay_policy_permission.html
@@ -11,20 +11,17 @@
 
 <body>
   <pre id="test">
       <script>
 
         // Tests that origins with "autoplay-media" permission can autoplay.
 
         gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
-          ["media.autoplay.enabled.user-gestures-needed", true],
-          // Note: permission prompt disabled, as we want immediate
-          // notification in this test that an origin is blocked.
-          ["media.autoplay.ask-permission", false]);
+          ["media.autoplay.enabled.user-gestures-needed", true]);
 
         SpecialPowers.pushPrefEnv({ 'set': gTestPrefs }, () => {
           runTest();
         });
 
         async function testPlayInOrigin(testCase) {
           // Run test in a new window, to ensure its user gesture
           // activation state isn't tainted by preceeding tests.
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -579,24 +579,21 @@ pref("media.video-queue.send-to-composit
 // Enable MSE
 pref("media.mediasource.enabled", true);
 
 pref("media.mediadrm-widevinecdm.visible", true);
 
 #ifdef NIGHTLY_BUILD
 // Switch block autoplay logic to v2.
 pref("media.autoplay.enabled.user-gestures-needed", true);
-// UI/prompting for permission isn't implemented for Fennec, so disable.
-pref("media.autoplay.ask-permission", false);
 // Set Fennec to block autoplay by default.
 pref("media.autoplay.default", 1); // 0=Allowed, 1=Blocked
 #else
 pref("media.autoplay.default", 0); // 0=Allowed, 1=Blocked
 pref("media.autoplay.enabled.user-gestures-needed", false);
-pref("media.autoplay.ask-permission", false);
 #endif
 
 // Enable WebSpeech speech synthesis
 pref("media.webspeech.synth.enabled", true);
 
 // optimize images memory usage
 pref("image.downscale-during-decode.enabled", true);
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/MediaElementTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/MediaElementTest.kt
@@ -35,17 +35,16 @@ class MediaElementTest : BaseSessionTest
         override fun onFullscreenChange(mediaElement: MediaElement, fullscreen: Boolean) {}
         override fun onError(mediaElement: MediaElement, errorCode: Int) {}
     }
 
     private fun setupPrefsAndDelegates(path: String) {
         sessionRule.setPrefsUntilTestEnd(mapOf(
                 "media.autoplay.enabled.user-gestures-needed" to false,
                 "media.autoplay.default" to 0,
-                "media.autoplay.ask-permission" to false,
                 "full-screen-api.allow-trusted-requests-only" to false))
 
         sessionRule.session.loadTestPath(path)
         sessionRule.waitUntilCalled(object : Callbacks.MediaDelegate {
             @AssertCalled
             override fun onMediaAdd(session: GeckoSession, element: MediaElement) {
                 sessionRule.addExternalDelegateUntilTestEnd(
                         MediaElementDelegate::class,
--- a/toolkit/content/tests/browser/browser_autoplay_videoDocument.js
+++ b/toolkit/content/tests/browser/browser_autoplay_videoDocument.js
@@ -1,17 +1,16 @@
 "use strict";
 
 const PAGE = "https://example.com/browser/toolkit/content/tests/browser/audio.ogg";
 
 function setup_test_preference() {
   return SpecialPowers.pushPrefEnv({"set": [
     ["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
     ["media.autoplay.enabled.user-gestures-needed", true],
-    ["media.autoplay.ask-permission", true],
   ]});
 }
 
 function checkIsVideoDocumentAutoplay(browser) {
   return ContentTask.spawn(browser, null, async () => {
     const video = content.document.getElementsByTagName("video")[0];
     const played = video && await video.play().then(() => true, () => false);
     ok(played, "Should be able to play in video document.");
--- a/toolkit/content/tests/browser/browser_block_autoplay_media.js
+++ b/toolkit/content/tests/browser/browser_block_autoplay_media.js
@@ -80,17 +80,16 @@ add_task(async function block_autoplay_m
   // in that tab, even if it's in an autoplay-blocked origin.
   //
   // Also test that that this block-autoplay logic override doesn't survive
   // a new document being loaded into the tab; the new document should have
   // to satisfy the autoplay requirements on its own.
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
     ["media.autoplay.enabled.user-gestures-needed", true],
-    ["media.autoplay.ask-permission", true],
   ]});
 
   info("- open new background tab4 -");
   let tab4 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
   BrowserTestUtils.loadURI(tab4.linkedBrowser, PAGE);
   await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
   info("- should block autoplay for non-visited tab4 -");
   await check_audio_suspended(tab4.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);