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

Side by Side Diff: ui/views/controls/single_split_view_unittest.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/single_split_view.cc ('k') | ui/views/controls/slider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/single_split_view.cc ('k') | ui/views/controls/slider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698