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 "chrome/browser/ui/views/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" | 9 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" |
10 #include "chrome/browser/ui/views/tabs/tab.h" | 10 #include "chrome/browser/ui/views/tabs/tab.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return tab->HitTestPoint(point_in_tab_coords); | 161 return tab->HitTestPoint(point_in_tab_coords); |
162 } | 162 } |
163 | 163 |
164 void DoLayout() { tab_strip_->DoLayout(); } | 164 void DoLayout() { tab_strip_->DoLayout(); } |
165 | 165 |
166 // Owned by TabStrip. | 166 // Owned by TabStrip. |
167 FakeBaseTabStripController* controller_; | 167 FakeBaseTabStripController* controller_; |
168 // Owns |tab_strip_|. | 168 // Owns |tab_strip_|. |
169 views::View parent_; | 169 views::View parent_; |
170 TabStrip* tab_strip_; | 170 TabStrip* tab_strip_; |
171 scoped_ptr<views::Widget> widget_; | 171 std::unique_ptr<views::Widget> widget_; |
172 | 172 |
173 private: | 173 private: |
174 DISALLOW_COPY_AND_ASSIGN(TabStripTest); | 174 DISALLOW_COPY_AND_ASSIGN(TabStripTest); |
175 }; | 175 }; |
176 | 176 |
177 TEST_F(TabStripTest, GetModelCount) { | 177 TEST_F(TabStripTest, GetModelCount) { |
178 EXPECT_EQ(0, tab_strip_->GetModelCount()); | 178 EXPECT_EQ(0, tab_strip_->GetModelCount()); |
179 } | 179 } |
180 | 180 |
181 TEST_F(TabStripTest, IsValidModelIndex) { | 181 TEST_F(TabStripTest, IsValidModelIndex) { |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 const int kTabStripWidth = 500; | 628 const int kTabStripWidth = 500; |
629 tab_strip_->SetBounds(0, 0, kTabStripWidth, 20); | 629 tab_strip_->SetBounds(0, 0, kTabStripWidth, 20); |
630 | 630 |
631 for (int i = 0; i < 100; ++i) | 631 for (int i = 0; i < 100; ++i) |
632 controller_->AddTab(i, (i == 0)); | 632 controller_->AddTab(i, (i == 0)); |
633 | 633 |
634 DoLayout(); | 634 DoLayout(); |
635 | 635 |
636 EXPECT_LE(tab_strip_->GetNewTabButtonBounds().right(), kTabStripWidth); | 636 EXPECT_LE(tab_strip_->GetNewTabButtonBounds().right(), kTabStripWidth); |
637 } | 637 } |
OLD | NEW |