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

Side by Side Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Rebase Created 3 years, 10 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/ClientRect.h" 5 #include "core/dom/ClientRect.h"
6 #include "core/frame/BrowserControls.h" 6 #include "core/frame/BrowserControls.h"
7 #include "core/frame/FrameHost.h" 7 #include "core/frame/FrameHost.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/RootFrameViewport.h" 9 #include "core/frame/RootFrameViewport.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 BrowserControls& browserControls() const { 119 BrowserControls& browserControls() const {
120 return frameHost().browserControls(); 120 return frameHost().browserControls();
121 } 121 }
122 122
123 Node* effectiveRootScroller(Document* doc) const { 123 Node* effectiveRootScroller(Document* doc) const {
124 return &doc->rootScrollerController().effectiveRootScroller(); 124 return &doc->rootScrollerController().effectiveRootScroller();
125 } 125 }
126 126
127 WebGestureEvent generateTouchGestureEvent(WebInputEvent::Type type, 127 WebCoalescedInputEvent generateTouchGestureEvent(WebInputEvent::Type type,
128 int deltaX = 0, 128 int deltaX = 0,
129 int deltaY = 0) { 129 int deltaY = 0) {
130 return generateGestureEvent(type, WebGestureDeviceTouchscreen, deltaX, 130 return generateGestureEvent(type, WebGestureDeviceTouchscreen, deltaX,
131 deltaY); 131 deltaY);
132 } 132 }
133 133
134 WebGestureEvent generateWheelGestureEvent(WebInputEvent::Type type, 134 WebCoalescedInputEvent generateWheelGestureEvent(WebInputEvent::Type type,
135 int deltaX = 0, 135 int deltaX = 0,
136 int deltaY = 0) { 136 int deltaY = 0) {
137 return generateGestureEvent(type, WebGestureDeviceTouchpad, deltaX, deltaY); 137 return generateGestureEvent(type, WebGestureDeviceTouchpad, deltaX, deltaY);
138 } 138 }
139 139
140 protected: 140 protected:
141 WebGestureEvent generateGestureEvent(WebInputEvent::Type type, 141 WebCoalescedInputEvent generateGestureEvent(WebInputEvent::Type type,
142 WebGestureDevice device, 142 WebGestureDevice device,
143 int deltaX, 143 int deltaX,
144 int deltaY) { 144 int deltaY) {
145 WebGestureEvent event(type, WebInputEvent::NoModifiers, 145 WebGestureEvent event(type, WebInputEvent::NoModifiers,
146 WebInputEvent::TimeStampForTesting); 146 WebInputEvent::TimeStampForTesting);
147 event.sourceDevice = device; 147 event.sourceDevice = device;
148 event.x = 100; 148 event.x = 100;
149 event.y = 100; 149 event.y = 100;
150 if (type == WebInputEvent::GestureScrollUpdate) { 150 if (type == WebInputEvent::GestureScrollUpdate) {
151 event.data.scrollUpdate.deltaX = deltaX; 151 event.data.scrollUpdate.deltaX = deltaX;
152 event.data.scrollUpdate.deltaY = deltaY; 152 event.data.scrollUpdate.deltaY = deltaY;
153 } 153 }
154 return event; 154 return WebCoalescedInputEvent(event);
155 } 155 }
156 156
157 WebViewImpl* initializeInternal(const std::string& url, 157 WebViewImpl* initializeInternal(const std::string& url,
158 FrameTestHelpers::TestWebViewClient* client) { 158 FrameTestHelpers::TestWebViewClient* client) {
159 RuntimeEnabledFeatures::setSetRootScrollerEnabled(true); 159 RuntimeEnabledFeatures::setSetRootScrollerEnabled(true);
160 160
161 m_helper.initializeAndLoad(url, true, nullptr, client, nullptr, 161 m_helper.initializeAndLoad(url, true, nullptr, client, nullptr,
162 &configureSettings); 162 &configureSettings);
163 163
164 // Initialize browser controls to be shown. 164 // Initialize browser controls to be shown.
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 // FrameView without a layout. 1312 // FrameView without a layout.
1313 iframe->remove(); 1313 iframe->remove();
1314 1314
1315 EXPECT_EQ(mainFrameView()->layoutViewportScrollableArea(), 1315 EXPECT_EQ(mainFrameView()->layoutViewportScrollableArea(),
1316 &mainFrameView()->getRootFrameViewport()->layoutViewport()); 1316 &mainFrameView()->getRootFrameViewport()->layoutViewport());
1317 } 1317 }
1318 1318
1319 } // namespace 1319 } // namespace
1320 1320
1321 } // namespace blink 1321 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/LinkSelectionTest.cpp ('k') | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698