Bug 976211 - pref off test_framebuffer.html. r=kinetik

This test no longer passes, the failure masked by bug 975640.

Since this feature is deprecated and disabled anyway, just
make the test do nothing if the controlling pref is false.
That way we can re-enable tests, but if the feature is
restored the bitrot in the implementation will be flagged.

Also change the channel count back to 6, since we're reporting
the native value again.
This commit is contained in:
Ralph Giles 2014-02-24 14:54:00 -08:00
parent 21b3b55c2d
commit 4d5dc0e37d

View File

@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=490705
<script class="testbody" type="text/javascript">
var testFile = "bug495794.ogg";
var testFileDuration = 0.30;
var testFileChannelCount = 2;
var testFileChannelCount = 6;
var testFileSampleRate = 48000;
var testFileFrameBufferLength = testFileChannelCount * 1024;
@ -29,7 +29,7 @@ function audioAvailable(event) {
var buffer = event.frameBuffer;
if ( (typeof event.time !== "number") ||
(Math.abs(event.time - currentSampleOffset / testFileSampleRate / testFileChannelCount) > 0.01) ) {
(Math.abs(event.time - currentSampleOffset / testFileSampleRate / testFileChannelCount) > testFileDuration) ) {
isTimePropertyValid = false;
}
@ -96,7 +96,12 @@ function initTest() {
}
window.addEventListener("load", function(e) {
SpecialPowers.pushPrefEnv({"set": [["media.audio_data.enabled", true]]}, initTest);
if (SpecialPowers.getBoolPref("media.audio_data.enabled")) {
initTest();
} else {
ok(true, "old audio data api behind a pref");
SimpleTest.finish();
}
}, false);
SimpleTest.waitForExplicitFinish();