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

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

Issue 2869803003: Change from ClientRect to DOMRect.
Patch Set: Change from ClientRect to DOMRect. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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"
6 #include "core/frame/LocalFrameView.h" 5 #include "core/frame/LocalFrameView.h"
7 #include "core/frame/WebLocalFrameBase.h" 6 #include "core/frame/WebLocalFrameBase.h"
7 #include "core/geometry/DOMRect.h"
8 #include "core/input/EventHandler.h" 8 #include "core/input/EventHandler.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/paint/PaintLayerScrollableArea.h" 10 #include "core/paint/PaintLayerScrollableArea.h"
11 #include "core/testing/sim/SimDisplayItemList.h" 11 #include "core/testing/sim/SimDisplayItemList.h"
12 #include "core/testing/sim/SimRequest.h" 12 #include "core/testing/sim/SimRequest.h"
13 #include "core/testing/sim/SimTest.h" 13 #include "core/testing/sim/SimTest.h"
14 #include "platform/scroll/MainThreadScrollingReason.h" 14 #include "platform/scroll/MainThreadScrollingReason.h"
15 #include "platform/scroll/ScrollerSizeMetrics.h" 15 #include "platform/scroll/ScrollerSizeMetrics.h"
16 #include "platform/testing/HistogramTester.h" 16 #include "platform/testing/HistogramTester.h"
17 #include "platform/testing/TestingPlatformSupport.h" 17 #include "platform/testing/TestingPlatformSupport.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 ++index; 94 ++index;
95 } 95 }
96 DCHECK_EQ(reason, 1u); 96 DCHECK_EQ(reason, 1u);
97 return index; 97 return index;
98 } 98 }
99 99
100 void ScrollMetricsTest::Scroll(Element* element, 100 void ScrollMetricsTest::Scroll(Element* element,
101 const WebGestureDevice device) { 101 const WebGestureDevice device) {
102 DCHECK(element); 102 DCHECK(element);
103 DCHECK(element->getBoundingClientRect()); 103 DCHECK(element->getBoundingClientRect());
104 ClientRect* rect = element->getBoundingClientRect(); 104 DOMRect* rect = element->getBoundingClientRect();
105 ScrollBeginEventBuilder scroll_begin( 105 ScrollBeginEventBuilder scroll_begin(
106 IntPoint(rect->left() + rect->width() / 2, 106 IntPoint(rect->left() + rect->width() / 2,
107 rect->top() + rect->height() / 2), 107 rect->top() + rect->height() / 2),
108 FloatPoint(0.f, 1.f), device); 108 FloatPoint(0.f, 1.f), device);
109 ScrollUpdateEventBuilder scroll_update; 109 ScrollUpdateEventBuilder scroll_update;
110 ScrollEndEventBuilder scroll_end; 110 ScrollEndEventBuilder scroll_end;
111 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_begin); 111 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_begin);
112 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_update); 112 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_update);
113 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_end); 113 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_end);
114 ASSERT_GT(scroll_update.DeltaYInRootFrame(), 0); 114 ASSERT_GT(scroll_update.DeltaYInRootFrame(), 0);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); 349 EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1);
350 EXPECT_WHEEL_BUCKET(kIsNotStackingContextAndLCDText, 1); 350 EXPECT_WHEEL_BUCKET(kIsNotStackingContextAndLCDText, 1);
351 EXPECT_WHEEL_BUCKET(kHasBorderRadius, 1); 351 EXPECT_WHEEL_BUCKET(kHasBorderRadius, 1);
352 EXPECT_WHEEL_BUCKET(kHasTransformAndLCDText, 0); 352 EXPECT_WHEEL_BUCKET(kHasTransformAndLCDText, 0);
353 EXPECT_WHEEL_TOTAL(4); 353 EXPECT_WHEEL_TOTAL(4);
354 } 354 }
355 355
356 } // namespace 356 } // namespace
357 357
358 } // namespace blink 358 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/RootScrollerTest.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