mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
25 lines
546 B
JavaScript
25 lines
546 B
JavaScript
// 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");
|
|
}
|
|
|
|
function expectTypeError(func) {
|
|
var threw = false;
|
|
try {
|
|
func();
|
|
} catch (ex) {
|
|
threw = true;
|
|
ok(ex instanceof TypeError, "Expect a TypeError");
|
|
}
|
|
ok(threw, "The exception was thrown");
|
|
}
|