aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/resources/testharness.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/resources/testharness.js')
-rw-r--r--tests/wpt/web-platform-tests/resources/testharness.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/resources/testharness.js b/tests/wpt/web-platform-tests/resources/testharness.js
index 23b8651bb13..86ecc1ba252 100644
--- a/tests/wpt/web-platform-tests/resources/testharness.js
+++ b/tests/wpt/web-platform-tests/resources/testharness.js
@@ -1247,6 +1247,13 @@ policies and contribution forms [3].
}
expose(assert_readonly, "assert_readonly");
+ /**
+ * Assert an Exception with the expected code is thrown.
+ *
+ * @param {object|number|string} code The expected exception code.
+ * @param {Function} func Function which should throw.
+ * @param {string} description Error description for the case that the error is not thrown.
+ */
function assert_throws(code, func, description)
{
try {