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

Unified Diff: LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg.html

Issue 148323008: Update HTMLCollection's named property getter to behave according to spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideation Created 6 years, 10 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/html-collections-named-getter-mandatory-arg-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg.html
diff --git a/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg.html b/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg.html
new file mode 100644
index 0000000000000000000000000000000000000000..596a33482eda8b525c8999d8fe44cf9156657da0
--- /dev/null
+++ b/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test.js"></script>
+<a id="testLink"></a>
+<script>
+description("This tests verifies that HTMLCollection.namedItem() argument is mandatory");
+
+var testLink = document.getElementById("testLink");
+var htmlCollection = document.getElementsByTagName("a");
+shouldBe("htmlCollection.__proto__", "HTMLCollection.prototype");
+shouldBe("htmlCollection.length", "1");
+shouldBe("htmlCollection.namedItem('testLink')", "testLink");
+shouldThrow("htmlCollection.namedItem()", '"TypeError: Failed to execute \'namedItem\' on \'HTMLCollection\': 1 argument required, but only 0 present."');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698