| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Per http://crbug.com/603744, MaxSessionsAndRecenty fails intermittently on | 497 // Per http://crbug.com/603744, MaxSessionsAndRecenty fails intermittently on |
| 498 // windows and linux. | 498 // windows and linux. |
| 499 #if defined(WIN) || defined(LINUX) | 499 #if defined(OS_WIN) || defined(OS_LINUX) |
| 500 #define MAYBE_MaxSessionsAndRecency DISABLED_MaxSessionsAndRecency | 500 #define MAYBE_MaxSessionsAndRecency DISABLED_MaxSessionsAndRecency |
| 501 #else | 501 #else |
| 502 #define MAYBE_MaxSessionsAndRecency MaxSessionsAndRecency | 502 #define MAYBE_MaxSessionsAndRecency MaxSessionsAndRecency |
| 503 #endif | 503 #endif |
| 504 TEST_F(RecentTabsSubMenuModelTest, MAYBE_MaxSessionsAndRecency) { | 504 TEST_F(RecentTabsSubMenuModelTest, MAYBE_MaxSessionsAndRecency) { |
| 505 // 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. |
| 506 RecentTabsBuilderTestHelper recent_tabs_builder; | 506 RecentTabsBuilderTestHelper recent_tabs_builder; |
| 507 for (int s = 0; s < 4; ++s) { | 507 for (int s = 0; s < 4; ++s) { |
| 508 recent_tabs_builder.AddSession(); | 508 recent_tabs_builder.AddSession(); |
| 509 recent_tabs_builder.AddWindow(s); | 509 recent_tabs_builder.AddWindow(s); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 // 2 Recently closed heaer (disabled) | 608 // 2 Recently closed heaer (disabled) |
| 609 // 3 <separator> | 609 // 3 <separator> |
| 610 // 4 No tabs from other Devices | 610 // 4 No tabs from other Devices |
| 611 | 611 |
| 612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
| 613 EXPECT_EQ(5, model.GetItemCount()); | 613 EXPECT_EQ(5, model.GetItemCount()); |
| 614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
| 615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); | 615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); |
| 616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); | 616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); |
| 617 } | 617 } |
| OLD | NEW |