Chromium Code Reviews| Index: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc |
| diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc |
| index df354cd5ce93c3baed578bb916b771fa8c44ff1d..586dbb0a686a6414fc71ba4de4cd344d7eb85335 100644 |
| --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc |
| +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc |
| @@ -147,10 +147,12 @@ TEST_F(RecentTabsSubMenuModelTest, OtherDevices) { |
| // 7 <section header for 2nd session> |
| // 8 <the only tab of window 0 of session 1> |
| // 9-10 <2 tabs of window 1 of session 2> |
| + // 11 <separator> |
| + // 12 Devices and history... |
| TestRecentTabsSubMenuModel model(NULL, browser(), &associator_, true); |
| int num_items = model.GetItemCount(); |
| - EXPECT_EQ(11, num_items); |
| + EXPECT_EQ(13, num_items); |
| model.ActivatedAt(0); |
| EXPECT_TRUE(model.IsEnabledAt(0)); |
| model.ActivatedAt(3); |
| @@ -165,7 +167,8 @@ TEST_F(RecentTabsSubMenuModelTest, OtherDevices) { |
| EXPECT_TRUE(model.IsEnabledAt(9)); |
| model.ActivatedAt(10); |
| EXPECT_TRUE(model.IsEnabledAt(10)); |
| - EXPECT_EQ(7, model.enable_count_); |
| + EXPECT_TRUE(model.IsEnabledAt(12)); |
| + EXPECT_EQ(8, model.enable_count_); |
| EXPECT_EQ(7, model.execute_count_); |
| } |
| @@ -181,7 +184,8 @@ TEST_F(RecentTabsSubMenuModelTest, MaxSessionsAndRecency) { |
| // Verify that data is populated correctly in RecentTabsSubMenuModel. |
| // Expected menu: |
| - // - max sessions is 3, so only 3 most-recent sessions will show |
| + // - max sessions is 3, so only 3 most-recent sessions will show. |
| + // - the "More devices" entry since not all possible tabs are shown. |
|
Alexei Svitkine (slow)
2013/03/19 20:11:01
Now, remove this comment since you're unconditiona
MAD
2013/03/19 20:19:22
D'Ho!ne.
Meant to remove them, I guess it slipped.
|
| // Menu index Menu items |
| // -------------------------------------- |
| // 0 Reopen closed tab |
| @@ -194,10 +198,12 @@ TEST_F(RecentTabsSubMenuModelTest, MaxSessionsAndRecency) { |
| // 7 <separator> |
| // 8 <section header for 3rd session> |
| // 9 <the only tab of the only window of session 1> |
| + // 10 <separator> |
| + // 11 Devices and history... |
| TestRecentTabsSubMenuModel model(NULL, browser(), &associator_, true); |
| int num_items = model.GetItemCount(); |
| - EXPECT_EQ(10, num_items); |
| + EXPECT_EQ(12, num_items); |
| std::vector<string16> tab_titles = |
| recent_tabs_builder.GetTabTitlesSortedByRecency(); |
| @@ -219,18 +225,21 @@ TEST_F(RecentTabsSubMenuModelTest, MaxTabsPerSessionAndRecency) { |
| // Verify that data is populated correctly in RecentTabsSubMenuModel. |
| // Expected menu: |
| - // - max tabs per session is 4, so only 4 most-recent tabs will show, |
| - // independent of which window they came from |
| + // - max tabs per session is 4, so only 4 most-recent tabs will show, |
| + // independent of which window they came from. |
| + // - the "More devices" entry since not all possible tabs are shown. |
|
Alexei Svitkine (slow)
2013/03/19 20:11:01
Now, remove this comment since you're unconditiona
MAD
2013/03/19 20:19:22
Done.
|
| // Menu index Menu items |
| // -------------------------------------- |
| // 0 Reopen closed tab |
| // 1 <separator> |
| // 2 <section header for session> |
| // 3-6 <4 most-recent tabs of session> |
| + // 7 <separator> |
| + // 8 Devices and history... |
| TestRecentTabsSubMenuModel model(NULL, browser(), &associator_, true); |
| int num_items = model.GetItemCount(); |
| - EXPECT_EQ(7, num_items); |
| + EXPECT_EQ(9, num_items); |
| std::vector<string16> tab_titles = |
| recent_tabs_builder.GetTabTitlesSortedByRecency(); |
| @@ -252,9 +261,11 @@ TEST_F(RecentTabsSubMenuModelTest, MaxWidth) { |
| // 1 <separator> |
| // 2 <section header for 1st session> |
| // 3 <the only tab of the only window of session 1> |
| + // 4 <separator> |
| + // 5 Devices and history... |
| TestRecentTabsSubMenuModel model(NULL, browser(), &associator_, true); |
| - EXPECT_EQ(4, model.GetItemCount()); |
| + EXPECT_EQ(6, model.GetItemCount()); |
| EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(0)); |
| EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(1)); |
| EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(2)); |