Index: chrome/browser/tabs/tab_strip_model_unittest.cc |
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc |
index 178fe53bcf417aa5cecd89c058ce2298b931f894..b237c26d172587a51e689eefc684075025f76fe5 100644 |
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc |
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc |
@@ -734,6 +734,36 @@ static void InsertTabContentses(TabStripModel* tabstrip, |
contents3, TabStripModel::ADD_INHERIT_GROUP); |
} |
+TEST_F(TabStripModelTest, TestSelectNextMRUTab) { |
+ TabStripDummyDelegate delegate(NULL); |
+ TabStripModel tabstrip(&delegate, profile()); |
+ EXPECT_TRUE(tabstrip.empty()); |
+ |
+ TabContentsWrapper* opener_contents = CreateTabContents(); |
+ tabstrip.AppendTabContents(opener_contents, true); |
+ |
+ TabContentsWrapper* contents1 = CreateTabContents(); |
+ TabContentsWrapper* contents2 = CreateTabContents(); |
+ TabContentsWrapper* contents3 = CreateTabContents(); |
+ |
+ // Test LTR |
+ InsertTabContentses(&tabstrip, contents1, contents2, contents3); |
+ EXPECT_EQ(contents1, tabstrip.GetTabContentsAt(1)); |
+ EXPECT_EQ(contents2, tabstrip.GetTabContentsAt(2)); |
+ EXPECT_EQ(contents3, tabstrip.GetTabContentsAt(3)); |
+ |
+ EXPECT_EQ(0, tabstrip.active_index()); |
+ tabstrip.ActivateTabAt(1, true); |
+ EXPECT_EQ(1, tabstrip.active_index()); |
+ |
+ // Next MRU Tab is tab from where we switched to tab 1 i.e tab 2 |
+ tabstrip.SelectNextMRUTab(); |
+ EXPECT_EQ(0, tabstrip.active_index()); |
+ |
+ tabstrip.CloseAllTabs(); |
+ EXPECT_TRUE(tabstrip.empty()); |
+} |
+ |
// Tests opening background tabs. |
TEST_F(TabStripModelTest, TestLTRInsertionOptions) { |
TabStripDummyDelegate delegate(NULL); |