OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 // have to go to the main thread. | 718 // have to go to the main thread. |
719 host_impl_->active_tree()->set_event_listener_properties( | 719 host_impl_->active_tree()->set_event_listener_properties( |
720 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking); | 720 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking); |
721 InputHandler::ScrollStatus status = | 721 InputHandler::ScrollStatus status = |
722 host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), | 722 host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), |
723 InputHandler::WHEEL); | 723 InputHandler::WHEEL); |
724 EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread); | 724 EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread); |
725 EXPECT_EQ(MainThreadScrollingReason::kEventHandlers, | 725 EXPECT_EQ(MainThreadScrollingReason::kEventHandlers, |
726 status.main_thread_scrolling_reasons); | 726 status.main_thread_scrolling_reasons); |
727 | 727 |
| 728 host_impl_->active_tree()->set_event_listener_properties( |
| 729 EventListenerClass::kMouseWheel, |
| 730 EventListenerProperties::kBlockingAndPassive); |
| 731 status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), |
| 732 InputHandler::WHEEL); |
| 733 EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread); |
| 734 EXPECT_EQ(MainThreadScrollingReason::kEventHandlers, |
| 735 status.main_thread_scrolling_reasons); |
| 736 |
728 // But gesture scrolls can still be handled. | 737 // But gesture scrolls can still be handled. |
729 status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), | 738 status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), |
730 InputHandler::GESTURE); | 739 InputHandler::GESTURE); |
731 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); | 740 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); |
732 EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain, | 741 EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain, |
733 status.main_thread_scrolling_reasons); | 742 status.main_thread_scrolling_reasons); |
734 host_impl_->ScrollEnd(EndState().get()); | 743 host_impl_->ScrollEnd(EndState().get()); |
735 | 744 |
736 // And if the handlers go away, wheel scrolls can again be processed | 745 // And if the handlers go away, wheel scrolls can again be processed |
737 // on impl. | 746 // on impl. |
(...skipping 9258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9996 // There should not be any jitter measured till we hit the fixed point hits | 10005 // There should not be any jitter measured till we hit the fixed point hits |
9997 // threshold. | 10006 // threshold. |
9998 float expected_jitter = | 10007 float expected_jitter = |
9999 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; | 10008 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; |
10000 EXPECT_EQ(jitter, expected_jitter); | 10009 EXPECT_EQ(jitter, expected_jitter); |
10001 } | 10010 } |
10002 } | 10011 } |
10003 | 10012 |
10004 } // namespace | 10013 } // namespace |
10005 } // namespace cc | 10014 } // namespace cc |
OLD | NEW |