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

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

Issue 2718193002: Prevent handle MouseUp when mouse is capture a scrollbar (Closed)
Patch Set: add captured check in mouse up Created 3 years, 9 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/input/scrollbar_animation_controller.cc ('k') | no next file » | 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 11751 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698