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

Side by Side Diff: LayoutTests/fast/events/scroll-event-handler-count.html

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: One more unneeded include. Created 6 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/scroll-event-handler-count-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 <div id="scrolltarget">
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 description("This test checks that we correctly update the scroll event handler count as event handlers are added and removed");
5 (function() {
6 // Test addEventListener/removeEventListener on the document.
7 var listener = function() { }
8
9 shouldBe('window.internals.scrollEventHandlerCount(document)', '0');
10 document.addEventListener('scroll', listener, true);
11 shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
12 document.addEventListener('scroll', listener, false);
13 shouldBe('window.internals.scrollEventHandlerCount(document)', '2');
14 document.removeEventListener('scroll', listener, true);
15 shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
16
17 // Try removing the capturing listener again.
18 document.removeEventListener('scroll', listener, true);
19 shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
20
21 document.removeEventListener('scroll', listener, false);
22 shouldBe('window.internals.scrollEventHandlerCount(document)', '0');
23 })();
24
25 (function() {
26 // Test setting onscroll on the document.
27
28 shouldBe('window.internals.scrollEventHandlerCount(document)', '0');
29 document.onscroll = function() { }
30 shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
31 document.onscroll = function() { }
32 shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
33 document.onscroll = null;
34 shouldBe('window.internals.scrollEventHandlerCount(document)', '0');
35 })();
36 </script>
37 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/scroll-event-handler-count-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698