Title: [96827] trunk/LayoutTests
Revision
96827
Author
commit-qu...@webkit.org
Date
2011-10-06 10:22:45 -0700 (Thu, 06 Oct 2011)

Log Message

Test how DOMTokenList methods react to too few arguments
https://bugs.webkit.org/show_bug.cgi?id=66537

Patch by Mark Pilgrim <pilg...@chromium.org> on 2011-10-06
Reviewed by Darin Adler.

* fast/dom/HTMLElement/class-list-expected.txt:
* fast/dom/HTMLElement/script-tests/class-list.js:
(createElement):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96826 => 96827)


--- trunk/LayoutTests/ChangeLog	2011-10-06 17:14:11 UTC (rev 96826)
+++ trunk/LayoutTests/ChangeLog	2011-10-06 17:22:45 UTC (rev 96827)
@@ -1,3 +1,29 @@
+2011-10-06  Mark Pilgrim  <pilg...@chromium.org>
+
+        Test how DOMTokenList methods react to too few arguments
+        https://bugs.webkit.org/show_bug.cgi?id=66537
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/HTMLElement/class-list-expected.txt:
+        * fast/dom/HTMLElement/script-tests/class-list.js:
+        (createElement):
+
+2011-10-06  Adam Barth  <aba...@webkit.org>
+
+        Add missing tests for LegacyDefaultOptionalArguments for setCustomValidity
+        https://bugs.webkit.org/show_bug.cgi?id=69532
+
+        Reviewed by Darin Adler.
+
+        These APIs are relatively new and it's unlikely that many folks will
+        call them without their argument.  Making the parameters required
+        aligns WebKit more closely with the specifications for this API at
+        minimal compatibility cost.
+
+        * fast/dom/set-custom-validity-with-too-few-arguments-expected.txt: Added.
+        * fast/dom/set-custom-validity-with-too-few-arguments.html: Added.
+
 2011-10-06  Sergey Glazunov  <serg.glazu...@gmail.com>
 
         Add check for _javascript_ URLs in HTMLPlugInImageElement::allowedToLoadFrameURL

Modified: trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt (96826 => 96827)


--- trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt	2011-10-06 17:14:11 UTC (rev 96826)
+++ trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt	2011-10-06 17:22:45 UTC (rev 96827)
@@ -31,10 +31,13 @@
 PASS element.classList.contains('x y') threw expected DOMException with code 5
 PASS element.classList.add('') threw expected DOMException with code 12
 PASS element.classList.add('x y') threw expected DOMException with code 5
+PASS element.classList.add() threw exception TypeError: Not enough arguments.
 PASS element.classList.remove('') threw expected DOMException with code 12
 PASS element.classList.remove('x y') threw expected DOMException with code 5
+PASS element.classList.remove() threw exception TypeError: Not enough arguments.
 PASS element.classList.toggle('') threw expected DOMException with code 12
 PASS element.classList.toggle('x y') threw expected DOMException with code 5
+PASS element.classList.toggle() threw exception TypeError: Not enough arguments.
 Indexing
 PASS element.classList[0] is "x"
 PASS element.classList.item(0) is "x"
@@ -48,10 +51,12 @@
 PASS element.classList.item(4) is null
 PASS element.classList[-1] is undefined.
 PASS element.classList.item(-1) is null
+PASS element.classList.item() threw exception TypeError: Not enough arguments.
 Test case since DOMTokenList is case sensitive
 PASS element.classList.contains('x') is true
 PASS element.classList.contains('X') is false
 PASS element.classList[0] is "x"
+PASS element.classList.contains() threw exception TypeError: Not enough arguments.
 PASS element.classList.contains('X') is true
 PASS element.classList.contains('x') is false
 PASS element.classList[0] is "X"

Modified: trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt (96826 => 96827)


--- trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt	2011-10-06 17:14:11 UTC (rev 96826)
+++ trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt	2011-10-06 17:22:45 UTC (rev 96827)
@@ -31,10 +31,13 @@
 PASS element.classList.contains('x y') threw expected DOMException with code 5
 PASS element.classList.add('') threw expected DOMException with code 12
 PASS element.classList.add('x y') threw expected DOMException with code 5
