Chromium Code Reviews| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(5, &url, &title)); | 487 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(5, &url, &title)); |
| 488 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(6, &url, &title)); | 488 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(6, &url, &title)); |
| 489 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(7, &url, &title)); | 489 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(7, &url, &title)); |
| 490 EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(8, &url, &title)); | 490 EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(8, &url, &title)); |
| 491 EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(9, &url, &title)); | 491 EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(9, &url, &title)); |
| 492 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(10, &url, &title)); | 492 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(10, &url, &title)); |
| 493 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(11, &url, &title)); | 493 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(11, &url, &title)); |
| 494 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(12, &url, &title)); | 494 EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(12, &url, &title)); |
| 495 } | 495 } |
| 496 | 496 |
| 497 TEST_F(RecentTabsSubMenuModelTest, MaxSessionsAndRecency) { | 497 // Per http://crbug.com/603744, MaxSessionsAndRecenty fails intermittently on |
| 498 // windows and linux. | |
| 499 #if defined(WIN) || defined(LINUX) | |
|
jam
2016/04/15 17:03:04
this doesn't work since it needs to be OS_WIN or O
| |
| 500 #define MAYBE_MaxSessionsAndRecency DISABLED_MaxSessionsAndRecency | |
| 501 #else | |
| 502 #define MAYBE_MaxSessionsAndRecency MaxSessionsAndRecency | |
| 503 #endif | |
| 504 TEST_F(RecentTabsSubMenuModelTest, MAYBE_MaxSessionsAndRecency) { | |
| 498 // Create 4 sessions : each session has 1 window with 1 tab each. | 505 // Create 4 sessions : each session has 1 window with 1 tab each. |
| 499 RecentTabsBuilderTestHelper recent_tabs_builder; | 506 RecentTabsBuilderTestHelper recent_tabs_builder; |
| 500 for (int s = 0; s < 4; ++s) { | 507 for (int s = 0; s < 4; ++s) { |
| 501 recent_tabs_builder.AddSession(); | 508 recent_tabs_builder.AddSession(); |
| 502 recent_tabs_builder.AddWindow(s); | 509 recent_tabs_builder.AddWindow(s); |
| 503 recent_tabs_builder.AddTab(s, 0); | 510 recent_tabs_builder.AddTab(s, 0); |
| 504 } | 511 } |
| 505 RegisterRecentTabs(&recent_tabs_builder); | 512 RegisterRecentTabs(&recent_tabs_builder); |
| 506 | 513 |
| 507 // Verify that data is populated correctly in RecentTabsSubMenuModel. | 514 // Verify that data is populated correctly in RecentTabsSubMenuModel. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 601 // 2 Recently closed heaer (disabled) | 608 // 2 Recently closed heaer (disabled) |
| 602 // 3 <separator> | 609 // 3 <separator> |
| 603 // 4 No tabs from other Devices | 610 // 4 No tabs from other Devices |
| 604 | 611 |
| 605 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
| 606 EXPECT_EQ(5, model.GetItemCount()); | 613 EXPECT_EQ(5, model.GetItemCount()); |
| 607 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
| 608 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); | 615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); |
| 609 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); | 616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); |
| 610 } | 617 } |
| OLD | NEW |