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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/viewport/resize-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: fix crash + tests 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-resize-events-fired.html » ('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/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 resize events get fired when the window is resized.');
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 t.step(function() {
27 assert_equals(numCallsScroll, 0, "resize 1 doesn't fire scroll event");
28 assert_equals(numCallsResize, 1, "resize 1 fires resize event");
29 });
30 window.resizeTo(window.outerWidth + 24, window.outerHeight + 24);
31 requestAnimationFrame(function() {
32 t.step(function() {
33 assert_equals(numCallsScroll, 0, "resize 2 doesn't fire scroll event") ;
34 assert_equals(numCallsResize, 2, "resize 2 fires resize event");
35 t.done();
36 });
37 });
38 });
39 });
40 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-resize-events-fired.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698