+PASS element.classList.add() threw exception TypeError: Not enough arguments.
 PASS element.classList.remove('') threw expected DOMException with code 12
 PASS element.classList.remove('x y') threw expected DOMException with code 5
+PASS element.classList.remove() threw exception TypeError: Not enough arguments.
 PASS element.classList.toggle('') threw expected DOMException with code 12
 PASS element.classList.toggle('x y') threw expected DOMException with code 5
+PASS element.classList.toggle() threw exception TypeError: Not enough arguments.
 Indexing
 PASS element.classList[0] is "x"
 PASS element.classList.item(0) is "x"
@@ -48,10 +51,12 @@
 PASS element.classList.item(4) is null
 PASS element.classList[-1] is undefined.
 PASS element.classList.item(-1) is null
+PASS element.classList.item() threw exception TypeError: Not enough arguments.
 Test case since DOMTokenList is case sensitive
 PASS element.classList.contains('x') is true
 PASS element.classList.contains('X') is false
 PASS element.classList[0] is "x"
+PASS element.classList.contains() threw exception TypeError: Not enough arguments.
 PASS element.classList.contains('X') is true
 PASS element.classList.contains('x') is false
 PASS element.classList[0] is "X"

Modified: trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js (96826 => 96827)


--- trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js	2011-10-06 17:14:11 UTC (rev 96826)
+++ trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js	2011-10-06 17:22:45 UTC (rev 96827)
@@ -154,6 +154,9 @@
 }, DOMException.INVALID_CHARACTER_ERR);
 
 createElement('');
+shouldThrow("element.classList.add()");
+
+createElement('');
 shouldThrowDOMException(function() {
     element.classList.remove('');
 }, DOMException.SYNTAX_ERR);
@@ -164,6 +167,9 @@
 }, DOMException.INVALID_CHARACTER_ERR);
 
 createElement('');
+shouldThrow("element.classList.remove()");
+
+createElement('');
 shouldThrowDOMException(function() {
     element.classList.toggle('');
 }, DOMException.SYNTAX_ERR);
@@ -173,6 +179,8 @@
     element.classList.toggle('x y');
 }, DOMException.INVALID_CHARACTER_ERR);
 
+createElement('');
+shouldThrow("element.classList.toggle()");
 
 debug('Indexing');
 
@@ -197,6 +205,7 @@
 shouldBeNull('element.classList.item(4)');
 shouldBeUndefined('element.classList[-1]');  // Not a valid index so should not trigger item().
 shouldBeNull('element.classList.item(-1)');
+shouldThrow('element.classList.item()');
 
 debug('Test case since DOMTokenList is case sensitive');
 
@@ -204,6 +213,7 @@
 shouldBeTrue('element.classList.contains(\'x\')');
 shouldBeFalse('element.classList.contains(\'X\')');
 shouldBeEqualToString('element.classList[0]', 'x');
+shouldThrow('element.classList.contains()');
 
 createElement('X');
 shouldBeTrue('element.classList.contains(\'X\')');

Added: trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments-expected.txt (0 => 96827)


--- trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments-expected.txt	2011-10-06 17:22:45 UTC (rev 96827)
@@ -0,0 +1,13 @@
+Test how setCustomValidity reacts to too few arguments.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS b.setCustomValidity() threw exception TypeError: Not enough arguments.
+PASS fs.setCustomValidity() threw exception TypeError: Not enough arguments.
+PASS i.setCustomValidity() threw exception TypeError: Not enough arguments.
+PASS k.setCustomValidity() threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments.html (0 => 96827)


--- trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments.html	2011-10-06 17:22:45 UTC (rev 96827)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description('Test how setCustomValidity reacts to too few arguments.');
+
+var b = document.createElement('button');
+shouldThrow("b.setCustomValidity()");
+
+var fs = document.createElement('fieldset');
+shouldThrow("fs.setCustomValidity()");
+
+var i = document.createElement('input');
+shouldThrow("i.setCustomValidity()");
+
+var k = document.createElement('keygen');
+shouldThrow("k.setCustomValidity()");
+
+successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to