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

Unified Diff: views/controls/single_split_view_unittest.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/single_split_view.cc ('k') | views/controls/textfield/native_textfield_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/single_split_view_unittest.cc
diff --git a/views/controls/single_split_view_unittest.cc b/views/controls/single_split_view_unittest.cc
index 65fbb0061ef61f8ddc63f6437797d2c010929fc7..f88052808882fbc50544676e77404b3f442e29ce 100644
--- a/views/controls/single_split_view_unittest.cc
+++ b/views/controls/single_split_view_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -133,9 +133,9 @@ TEST(SingleSplitViewTest, MouseDrag) {
ON_CALL(observer, SplitHandleMoved(_))
.WillByDefault(Return(true));
- // SplitHandleMoved is expected to be called once for every mouse move.
+ // SplitHandleMoved is called for two mouse moves and one mouse capture loss.
EXPECT_CALL(observer, SplitHandleMoved(_))
- .Times(2);
+ .Times(3);
split.SetBounds(0, 0, 10, 100);
const int kInitialDividerOffset = 33;
@@ -166,9 +166,14 @@ TEST(SingleSplitViewTest, MouseDrag) {
MouseEvent mouse_released(
ui::ET_MOUSE_RELEASED, 7,
kInitialDividerOffset + kMouseOffset + kMouseMoveDelta * 2, 0);
- split.OnMouseReleased(mouse_released, false);
+ split.OnMouseReleased(mouse_released);
EXPECT_EQ(kInitialDividerOffset + kMouseMoveDelta * 2,
split.divider_offset());
+
+ // Expect intial offset after a system/user gesture cancels the drag.
+ // This shouldn't occur after mouse release, but it's sufficient for testing.
+ split.OnMouseCaptureLost();
+ EXPECT_EQ(kInitialDividerOffset, split.divider_offset());
}
} // namespace views
« no previous file with comments | « views/controls/single_split_view.cc ('k') | views/controls/textfield/native_textfield_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698