diff --git a/content/media/webaudio/test/webaudio.js b/content/media/webaudio/test/webaudio.js new file mode 100644 index 000000000000..4de8715b8b2f --- /dev/null +++ b/content/media/webaudio/test/webaudio.js @@ -0,0 +1,14 @@ +// Helpers for Web Audio tests + +function expectException(func, exceptionCode) { + var threw = false; + try { + func(); + } catch (ex) { + threw = true; + ok(ex instanceof DOMException, "Expect a DOM exception"); + ok(ex.code, exceptionCode, "Expect the correct exception code"); + } + ok(threw, "The exception was thrown"); +} +