Bug 1000264 - Stop checking exceptions on decodeAudioData now that it uses promises, and check it in the promise test file instead. r=bz

--HG--
extra : rebase_source : 6860e1ff28b4bbb2d88db5bb5e679fc3da53b169
This commit is contained in:
Paul Adenot 2014-11-14 09:37:39 +01:00
parent 8eedddf1af
commit ee5c85a5ac
2 changed files with 2 additions and 25 deletions

View File

@ -30,8 +30,9 @@ expectNoException(function() {
p.then(function(data) {
ok(false, "Promise should not resolve with an invalid source buffer.");
finish();
}).catch(function() {
}).catch(function(e) {
ok(true, "Promise should be rejected with an invalid source buffer.");
ok(e.name == "TypeError", "The error should be TypeError");
finish();
})
});

View File

@ -359,30 +359,6 @@ function loadNextTest() {
}
}
// Run some simple tests first
function callbackShouldNeverRun() {
ok(false, "callback should not fire");
}
(function() {
var cx = new AudioContext();
expectTypeError(function() {
cx.decodeAudioData(null, callbackShouldNeverRun, callbackShouldNeverRun);
});
expectTypeError(function() {
cx.decodeAudioData(undefined, callbackShouldNeverRun, callbackShouldNeverRun);
});
expectTypeError(function() {
cx.decodeAudioData(123, callbackShouldNeverRun, callbackShouldNeverRun);
});
expectTypeError(function() {
cx.decodeAudioData("buffer", callbackShouldNeverRun, callbackShouldNeverRun);
});
expectTypeError(function() {
cx.decodeAudioData(new Uint8Array(100), callbackShouldNeverRun, callbackShouldNeverRun);
});
})();
// Now, let's get real!
loadNextTest();
</script>