Commit 35818794 authored by alwu's avatar alwu
Browse files

Bug 1509933 - part3 : use the new pref in tests. r=padenot

This patch will do :
- replace the old pref with the new pref

The advantage of doing so :
- to ensure those tests can still use the correct blocking autoplay policy

Differential Revision: https://phabricator.services.mozilla.com/D73973
parent 793612ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ function setup_test_preference(enableScript) {
  return SpecialPowers.pushPrefEnv({
    set: [
      ["media.autoplay.default", 1],
      ["media.autoplay.enabled.user-gestures-needed", true],
      ["media.autoplay.blocking_policy", 0],
      ["media.autoplay.allow-extension-background-pages", enableScript],
    ],
  });
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
let manager = new MediaTestManager;

gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
                ["media.autoplay.enabled.user-gestures-needed", true]);
                ["media.autoplay.blocking_policy", 0]);

window.info = function(msg, token) {
  SimpleTest.info(msg + ", token=" + token);
@@ -78,7 +78,7 @@ function createTestArray()
 * Main test function for different autoplay cases without user interaction.
 *
 * When the pref "media.autoplay.default" is 1 and the pref
 * "media.autoplay.enabled.user-gestures-needed" is true, we only allow
 * "media.autoplay.blocking_policy" is 0, we only allow
 * audible media to autoplay after the website has been activated by specific
 * user gestures. However, inaudible media won't be restricted.
 *
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
        // which have been activated by same-origin user gesture.

        gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
                        ["media.autoplay.enabled.user-gestures-needed", true]);
                        ["media.autoplay.blocking_policy", 0]);

        SpecialPowers.pushPrefEnv({'set': gTestPrefs}, () => {
          runTest();
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
        // Tests that we gesture activate on mousedown and keydown.

        gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
          ["media.autoplay.enabled.user-gestures-needed", true]);
          ["media.autoplay.blocking_policy", 0]);

        SpecialPowers.pushPrefEnv({ 'set': gTestPrefs }, () => {
          runTest();
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
        // audible autoplay.

        gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
          ["media.autoplay.enabled.user-gestures-needed", true]);
          ["media.autoplay.blocking_policy", 0]);

        SpecialPowers.pushPrefEnv({ 'set': gTestPrefs }, () => {
          runTest();
Loading