| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/toolbar/recent_tabs_sub_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 TestRecentTabsSubMenuModel model(NULL, browser(), GetOpenTabsDelegate()); | 566 TestRecentTabsSubMenuModel model(NULL, browser(), GetOpenTabsDelegate()); |
| 567 int num_items = model.GetItemCount(); | 567 int num_items = model.GetItemCount(); |
| 568 EXPECT_EQ(9, num_items); | 568 EXPECT_EQ(9, num_items); |
| 569 | 569 |
| 570 std::vector<base::string16> tab_titles = | 570 std::vector<base::string16> tab_titles = |
| 571 recent_tabs_builder.GetTabTitlesSortedByRecency(); | 571 recent_tabs_builder.GetTabTitlesSortedByRecency(); |
| 572 for (int i = 0; i < 4; ++i) | 572 for (int i = 0; i < 4; ++i) |
| 573 EXPECT_EQ(tab_titles[i], model.GetLabelAt(i + 5)); | 573 EXPECT_EQ(tab_titles[i], model.GetLabelAt(i + 5)); |
| 574 } | 574 } |
| 575 | 575 |
| 576 TEST_F(RecentTabsSubMenuModelTest, MaxWidth) { | 576 // Flaky, see crbug.com/671902. |
| 577 TEST_F(RecentTabsSubMenuModelTest, DISABLED_MaxWidth) { |
| 577 // Create 1 session with 1 window and 1 tab. | 578 // Create 1 session with 1 window and 1 tab. |
| 578 RecentTabsBuilderTestHelper recent_tabs_builder; | 579 RecentTabsBuilderTestHelper recent_tabs_builder; |
| 579 recent_tabs_builder.AddSession(); | 580 recent_tabs_builder.AddSession(); |
| 580 recent_tabs_builder.AddWindow(0); | 581 recent_tabs_builder.AddWindow(0); |
| 581 recent_tabs_builder.AddTab(0, 0); | 582 recent_tabs_builder.AddTab(0, 0); |
| 582 RegisterRecentTabs(&recent_tabs_builder); | 583 RegisterRecentTabs(&recent_tabs_builder); |
| 583 | 584 |
| 584 // Menu index Menu items | 585 // Menu index Menu items |
| 585 // ---------------------------------------------------------- | 586 // ---------------------------------------------------------- |
| 586 // 0 History | 587 // 0 History |
| (...skipping 20 matching lines...) Expand all Loading... |
| 607 // 2 Recently closed heaer (disabled) | 608 // 2 Recently closed heaer (disabled) |
| 608 // 3 <separator> | 609 // 3 <separator> |
| 609 // 4 No tabs from other Devices | 610 // 4 No tabs from other Devices |
| 610 | 611 |
| 611 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
| 612 EXPECT_EQ(5, model.GetItemCount()); | 613 EXPECT_EQ(5, model.GetItemCount()); |
| 613 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
| 614 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); | 615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); |
| 615 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); | 616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); |
| 616 } | 617 } |
| OLD | NEW |