Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / wheelevent-handler-count.html
blobdf812fe9e6cf44951fcf2a7865835ab0602a1f80
1 <script src="../../resources/js-test.js"></script>
2 <script>
3 description("This test checks that we correctly update the wheel event handler count as event handlers are added and removed");
5 (function() {
6 // Test addEventListener/removeEventListener on the document.
7 var listener = function() { }
9 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
10 document.addEventListener('mousewheel', listener, true);
11 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
12 document.addEventListener('mousewheel', listener, false);
13 shouldBe('window.internals.wheelEventHandlerCount(document)', '2');
14 document.removeEventListener('mousewheel', listener, true);
15 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
17 // Try removing the capturing listener again.
18 document.removeEventListener('mousewheel', listener, true);
19 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
21 document.removeEventListener('mousewheel', listener, false);
22 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
23 })();
25 (function() {
26 // Test setting onmousewheel on the document.
28 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
29 document.onmousewheel = function() { }
30 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
31 document.onmousewheel = function() { }
32 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
33 document.onmousewheel = null;
34 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
35 })();
37 (function() {
38 // Test addEventListener/removeEventListener on the window.
39 var listener = function() { }
41 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
42 window.addEventListener('mousewheel', listener, true);
43 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
44 window.addEventListener('mousewheel', listener, false);
45 shouldBe('window.internals.wheelEventHandlerCount(document)', '2');
46 window.removeEventListener('mousewheel', listener, true);
47 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
49 // Try removing the capturing listener again.
50 window.removeEventListener('mousewheel', listener, true);
51 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
53 window.removeEventListener('mousewheel', listener, false);
54 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
55 })();
57 (function() {
58 // Test setting onmousewheel on the window.
59 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
60 window.onmousewheel = function() { }
61 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
62 window.onmousewheel = function() { }
63 shouldBe('window.internals.wheelEventHandlerCount(document)', '1');
64 window.onmousewheel = null;
65 shouldBe('window.internals.wheelEventHandlerCount(document)', '0');
66 })();
68 </script>
69 </body>