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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-event-fired-window-resized.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-event-fired-window-resized.html b/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-event-fired-window-resized.html
new file mode 100644
index 0000000000000000000000000000000000000000..1355a6450883ae840c8f090ae25eb7dcc743608f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-event-fired-window-resized.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+ var numCallsScroll = 0;
+ var numCallsResize = 0;
+
+ 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!
+
+ window.onload = t.step_func(function() {
+ testRunner.useUnfortunateSynchronousResizeMode();
+
+ // Turn off smooth scrolling.
+ internals.settings.setScrollAnimatorEnabled(false);
+
+ window.visualViewport.addEventListener('scroll', function(e) {
+ numCallsScroll++;
+ });
+
+ window.visualViewport.addEventListener('resize', function(e) {
+ numCallsResize++;
+ });
+
+ window.resizeTo(window.outerWidth - 24, window.outerHeight - 24);
+ requestAnimationFrame(function() {
+ assert_equals(numCallsScroll, 1);
+ assert_equals(numCallsResize, 0);
+ window.resizeTo(window.outerWidth + 24, window.outerHeight + 24);
+ requestAnimationFrame(function() {
+ assert_equals(numCallsScroll, 2);
+ assert_equals(numCallsResize, 0);
+ t.done();
+ });
+ });
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698