2008-12-17 Pamela Greene <pam@chromium.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Dec 2008 21:11:57 +0000 (21:11 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Dec 2008 21:11:57 +0000 (21:11 +0000)
        Reviewed by Darin Adler.
        Landed by Adam Barth.

        https://bugs.webkit.org/show_bug.cgi?id=22612
        Add test to verify type enforcement in DOM setters.

        * fast/dom/setter-type-enforcement-expected.txt: Added.
        * fast/dom/setter-type-enforcement.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39363 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
fast/dom/setter-type-enforcement-expected.txt [new file with mode: 0644]
fast/dom/setter-type-enforcement.html [new file with mode: 0644]

index f2bb6d9..b954645 100644 (file)
@@ -1,3 +1,14 @@
+2008-12-17  Pamela Greene  <pam@chromium.org>
+
+        Reviewed by Darin Adler.
+        Landed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22612
+        Add test to verify type enforcement in DOM setters.
+
+        * fast/dom/setter-type-enforcement-expected.txt: Added.
+        * fast/dom/setter-type-enforcement.html: Added.
+
 2008-12-17  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
 
         Rubber-stamped by Timothy Hatcher.
diff --git a/fast/dom/setter-type-enforcement-expected.txt b/fast/dom/setter-type-enforcement-expected.txt
new file mode 100644 (file)
index 0000000..57a26f7
--- /dev/null
@@ -0,0 +1,22 @@
+Tests type enforcement on DOM setters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.body = nodelist; threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.
+PASS table.tHead = nodelist; threw exception Error: NOT_FOUND_ERR: DOM Exception 8.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+Tests type enforcement on DOM setters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.body = nodelist; threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.
+PASS table.tHead = nodelist; threw exception Error: NOT_FOUND_ERR: DOM Exception 8.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/fast/dom/setter-type-enforcement.html b/fast/dom/setter-type-enforcement.html
new file mode 100644 (file)
index 0000000..5032a09
--- /dev/null
@@ -0,0 +1,52 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Tests type enforcement on DOM setters.");
+
+// NodeList is not a Node, so document.body can't be set to one.
+var nodelist = document.getElementsByName('sillypants');
+shouldThrow("document.body = nodelist;");
+
+// NodeList is also not an HTMLTableSectionElement.
+var table = document.createElement('table');
+shouldThrow("table.tHead = nodelist;");
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Tests type enforcement on DOM setters.");
+
+// NodeList is not a Node, so document.body can't be set to one.
+var nodelist = document.getElementsByName('sillypants');
+shouldThrow("document.body = nodelist;");
+
+// NodeList is also not an HTMLTableSectionElement.
+var table = document.createElement('table');
+shouldThrow("table.tHead = nodelist;");
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+