OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/views/controls/single_split_view.h" | 5 #include "ui/views/controls/single_split_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/views/controls/single_split_view_listener.h" | 9 #include "ui/views/controls/single_split_view_listener.h" |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(SingleSplitViewListenerImpl); | 58 DISALLOW_COPY_AND_ASSIGN(SingleSplitViewListenerImpl); |
59 }; | 59 }; |
60 | 60 |
61 class MinimumSizedView: public views::View { | 61 class MinimumSizedView: public views::View { |
62 public: | 62 public: |
63 MinimumSizedView(gfx::Size min_size) : min_size_(min_size) {} | 63 MinimumSizedView(gfx::Size min_size) : min_size_(min_size) {} |
64 | 64 |
65 private: | 65 private: |
66 gfx::Size min_size_; | 66 gfx::Size min_size_; |
67 virtual gfx::Size GetMinimumSize() OVERRIDE; | 67 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
68 }; | 68 }; |
69 | 69 |
70 gfx::Size MinimumSizedView::GetMinimumSize() { | 70 gfx::Size MinimumSizedView::GetMinimumSize() const { |
71 return min_size_; | 71 return min_size_; |
72 } | 72 } |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 namespace views { | 76 namespace views { |
77 | 77 |
78 TEST(SingleSplitViewTest, Resize) { | 78 TEST(SingleSplitViewTest, Resize) { |
79 // Test cases to iterate through for horizontal and vertical split views. | 79 // Test cases to iterate through for horizontal and vertical split views. |
80 struct TestCase { | 80 struct TestCase { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 split.divider_offset()); | 221 split.divider_offset()); |
222 | 222 |
223 // Expect intial offset after a system/user gesture cancels the drag. | 223 // Expect intial offset after a system/user gesture cancels the drag. |
224 // This shouldn't occur after mouse release, but it's sufficient for testing. | 224 // This shouldn't occur after mouse release, but it's sufficient for testing. |
225 split.OnMouseCaptureLost(); | 225 split.OnMouseCaptureLost(); |
226 EXPECT_EQ(kInitialDividerOffset, split.divider_offset()); | 226 EXPECT_EQ(kInitialDividerOffset, split.divider_offset()); |
227 EXPECT_EQ(5, listener.count()); | 227 EXPECT_EQ(5, listener.count()); |
228 } | 228 } |
229 | 229 |
230 } // namespace views | 230 } // namespace views |
OLD | NEW |