Commit e23a88c5 authored by vollick's avatar vollick Committed by Commit bot

Fix recording of kAnimatingScrollOnMain

We only want to record this reason if it's the only scroll reason (as it
obscures others).

BUG=None

Review-Url: https://codereview.chromium.org/2289593006
Cr-Commit-Position: refs/heads/master@{#415382}
parent 1ba33d9e
...@@ -427,6 +427,14 @@ void InputHandlerProxy::RecordMainThreadScrollingReasons( ...@@ -427,6 +427,14 @@ void InputHandlerProxy::RecordMainThreadScrollingReasons(
++i) { ++i) {
unsigned val = 1 << i; unsigned val = 1 << i;
if (reasons & val) { if (reasons & val) {
if (val == cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread) {
// We only want to record "animating scroll on main thread" reason if
// it's the only reason. If it's not the only reason, the "real" reason
// for scrolling on main is something else, and we only want to pay
// attention to that reason.
if (reasons & ~val)
continue;
}
if (device == blink::WebGestureDeviceTouchscreen) { if (device == blink::WebGestureDeviceTouchscreen) {
UMA_HISTOGRAM_ENUMERATION( UMA_HISTOGRAM_ENUMERATION(
kGestureHistogramName, i + 1, kGestureHistogramName, i + 1,
......
...@@ -2782,6 +2782,20 @@ TEST_P(InputHandlerProxyTest, MainThreadScrollingMouseWheelHistograms) { ...@@ -2782,6 +2782,20 @@ TEST_P(InputHandlerProxyTest, MainThreadScrollingMouseWheelHistograms) {
cc::MainThreadScrollingReason::kPageOverlay | cc::MainThreadScrollingReason::kPageOverlay |
cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread); cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
EXPECT_THAT(
histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),
base::Bucket(5, 1)));
// We only want to record "animating scroll on main thread" reason if it's the
// only reason. If it's not the only reason, the "real" reason for scrolling
// on main is something else, and we only want to pay attention to that
// reason. So we should only include this reason in the histogram when its on
// its own.
input_handler_->RecordMainThreadScrollingReasonsForTest(
blink::WebGestureDeviceTouchpad,
cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
EXPECT_THAT( EXPECT_THAT(
histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"), histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1), testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment