Bug 1307055. Part 2 - remove unnecessary pref settings and unused functions. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 03 Oct 2016 15:20:31 +0800
changeset 420992 7d847d28e0497338954531bd6ecbce8fef025dd3
parent 420991 10091c2cddef8a6823eb88a5c47c88a3b077732b
child 420993 17ed0634d52acc1d208c281bf49c9c996d8b08bc
push id31342
push userjwwang@mozilla.com
push dateWed, 05 Oct 2016 02:28:48 +0000
bugs1307055
milestone52.0a1
Bug 1307055. Part 2 - remove unnecessary pref settings and unused functions. MozReview-Commit-ID: IQHrWAwrMMZ
dom/media/mediasource/test/mediasource.js
dom/media/test/manifest.js
dom/media/test/test_access_control.html
dom/media/test/test_streams_autoplay.html
--- a/dom/media/mediasource/test/mediasource.js
+++ b/dom/media/mediasource/test/mediasource.js
@@ -14,17 +14,16 @@ function runWithMSE(testFunction) {
     });
 
     testFunction(ms, el);
   }
 
   addLoadEvent(function () {
     SpecialPowers.pushPrefEnv({"set": [
       [ "media.mediasource.enabled", true ],
-      [ "media.test.dumpDebugInfo", true ],
     ]},
                               bootstrapTest);
   });
 }
 
 function fetchWithXHR(uri, onLoadFunction) {
   var p = new Promise(function(resolve, reject) {
     var xhr = new XMLHttpRequest();
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -1540,19 +1540,16 @@ function Log(token, msg) {
 
 // Number of tests to run in parallel.
 var PARALLEL_TESTS = 2;
 
 // Prefs to set before running tests.  Use this to improve coverage of
 // conditions that might not otherwise be encountered on the test data.
 var gTestPrefs = [
   ['media.recorder.max_memory', 1024],
-  ["media.preload.default", 2], // default preload = metadata
-  ["media.preload.auto", 3], // auto preload = enough
-  ["media.test.dumpDebugInfo", true],
 ];
 
 // When true, we'll loop forever on whatever test we run. Use this to debug
 // intermittent test failures.
 const DEBUG_TEST_LOOP_FOREVER = false;
 
 // Manages a run of media tests. Runs them in chunks in order to limit
 // the number of media elements/threads running in parallel. This limits peak
@@ -1697,24 +1694,16 @@ function mediaTestCleanup(callback) {
     var A = document.getElementsByTagName("audio");
     for (i=0; i<A.length; i++) {
       removeNodeAndSource(A[i]);
       A[i] = null;
     }
     SpecialPowers.exactGC(callback);
 }
 
-function setMediaTestsPrefs(callback, extraPrefs) {
-  var prefs = gTestPrefs;
-  if (extraPrefs) {
-    prefs = prefs.concat(extraPrefs);
-  }
-  SpecialPowers.pushPrefEnv({"set": prefs}, callback);
-}
-
 // B2G emulator and Android 2.3 are condidered slow platforms
 function isSlowPlatform() {
   return SpecialPowers.Services.appinfo.name == "B2G" || getAndroidVersion() == 10;
 }
 
 // Could be undefined in a page opened by the parent test page
 // like file_access_controls.html.
 if ("SimpleTest" in window) {
--- a/dom/media/test/test_access_control.html
+++ b/dom/media/test/test_access_control.html
@@ -23,19 +23,17 @@ function run() {
   window.open("http://example.org:80/tests/dom/media/test/file_access_controls.html", "", "width=500,height=500");
 }
 
 function done() {
   mediaTestCleanup();
   SimpleTest.finish();
 }
 
-addLoadEvent(function() {
-  setMediaTestsPrefs(run);
-});
+addLoadEvent(run);
 SimpleTest.waitForExplicitFinish();
 
 
 window.addEventListener("message", receiveMessage, false);
 
 function receiveMessage(event)
 {
   if (event.origin !== "http://example.org") {
--- a/dom/media/test/test_streams_autoplay.html
+++ b/dom/media/test/test_streams_autoplay.html
@@ -32,15 +32,15 @@ if (media == null) {
     };
 
     v2.addEventListener('playing', function() {
       ok(true, "playback started");
       SimpleTest.finish();
     }, {once: true});
   }
 
-  setMediaTestsPrefs(startTest);
+  startTest();
 }
 
 </script>
 </pre>
 </body>
 </html>