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

Unified Diff: LayoutTests/fast/dom/DOMError-constructor.html

Issue 254823007: Make DOMError constructible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline additional test Created 6 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DOMError-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/DOMError-constructor.html
diff --git a/LayoutTests/fast/dom/DOMError-constructor.html b/LayoutTests/fast/dom/DOMError-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..acf0e4205d8a7ea1894d413a84f3aab6d59470c0
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMError-constructor.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://dom.spec.whatwg.org/#dom-domerror">
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Tests that DOMError is constructible.");
+
+var error;
+
+// Passing 2 arguments.
+shouldNotThrow("error = new DOMError('NotFoundError', 'This item was not found.')");
+shouldBeEqualToString("error.name", "NotFoundError");
+shouldBeEqualToString("error.message", "This item was not found.");
+
+// Passing 1 argument. Default value for the second argument should be the empty string.
+shouldNotThrow("error = new DOMError('IndexSizeError')");
+shouldBeEqualToString("error.name", "IndexSizeError");
+shouldBeEqualToString("error.message", "");
+
+// Not passing any argument. First argument should be mandatory.
+shouldThrow("new DOMError()", '"TypeError: Failed to construct \'DOMError\': 1 argument required, but only 0 present."');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DOMError-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698