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

Unified Diff: LayoutTests/fast/dom/event-target-arguments.html

Issue 201603002: Simplify EventTarget bindings generation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't change web behavior Created 6 years, 9 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/event-target-arguments-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..d828867340455a247558db9909e01deac21be9e5
--- /dev/null
+++ b/LayoutTests/fast/dom/event-target-arguments.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<body>
+<script>
+description('EventTarget.addEventListener and EventTarget.removeEventLister should throw on invalid arguments.');
+
+function listener(event)
+{
+}
+
+debug('Signature:')
+debug('void addEventListener(DOMString type, EventListener listener, optional boolean useCapture)');
+// 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
+shouldNotThrow('document.addEventListener(null, listener)'); // converted to "null"
+// FIXME: throw on |null|: http://crbug.com/249598
+// shouldThrow('document.addEventListener("foo", null)');
+shouldNotThrow('document.addEventListener("zork", listener, null)');
+// undefined
+// FIXME: behavior of undefined here is unclear, but probably should throw
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
+// shouldThrow('document.addEventListener(undefined, listener)');
+// shouldThrow('document.addEventListener("foo", undefined)');
+shouldNotThrow('document.addEventListener("zork", listener, undefined)');
+
+debug('');
+debug('Signature:');
+debug('void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture)');
+// 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.addEventListener("bar", listener, true)');
+// null
+shouldNotThrow('document.removeEventListener(null, listener)'); // converted to "null"
+// FIXME: throw on |null|: http://crbug.com/249598
+// shouldThrow('document.removeEventListener("foo", null)');
+shouldNotThrow('document.removeEventListener("zork", listener, null)');
+// undefined
+// FIXME: behavior of undefined here is unclear, but probably should throw
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
+// shouldThrow('document.removeEventListener("foo", undefined)');
+// shouldThrow('document.removeEventListener(undefined, listener)');
+shouldNotThrow('document.removeEventListener("zork", listener, undefined)');
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/event-target-arguments-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698