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

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

Issue 2859483006: cc: Enable composited border-radius scrolling.
Patch Set: test-rebaseline 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" 5 #include "core/dom/ClientRect.h"
6 #include "core/frame/LocalFrameView.h" 6 #include "core/frame/LocalFrameView.h"
7 #include "core/frame/WebLocalFrameBase.h" 7 #include "core/frame/WebLocalFrameBase.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"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 EXPECT_WHEEL_TOTAL(2); 312 EXPECT_WHEEL_TOTAL(2);
313 } 313 }
314 314
315 TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, NestedScrollersTest) { 315 TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, NestedScrollersTest) {
316 SetUpHtml( 316 SetUpHtml(
317 "<style>" 317 "<style>"
318 " .container { overflow:scroll; width: 200px; height: 200px; }" 318 " .container { overflow:scroll; width: 200px; height: 200px; }"
319 " .box { overflow:scroll; width: 100px; height: 100px; }" 319 " .box { overflow:scroll; width: 100px; height: 100px; }"
320 " .translucent { opacity: 0.5; }" 320 " .translucent { opacity: 0.5; }"
321 " .transform { transform: scale(0.8); }" 321 " .transform { transform: scale(0.8); }"
322 " .with-border-radius { border: 5px solid; border-radius: 5px; }"
323 " .spacer { height: 1000px; }" 322 " .spacer { height: 1000px; }"
324 " .composited { will-change: transform; }" 323 " .composited { will-change: transform; }"
325 "</style>" 324 "</style>"
326 "<div id='container' class='container with-border-radius'>" 325 "<div id='container' class='container'>"
327 " <div class='translucent box'>" 326 " <div class='translucent box'>"
328 " <div id='inner' class='composited transform box'>" 327 " <div id='inner' class='composited transform box'>"
329 " <div class='spacer'></div>" 328 " <div class='spacer'></div>"
330 " </div>" 329 " </div>"
331 " <div class='spacer'></div>" 330 " <div class='spacer'></div>"
332 " </div>" 331 " </div>"
333 " <div class='spacer'></div>" 332 " <div class='spacer'></div>"
334 "</div>"); 333 "</div>");
335 334
336 WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); 335 WebView().GetSettings()->SetAcceleratedCompositingEnabled(true);
337 GetDocument().View()->SetParentVisible(true); 336 GetDocument().View()->SetParentVisible(true);
338 GetDocument().View()->SetSelfVisible(true); 337 GetDocument().View()->SetSelfVisible(true);
339 GetDocument().View()->UpdateAllLifecyclePhases(); 338 GetDocument().View()->UpdateAllLifecyclePhases();
340 339
341 Element* box = GetDocument().getElementById("inner"); 340 Element* box = GetDocument().getElementById("inner");
342 HistogramTester histogram_tester; 341 HistogramTester histogram_tester;
343 342
344 Scroll(box, kWebGestureDeviceTouchpad); 343 Scroll(box, kWebGestureDeviceTouchpad);
345 // Scrolling the inner box will gather reasons from the scrolling chain. The 344 // Scrolling the inner box will gather reasons from the scrolling chain. The
346 // inner box itself has no reason because it's composited. Other scrollable 345 // inner box itself has no reason because it's composited. Other scrollable
347 // areas from the chain have corresponding reasons. 346 // areas from the chain have corresponding reasons.
348 EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); 347 EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1);
349 EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); 348 EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1);
350 EXPECT_WHEEL_BUCKET(kIsNotStackingContextAndLCDText, 1); 349 EXPECT_WHEEL_BUCKET(kIsNotStackingContextAndLCDText, 1);
351 EXPECT_WHEEL_BUCKET(kHasBorderRadius, 1);
352 EXPECT_WHEEL_BUCKET(kHasTransformAndLCDText, 0); 350 EXPECT_WHEEL_BUCKET(kHasTransformAndLCDText, 0);
353 EXPECT_WHEEL_TOTAL(4); 351 EXPECT_WHEEL_TOTAL(3);
354 } 352 }
355 353
356 } // namespace 354 } // namespace
357 355
358 } // namespace blink 356 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698