b=1069113 explicitly unset media.mediasource.enabled when testing disabling of MediaSource r=kinetik

so that web platform tests can be run with MediaSource enabled.

--HG--
extra : transplant_source : %C9%01%A22%DF%8C%89%CF%7E6%0E%FCR%EE%0E%BE%15%B1%D2%92
This commit is contained in:
Karl Tomlinson 2014-09-12 17:29:35 +12:00
parent 725e2a6db0
commit 8cab8ff617
3 changed files with 29 additions and 6 deletions

View File

@ -8,6 +8,7 @@ support-files =
[test_BufferedSeek.html]
[test_FrameSelection.html]
[test_MediaSource.html]
[test_MediaSource_disabled.html]
[test_SeekableAfterEndOfStream.html]
[test_SeekableAfterEndOfStreamSplit.html]
[test_SeekableBeforeEndOfStream.html]

View File

@ -12,12 +12,6 @@
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
ok(!window.MediaSource && !window.SourceBuffer && !window.SourceBufferList,
"MediaSource should be hidden behind a pref");
SimpleTest.doesThrow(() => new MediaSource, "MediaSource should be hidden behind a pref");
});
runWithMSE(function () {
SimpleTest.doesThrow(() => new SourceBuffer, "new SourceBuffer should fail");
SimpleTest.doesThrow(() => new SourceBufferList, "new SourceBufferList direct should fail");

View File

@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html>
<head>
<title>MSE: disabling via pref</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
function test() {
ok(!window.MediaSource && !window.SourceBuffer && !window.SourceBufferList,
"MediaSource should be hidden behind a pref");
SimpleTest.doesThrow(() => new MediaSource,
"MediaSource should be hidden behind a pref");
SimpleTest.finish();
}
SpecialPowers.pushPrefEnv({"set": [["media.mediasource.enabled", false]]},
test);
</script>
</pre>
</body>
</html>