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

Side by Side Diff: LayoutTests/fast/events/event-listener-arguments.html

Issue 201603002: Simplify EventTarget bindings generation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Much more extensive 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <body>
4 <script>
5 description('EventTarget.addEventListener and EventTarget.removeEventLister shou ld throw on invalid arguments.');
6
7 function listener(event)
8 {
9 }
10
11 debug('Signature:')
12 debug('void addEventListener(DOMString type, EventListener listener, optional bo olean useCapture)');
13 shouldThrow('document.addEventListener()');
14 shouldThrow('document.addEventListener("foo")');
15 shouldNotThrow('document.addEventListener("foo", listener)');
16 shouldNotThrow('document.addEventListener("", listener)');
17 shouldNotThrow('document.addEventListener("", function(){})');
18 shouldNotThrow('document.addEventListener("bar", listener, false)');
19 shouldNotThrow('document.addEventListener("bar", listener, true)');
20 // null
21 shouldNotThrow('document.addEventListener(null, listener)'); // converted to "nu ll"
22 // FIXME: throw on |null|: http://crbug.com/249598
23 // shouldThrow('document.addEventListener("foo", null)');
24 shouldNotThrow('document.addEventListener("zork", listener, null)');
25 // undefined
26 // FIXME: behavior of undefined here is unclear, but probably should throw
27 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
28 // shouldThrow('document.addEventListener(undefined, listener)');
29 // shouldThrow('document.addEventListener("foo", undefined)');
30 shouldNotThrow('document.addEventListener("zork", listener, undefined)');
31
32 debug('');
33 debug('Signature:');
34 debug('void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture)');
35 shouldThrow('document.removeEventListener()');
36 shouldThrow('document.removeEventListener("foo")');
37 shouldNotThrow('document.removeEventListener("foo", listener)');
38 shouldNotThrow('document.removeEventListener("foo", listener, true)');
39 shouldNotThrow('document.removeEventListener("bar", listener, false)');
40 shouldNotThrow('document.removeEventListener("bar", listener, false)');
41 shouldNotThrow('document.addEventListener("bar", listener, true)');
42 // null
43 shouldNotThrow('document.removeEventListener(null, listener)'); // converted to "null"
44 // FIXME: throw on |null|: http://crbug.com/249598
45 // shouldThrow('document.removeEventListener("foo", null)');
46 shouldNotThrow('document.removeEventListener("zork", listener, null)');
47 // undefined
48 // FIXME: behavior of undefined here is unclear, but probably should throw
49 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
50 // shouldThrow('document.removeEventListener("foo", undefined)');
51 // shouldThrow('document.removeEventListener(undefined, listener)');
52 shouldNotThrow('document.removeEventListener("zork", listener, undefined)');
53 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/event-listener-arguments-expected.txt » ('j') | Source/bindings/templates/methods.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698