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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2907053004: GSB uses delta_hints to calculate scrolling chain. (Closed)
Patch Set: review comments addressed. Created 3 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/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index fb67c0a2a7cebd460ebb6603629618e325f3d669..f6b502823f67b16b166b6bbd6f38c7f8978c495b 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -9903,13 +9903,18 @@ class WebFrameOverscrollTest
if (type == WebInputEvent::kGestureScrollUpdate) {
event.data.scroll_update.delta_x = delta_x;
event.data.scroll_update.delta_y = delta_y;
+ } else if (type == WebInputEvent::kGestureScrollBegin) {
+ event.data.scroll_begin.delta_x_hint = delta_x;
+ event.data.scroll_begin.delta_y_hint = delta_y;
}
return WebCoalescedInputEvent(event);
}
- void ScrollBegin(FrameTestHelpers::WebViewHelper* web_view_helper) {
- web_view_helper->WebView()->HandleInputEvent(
- GenerateEvent(WebInputEvent::kGestureScrollBegin));
+ void ScrollBegin(FrameTestHelpers::WebViewHelper* web_view_helper,
+ float delta_x_hint,
+ float delta_y_hint) {
+ web_view_helper->WebView()->HandleInputEvent(GenerateEvent(
+ WebInputEvent::kGestureScrollBegin, delta_x_hint, delta_y_hint));
}
void ScrollUpdate(FrameTestHelpers::WebViewHelper* web_view_helper,
@@ -9942,7 +9947,7 @@ TEST_P(WebFrameOverscrollTest,
// Calculation of accumulatedRootOverscroll and unusedDelta on multiple
// scrollUpdate.
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, -300, -316);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(8, 16), WebFloatSize(8, 16),
WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&web_view_helper, -308, -316);
@@ -9990,7 +9995,7 @@ TEST_P(WebFrameOverscrollTest,
ConfigureAndroid);
web_view_helper.Resize(WebSize(200, 200));
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -316);
// Scroll the Div to the end.
EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
@@ -9998,7 +10003,7 @@ TEST_P(WebFrameOverscrollTest,
Mock::VerifyAndClearExpectations(&client);
ScrollEnd(&web_view_helper);
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -100);
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 100), WebFloatSize(0, 100),
@@ -10037,7 +10042,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
ConfigureAndroid);
web_view_helper.Resize(WebSize(200, 200));
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -316);
// Scroll the Div to the end.
EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
@@ -10045,7 +10050,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
Mock::VerifyAndClearExpectations(&client);
ScrollEnd(&web_view_helper);
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -150);
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
@@ -10064,7 +10069,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
nullptr, ConfigureAndroid);
web_view_helper.Resize(WebSize(200, 200));
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -320);
// Scroll the IFrame to the end.
EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
@@ -10078,7 +10083,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
Mock::VerifyAndClearExpectations(&client);
ScrollEnd(&web_view_helper);
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, -150);
// Now On Scrolling IFrame, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
@@ -10102,7 +10107,7 @@ TEST_P(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) {
// Calculation of accumulatedRootOverscroll and unusedDelta on scaled page.
// The point is (99, 99) because we clamp in the division by 3 to 33 so when
// we go back to viewport coordinates it becomes (99, 99).
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 0, 30);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -30),
WebFloatPoint(99, 99), WebFloatSize()));
ScrollUpdate(&web_view_helper, 0, 30);
@@ -10140,7 +10145,7 @@ TEST_P(WebFrameOverscrollTest, NoOverscrollForSmallvalues) {
ConfigureAndroid);
web_view_helper.Resize(WebSize(200, 200));
- ScrollBegin(&web_view_helper);
+ ScrollBegin(&web_view_helper, 10, 10);
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(-10, -10), WebFloatSize(-10, -10),
WebFloatPoint(100, 100), WebFloatSize()));

Powered by Google App Engine
This is Rietveld 408576698