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

Side by Side Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2289593006: Fix recording of kAnimatingScrollOnMain (Closed)
Patch Set: update comment Created 4 years, 3 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
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/test/histogram_tester.h" 10 #include "base/test/histogram_tester.h"
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 input_handler_->RecordMainThreadScrollingReasonsForTest( 2778 input_handler_->RecordMainThreadScrollingReasonsForTest(
2779 blink::WebGestureDeviceTouchpad, 2779 blink::WebGestureDeviceTouchpad,
2780 cc::MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects | 2780 cc::MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects |
2781 cc::MainThreadScrollingReason::kThreadedScrollingDisabled | 2781 cc::MainThreadScrollingReason::kThreadedScrollingDisabled |
2782 cc::MainThreadScrollingReason::kPageOverlay | 2782 cc::MainThreadScrollingReason::kPageOverlay |
2783 cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread); 2783 cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
2784 2784
2785 EXPECT_THAT( 2785 EXPECT_THAT(
2786 histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"), 2786 histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
2787 testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1), 2787 testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),
2788 base::Bucket(5, 1)));
2789
2790 // We only want to record "animating scroll on main thread" reason if it's the
2791 // only reason. If it's not the only reason, the "real" reason for scrolling
2792 // on main is something else, and we only want to pay attention to that
2793 // reason. So we should only include this reason in the histogram when its on
2794 // its own.
2795 input_handler_->RecordMainThreadScrollingReasonsForTest(
2796 blink::WebGestureDeviceTouchpad,
2797 cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
2798
2799 EXPECT_THAT(
2800 histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
2801 testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),
2788 base::Bucket(5, 1), base::Bucket(14, 1))); 2802 base::Bucket(5, 1), base::Bucket(14, 1)));
2789 } 2803 }
2790 2804
2791 2805
2792 INSTANTIATE_TEST_CASE_P(AnimateInput, 2806 INSTANTIATE_TEST_CASE_P(AnimateInput,
2793 InputHandlerProxyTest, 2807 InputHandlerProxyTest,
2794 testing::ValuesIn(test_types)); 2808 testing::ValuesIn(test_types));
2795 } // namespace test 2809 } // namespace test
2796 } // namespace ui 2810 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698