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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1686833002: Add knowledge about blocking and passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 4 years, 10 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 | « cc/layers/layer_impl.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698