OLD | NEW |
---|---|
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 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2773 testing::Mock::VerifyAndClearExpectations(&mock_client); | 2773 testing::Mock::VerifyAndClearExpectations(&mock_client); |
2774 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler); | 2774 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler); |
2775 } | 2775 } |
2776 | 2776 |
2777 TEST_P(InputHandlerProxyTest, MainThreadScrollingMouseWheelHistograms) { | 2777 TEST_P(InputHandlerProxyTest, MainThreadScrollingMouseWheelHistograms) { |
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::kHandlingScrollFromMainThread); |
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))); | 2788 base::Bucket(5, 1))); |
2789 | 2789 |
2790 // We only want to record "animating scroll on main thread" reason if it's the | 2790 // We only want to record "animating scroll on main thread" reason if it's the |
Ian Vollick
2016/09/01 14:26:23
One more spot.
ymalik
2016/09/01 14:43:58
Done.
| |
2791 // only reason. If it's not the only reason, the "real" reason for scrolling | 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 | 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 | 2793 // reason. So we should only include this reason in the histogram when its on |
2794 // its own. | 2794 // its own. |
2795 input_handler_->RecordMainThreadScrollingReasonsForTest( | 2795 input_handler_->RecordMainThreadScrollingReasonsForTest( |
2796 blink::WebGestureDeviceTouchpad, | 2796 blink::WebGestureDeviceTouchpad, |
2797 cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread); | 2797 cc::MainThreadScrollingReason::kHandlingScrollFromMainThread); |
2798 | 2798 |
2799 EXPECT_THAT( | 2799 EXPECT_THAT( |
2800 histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"), | 2800 histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"), |
2801 testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1), | 2801 testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1), |
2802 base::Bucket(5, 1), base::Bucket(14, 1))); | 2802 base::Bucket(5, 1), base::Bucket(14, 1))); |
2803 } | 2803 } |
2804 | 2804 |
2805 | 2805 |
2806 INSTANTIATE_TEST_CASE_P(AnimateInput, | 2806 INSTANTIATE_TEST_CASE_P(AnimateInput, |
2807 InputHandlerProxyTest, | 2807 InputHandlerProxyTest, |
2808 testing::ValuesIn(test_types)); | 2808 testing::ValuesIn(test_types)); |
2809 } // namespace test | 2809 } // namespace test |
2810 } // namespace ui | 2810 } // namespace ui |
OLD | NEW |