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

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

Issue 2907053004: GSB uses delta_hints to calculate scrolling chain. (Closed)
Patch Set: Merged with master. 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 2d31f85568e5356c8f8dc3222ffaa0c97a135619..4c519c3ca498f5728e33eae90dfdaf845a5885ac 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -10116,13 +10116,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,
@@ -10155,7 +10160,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);
@@ -10203,7 +10208,7 @@ TEST_P(WebFrameOverscrollTest,
nullptr, 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);
@@ -10211,7 +10216,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),
@@ -10250,7 +10255,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
nullptr, 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);
@@ -10258,7 +10263,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),
@@ -10277,7 +10282,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);
@@ -10291,7 +10296,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),
@@ -10315,7 +10320,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);
@@ -10353,7 +10358,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