Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: LayoutTests/fast/domurl/resources/testharness-extras.js

Issue 143313002: Implement URLSearchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/domurl/resources/testharness-extras.js
diff --git a/LayoutTests/fast/domurl/resources/testharness-extras.js b/LayoutTests/fast/domurl/resources/testharness-extras.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b7661b79315d930c81437978b44817617da295e
--- /dev/null
+++ b/LayoutTests/fast/domurl/resources/testharness-extras.js
@@ -0,0 +1,25 @@
+/*
+Extending the W3C testharness.js with locally useful functionality.
+*/
+
+// 'Untyped' checking of exception messages; for when you want
+// to test the error message returned rather than the exact kind.
+function assert_throws_message(func, expected, name) {
+ try {
+ func();
+ } catch (ex) {
+ assert_equals(String(ex), expected);
+ if (name)
+ assert_equals(ex.name, name);
+ return;
+ }
+ assert_true(false, 'Expected an exception with string: ' + expected);
+}
+
+function assert_type_error(f, msg) {
+ assert_throws(TypeError(), f, msg);
+}
+
+function assert_syntax_error(f, msg) {
+ assert_throws(SyntaxError(), f, msg);
+}

Powered by Google App Engine
This is Rietveld 408576698