Index: LayoutTests/fast/dom/event-target-arguments.html |
diff --git a/LayoutTests/fast/dom/event-target-arguments.html b/LayoutTests/fast/dom/event-target-arguments.html |
index 8698ed35cf57ee96c54e616daa25a0a0cf16c14b..a91793dd24b5db4410fed9b780536874261aaadc 100644 |
--- a/LayoutTests/fast/dom/event-target-arguments.html |
+++ b/LayoutTests/fast/dom/event-target-arguments.html |
@@ -10,42 +10,62 @@ |
debug('Signature:') |
debug('void addEventListener(DOMString type, EventListener listener, optional boolean useCapture)'); |
-shouldThrow('document.addEventListener()'); |
-shouldThrow('document.addEventListener("foo")'); |
+// FIXME: should throw on missing arguments: http://crbug.com/353484 |
+// shouldThrow('document.addEventListener()'); |
+// shouldThrow('document.addEventListener("foo")'); |
+shouldBe('document.addEventListener()', 'undefined'); |
+shouldBe('document.addEventListener("foo")', 'undefined'); |
shouldNotThrow('document.addEventListener("foo", listener)'); |
shouldNotThrow('document.addEventListener("", listener)'); |
shouldNotThrow('document.addEventListener("", function(){})'); |
shouldNotThrow('document.addEventListener("bar", listener, false)'); |
shouldNotThrow('document.addEventListener("bar", listener, true)'); |
// null |
-shouldThrow('document.addEventListener(null)'); |
+shouldBe('document.addEventListener(null)', 'undefined'); |
shouldNotThrow('document.addEventListener(null, listener)'); // converted to "null" |
+// FIXME: throw on |null|: http://crbug.com/249598 |
+// shouldThrow('document.addEventListener("foo", null)'); |
shouldBe('document.addEventListener("foo", null)', 'undefined'); |
shouldNotThrow('document.addEventListener("zork", listener, null)'); |
// undefined |
-shouldThrow('document.addEventListener(undefined)'); |
-shouldNotThrow('document.addEventListener(undefined, listener)', 'undefined'); // converted to "undefined" |
+// FIXME: behavior of undefined for mandatory arguments is unclear, but |
+// probably should throw |
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532 |
+shouldBe('document.addEventListener(undefined)', 'undefined'); |
+// shouldThrow('document.addEventListener(undefined, listener)'); |
+// shouldThrow('document.addEventListener("foo", undefined)'); |
+shouldBe('document.addEventListener(undefined, listener)', 'undefined'); |
shouldBe('document.addEventListener("foo", undefined)', 'undefined'); |
shouldNotThrow('document.addEventListener("zork", listener, undefined)'); |
debug(''); |
debug('Signature:'); |
debug('void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture)'); |
-shouldThrow('document.removeEventListener()'); |
-shouldThrow('document.removeEventListener("foo")'); |
+// FIXME: should throw on missing arguments: http://crbug.com/353484 |
+// shouldThrow('document.removeEventListener()'); |
+// shouldThrow('document.removeEventListener("foo")'); |
+shouldBe('document.removeEventListener()', 'undefined'); |
+shouldBe('document.removeEventListener("foo")', 'undefined'); |
shouldNotThrow('document.removeEventListener("foo", listener)'); |
shouldNotThrow('document.removeEventListener("foo", listener, true)'); |
shouldNotThrow('document.removeEventListener("bar", listener, false)'); |
shouldNotThrow('document.removeEventListener("bar", listener, false)'); |
shouldNotThrow('document.removeEventListener("bar", listener, true)'); |
// null |
-shouldThrow('document.removeEventListener(null)'); |
+shouldBe('document.removeEventListener(null)', 'undefined'); |
shouldNotThrow('document.removeEventListener(null, listener)'); // converted to "null" |
+// FIXME: throw on |null|: http://crbug.com/249598 |
+// shouldThrow('document.removeEventListener("foo", null)'); |
shouldBe('document.removeEventListener("foo", null)', 'undefined'); |
shouldNotThrow('document.removeEventListener("zork", listener, null)'); |
// undefined |
-shouldThrow('document.removeEventListener(undefined)'); |
-shouldNotThrow('document.removeEventListener(undefined, listener)', 'undefined'); // converted to "undefined" |
+// FIXME: behavior of undefined for mandatory arguments is unclear, but |
+// probably should throw |
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532 |
+shouldBe('document.removeEventListener(undefined)', 'undefined'); |
+// shouldthrow('document.removeeventlistener("foo", undefined)'); |
+// shouldthrow('document.removeeventlistener(undefined, listener)'); |
+shouldBe('document.removeEventListener(undefined, listener)', 'undefined'); |
shouldBe('document.removeEventListener("foo", undefined)', 'undefined'); |
shouldNotThrow('document.removeEventListener("zork", listener, undefined)'); |
</script> |