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 11735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11746 | 11746 |
11747 // Capture scrollbar_1, then move mouse to scrollbar_2's layer, should post an | 11747 // Capture scrollbar_1, then move mouse to scrollbar_2's layer, should post an |
11748 // event to fade out scrollbar_1. | 11748 // event to fade out scrollbar_1. |
11749 animation_task_ = base::Closure(); | 11749 animation_task_ = base::Closure(); |
11750 | 11750 |
11751 host_impl_->MouseDown(); | 11751 host_impl_->MouseDown(); |
11752 host_impl_->MouseMoveAt(gfx::Point(100, 150)); | 11752 host_impl_->MouseMoveAt(gfx::Point(100, 150)); |
11753 host_impl_->MouseUp(); | 11753 host_impl_->MouseUp(); |
11754 | 11754 |
11755 EXPECT_FALSE(animation_task_.Equals(base::Closure())); | 11755 EXPECT_FALSE(animation_task_.Equals(base::Closure())); |
| 11756 |
| 11757 // Near scrollbar_1, then mouse down and unregister |
| 11758 // scrollbar_2_animation_controller, then mouse up should not cause crash. |
| 11759 host_impl_->MouseMoveAt(gfx::Point(40, 150)); |
| 11760 host_impl_->MouseDown(); |
| 11761 host_impl_->UnregisterScrollbarAnimationController(root_scroll->id()); |
| 11762 host_impl_->MouseUp(); |
11756 } | 11763 } |
11757 | 11764 |
11758 TEST_F(LayerTreeHostImplTest, | 11765 TEST_F(LayerTreeHostImplTest, |
11759 LayerTreeHostImplTestScrollbarStatesInMainThreadScorlling) { | 11766 LayerTreeHostImplTestScrollbarStatesInMainThreadScorlling) { |
11760 SetupMouseMoveAtTestScrollbarStates(true); | 11767 SetupMouseMoveAtTestScrollbarStates(true); |
11761 } | 11768 } |
11762 | 11769 |
11763 TEST_F(LayerTreeHostImplTest, | 11770 TEST_F(LayerTreeHostImplTest, |
11764 LayerTreeHostImplTestScrollbarStatesInNotMainThreadScorlling) { | 11771 LayerTreeHostImplTestScrollbarStatesInNotMainThreadScorlling) { |
11765 SetupMouseMoveAtTestScrollbarStates(false); | 11772 SetupMouseMoveAtTestScrollbarStates(false); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11836 else | 11843 else |
11837 EXPECT_FALSE(tile->HasRasterTask()); | 11844 EXPECT_FALSE(tile->HasRasterTask()); |
11838 } | 11845 } |
11839 Region expected_invalidation( | 11846 Region expected_invalidation( |
11840 raster_source->GetRectForImage(checkerable_image->uniqueID())); | 11847 raster_source->GetRectForImage(checkerable_image->uniqueID())); |
11841 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); | 11848 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); |
11842 } | 11849 } |
11843 | 11850 |
11844 } // namespace | 11851 } // namespace |
11845 } // namespace cc | 11852 } // namespace cc |
OLD | NEW |