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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/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" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 DISALLOW_COPY_AND_ASSIGN(TabbedPaneTest); | 52 DISALLOW_COPY_AND_ASSIGN(TabbedPaneTest); |
53 }; | 53 }; |
54 | 54 |
55 void TabbedPaneTest::SetUp() { | 55 void TabbedPaneTest::SetUp() { |
56 ViewsTestBase::SetUp(); | 56 ViewsTestBase::SetUp(); |
57 widget_.reset(new Widget()); | 57 widget_.reset(new Widget()); |
58 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 58 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); |
59 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 59 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
60 params.bounds = gfx::Rect(0, 0, 100, 100); | 60 params.bounds = gfx::Rect(0, 0, 100, 100); |
61 widget_->Init(params); | 61 widget_->Init(params); |
62 tabbed_pane_ = new TabbedPane(); | 62 tabbed_pane_ = new TabbedPane(false); |
63 // In order to properly initialize the |TabbedPane| it must be added to a | 63 // In order to properly initialize the |TabbedPane| it must be added to a |
64 // parent view (see the ViewHierarchyChanged method of the |TabbedPane|). | 64 // parent view (see the ViewHierarchyChanged method of the |TabbedPane|). |
65 widget_->GetRootView()->AddChildView(tabbed_pane_); | 65 widget_->GetRootView()->AddChildView(tabbed_pane_); |
66 | 66 |
67 #if defined(OS_WIN) && !defined(USE_AURA) | 67 #if defined(OS_WIN) && !defined(USE_AURA) |
68 tabbed_pane_win_ = new TabbedPane(); | 68 tabbed_pane_win_ = new TabbedPane(false); |
69 tabbed_pane_win_->set_use_native_win_control(true); | 69 tabbed_pane_win_->set_use_native_win_control(true); |
70 widget_->GetRootView()->AddChildView(tabbed_pane_win_); | 70 widget_->GetRootView()->AddChildView(tabbed_pane_win_); |
71 #endif | 71 #endif |
72 } | 72 } |
73 | 73 |
74 void TabbedPaneTest::TestSizeAndLayout(TabbedPane* tabbed_pane) { | 74 void TabbedPaneTest::TestSizeAndLayout(TabbedPane* tabbed_pane) { |
75 View* child1 = new FixedSizeView(gfx::Size(20, 10)); | 75 View* child1 = new FixedSizeView(gfx::Size(20, 10)); |
76 tabbed_pane->AddTab(ASCIIToUTF16("tab1"), child1); | 76 tabbed_pane->AddTab(ASCIIToUTF16("tab1"), child1); |
77 View* child2 = new FixedSizeView(gfx::Size(5, 5)); | 77 View* child2 = new FixedSizeView(gfx::Size(5, 5)); |
78 tabbed_pane->AddTab(ASCIIToUTF16("tab2"), child2); | 78 tabbed_pane->AddTab(ASCIIToUTF16("tab2"), child2); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // TODO(markusheintz): Once replacing NativeTabbedPaneWin with | 174 // TODO(markusheintz): Once replacing NativeTabbedPaneWin with |
175 // NativeTabbedPaneView is completed (http://crbug.com/138059), then the | 175 // NativeTabbedPaneView is completed (http://crbug.com/138059), then the |
176 // TestAddRemove method should be inlined here again and the "ifdef" part | 176 // TestAddRemove method should be inlined here again and the "ifdef" part |
177 // should be deleted. | 177 // should be deleted. |
178 #if defined(OS_WIN) && !defined(USE_AURA) | 178 #if defined(OS_WIN) && !defined(USE_AURA) |
179 TestAddRemove(tabbed_pane_win_); | 179 TestAddRemove(tabbed_pane_win_); |
180 #endif | 180 #endif |
181 } | 181 } |
182 | 182 |
183 } // namespace views | 183 } // namespace views |
OLD | NEW |