OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | 9 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
11 | 11 |
12 using base::ASCIIToUTF16; | 12 using base::ASCIIToUTF16; |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // A view for testing that takes a fixed preferred size upon construction. | 18 // A view for testing that takes a fixed preferred size upon construction. |
19 class FixedSizeView : public View { | 19 class FixedSizeView : public View { |
20 public: | 20 public: |
21 explicit FixedSizeView(const gfx::Size& size) | 21 explicit FixedSizeView(const gfx::Size& size) |
22 : size_(size) {} | 22 : size_(size) {} |
23 | 23 |
24 // Overridden from View: | 24 // Overridden from View: |
25 virtual gfx::Size GetPreferredSize() OVERRIDE { | 25 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
26 return size_; | 26 return size_; |
27 } | 27 } |
28 | 28 |
29 private: | 29 private: |
30 const gfx::Size size_; | 30 const gfx::Size size_; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(FixedSizeView); | 32 DISALLOW_COPY_AND_ASSIGN(FixedSizeView); |
33 }; | 33 }; |
34 | 34 |
35 typedef ViewsTestBase TabbedPaneTest; | 35 typedef ViewsTestBase TabbedPaneTest; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Add a tab at index 0, it should not be selected automatically. | 86 // Add a tab at index 0, it should not be selected automatically. |
87 View* tab0 = new View(); | 87 View* tab0 = new View(); |
88 tabbed_pane->AddTabAtIndex(0, ASCIIToUTF16("tab0"), tab0); | 88 tabbed_pane->AddTabAtIndex(0, ASCIIToUTF16("tab0"), tab0); |
89 EXPECT_NE(tab0, tabbed_pane->GetSelectedTab()); | 89 EXPECT_NE(tab0, tabbed_pane->GetSelectedTab()); |
90 EXPECT_NE(0, tabbed_pane->selected_tab_index()); | 90 EXPECT_NE(0, tabbed_pane->selected_tab_index()); |
91 } | 91 } |
92 | 92 |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 } // namespace views | 95 } // namespace views |
OLD | NEW |