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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-event-fired-window-resized.html

Issue 2096783004: Seperate visualviewportchanged event into scroll and resize events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script>
5 var numCallsScroll = 0;
6 var numCallsResize = 0;
7
8 var t = async_test('verify that the scroll events get fired when the window is resized.');
bokan 2016/06/24 21:52:36 This should be testing the resize event is fired w
ymalik 2016/06/27 14:10:01 Absolutely!
9
10 window.onload = t.step_func(function() {
11 testRunner.useUnfortunateSynchronousResizeMode();
12
13 // Turn off smooth scrolling.
14 internals.settings.setScrollAnimatorEnabled(false);
15
16 window.visualViewport.addEventListener('scroll', function(e) {
17 numCallsScroll++;
18 });
19
20 window.visualViewport.addEventListener('resize', function(e) {
21 numCallsResize++;
22 });
23
24 window.resizeTo(window.outerWidth - 24, window.outerHeight - 24);
25 requestAnimationFrame(function() {
26 assert_equals(numCallsScroll, 1);
27 assert_equals(numCallsResize, 0);
28 window.resizeTo(window.outerWidth + 24, window.outerHeight + 24);
29 requestAnimationFrame(function() {
30 assert_equals(numCallsScroll, 2);
31 assert_equals(numCallsResize, 0);
32 t.done();
33 });
34 });
35 });
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698