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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/event-target-arguments-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // FIXME: should throw on missing arguments: http://crbug.com/353484
14 // shouldThrow('document.addEventListener()');
15 // shouldThrow('document.addEventListener("foo")');
16 shouldBe('document.addEventListener()', 'undefined');
17 shouldBe('document.addEventListener("foo")', 'undefined');
18 shouldNotThrow('document.addEventListener("foo", listener)');
19 shouldNotThrow('document.addEventListener("", listener)');
20 shouldNotThrow('document.addEventListener("", function(){})');
21 shouldNotThrow('document.addEventListener("bar", listener, false)');
22 shouldNotThrow('document.addEventListener("bar", listener, true)');
23 // null
24 shouldNotThrow('document.addEventListener(null, listener)'); // converted to "nu ll"
25 // FIXME: throw on |null|: http://crbug.com/249598
26 // shouldThrow('document.addEventListener("foo", null)');
27 shouldNotThrow('document.addEventListener("zork", listener, null)');
28 // undefined
29 // FIXME: behavior of undefined here is unclear, but probably should throw
30 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
31 // shouldThrow('document.addEventListener(undefined, listener)');
32 // shouldThrow('document.addEventListener("foo", undefined)');
33 shouldNotThrow('document.addEventListener("zork", listener, undefined)');
34
35 debug('');
36 debug('Signature:');
37 debug('void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture)');
38 // FIXME: should throw on missing arguments: http://crbug.com/353484
39 // shouldThrow('document.removeEventListener()');
40 // shouldThrow('document.removeEventListener("foo")');
41 shouldBe('document.removeEventListener()', 'undefined');
42 shouldBe('document.removeEventListener("foo")', 'undefined');
43 shouldNotThrow('document.removeEventListener("foo", listener)');
44 shouldNotThrow('document.removeEventListener("foo", listener, true)');
45 shouldNotThrow('document.removeEventListener("bar", listener, false)');
46 shouldNotThrow('document.removeEventListener("bar", listener, false)');
47 shouldNotThrow('document.addEventListener("bar", listener, true)');
48 // null
49 shouldNotThrow('document.removeEventListener(null, listener)'); // converted to "null"
50 // FIXME: throw on |null|: http://crbug.com/249598
51 // shouldThrow('document.removeEventListener("foo", null)');
52 shouldNotThrow('document.removeEventListener("zork", listener, null)');
53 // undefined
54 // FIXME: behavior of undefined here is unclear, but probably should throw
55 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532
56 // shouldThrow('document.removeEventListener("foo", undefined)');
57 // shouldThrow('document.removeEventListener(undefined, listener)');
58 shouldNotThrow('document.removeEventListener("zork", listener, undefined)');
59 </script>
OLDNEW
« 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