Bug 1307055. Part 2 - remove unnecessary pref settings and unused functions.
MozReview-Commit-ID: IQHrWAwrMMZ
--- 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>