| 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 11751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11762 // Capture scrollbar_1, then move mouse to scrollbar_2's layer, should post an | 11762 // Capture scrollbar_1, then move mouse to scrollbar_2's layer, should post an |
| 11763 // event to fade out scrollbar_1. | 11763 // event to fade out scrollbar_1. |
| 11764 animation_task_ = base::Closure(); | 11764 animation_task_ = base::Closure(); |
| 11765 | 11765 |
| 11766 host_impl_->MouseDown(); | 11766 host_impl_->MouseDown(); |
| 11767 host_impl_->MouseMoveAt(gfx::Point(100, 150)); | 11767 host_impl_->MouseMoveAt(gfx::Point(100, 150)); |
| 11768 host_impl_->MouseUp(); | 11768 host_impl_->MouseUp(); |
| 11769 | 11769 |
| 11770 EXPECT_FALSE(animation_task_.Equals(base::Closure())); | 11770 EXPECT_FALSE(animation_task_.Equals(base::Closure())); |
| 11771 | 11771 |
| 11772 // Near scrollbar_1, then mouse down and up, should not post an event to fade |
| 11773 // out scrollbar_1. |
| 11774 host_impl_->MouseMoveAt(gfx::Point(40, 150)); |
| 11775 animation_task_ = base::Closure(); |
| 11776 |
| 11777 host_impl_->MouseDown(); |
| 11778 host_impl_->MouseUp(); |
| 11779 EXPECT_TRUE(animation_task_.Equals(base::Closure())); |
| 11780 |
| 11772 // Near scrollbar_1, then mouse down and unregister | 11781 // Near scrollbar_1, then mouse down and unregister |
| 11773 // scrollbar_2_animation_controller, then mouse up should not cause crash. | 11782 // scrollbar_2_animation_controller, then mouse up should not cause crash. |
| 11774 host_impl_->MouseMoveAt(gfx::Point(40, 150)); | 11783 host_impl_->MouseMoveAt(gfx::Point(40, 150)); |
| 11775 host_impl_->MouseDown(); | 11784 host_impl_->MouseDown(); |
| 11776 host_impl_->UnregisterScrollbarAnimationController(root_scroll->id()); | 11785 host_impl_->UnregisterScrollbarAnimationController(root_scroll->id()); |
| 11777 host_impl_->MouseUp(); | 11786 host_impl_->MouseUp(); |
| 11778 } | 11787 } |
| 11779 | 11788 |
| 11780 TEST_F(LayerTreeHostImplTest, | 11789 TEST_F(LayerTreeHostImplTest, |
| 11781 LayerTreeHostImplTestScrollbarStatesInMainThreadScorlling) { | 11790 LayerTreeHostImplTestScrollbarStatesInMainThreadScorlling) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11858 else | 11867 else |
| 11859 EXPECT_FALSE(tile->HasRasterTask()); | 11868 EXPECT_FALSE(tile->HasRasterTask()); |
| 11860 } | 11869 } |
| 11861 Region expected_invalidation( | 11870 Region expected_invalidation( |
| 11862 raster_source->GetRectForImage(checkerable_image->uniqueID())); | 11871 raster_source->GetRectForImage(checkerable_image->uniqueID())); |
| 11863 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); | 11872 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); |
| 11864 } | 11873 } |
| 11865 | 11874 |
| 11866 } // namespace | 11875 } // namespace |
| 11867 } // namespace cc | 11876 } // namespace cc |
| OLD | NEW |