Chromium Code Reviews| Index: chrome/browser/tabs/tab_strip_selection_model_unittest.cc |
| diff --git a/chrome/browser/tabs/tab_strip_selection_model_unittest.cc b/chrome/browser/tabs/tab_strip_selection_model_unittest.cc |
| index bf1ac874b1d0b02e50a6043dce4754673e72d62f..121ef655f3d745d709eb58df02de35b703d9493b 100644 |
| --- a/chrome/browser/tabs/tab_strip_selection_model_unittest.cc |
| +++ b/chrome/browser/tabs/tab_strip_selection_model_unittest.cc |
| @@ -40,6 +40,13 @@ TEST_F(TabStripSelectionModelTest, SetSelectedIndex) { |
| EXPECT_FALSE(model.empty()); |
| } |
| +TEST_F(TabStripSelectionModelTest, SetSelectedIndexToEmpty) { |
|
dpapad
2011/06/08 21:19:34
Is this ok, or should it be moved within the previ
sky
2011/06/08 21:59:23
Standalone test is fine by me.
|
| + TabStripSelectionModel model; |
| + model.SetSelectedIndex(-1); |
| + EXPECT_EQ("active=-1 anchor=-1 selection=", StateAsString(model)); |
| + EXPECT_TRUE(model.empty()); |
| +} |
| + |
| TEST_F(TabStripSelectionModelTest, IncrementFrom) { |
| TabStripSelectionModel model; |
| model.SetSelectedIndex(1); |
| @@ -99,6 +106,22 @@ TEST_F(TabStripSelectionModelTest, RemoveIndexFromSelection) { |
| EXPECT_EQ("active=2 anchor=2 selection=", StateAsString(model)); |
| } |
| +TEST_F(TabStripSelectionModelTest, SetSelectionFromAnchorTo) { |
| + TabStripSelectionModel model; |
| + model.SetSelectedIndex(2); |
| + model.SetSelectionFromAnchorTo(7); |
| + EXPECT_EQ("active=7 anchor=2 selection=2 3 4 5 6 7", StateAsString(model)); |
| + |
| + model.Clear(); |
| + model.SetSelectedIndex(7); |
| + model.SetSelectionFromAnchorTo(2); |
| + EXPECT_EQ("active=2 anchor=7 selection=2 3 4 5 6 7", StateAsString(model)); |
| + |
| + model.Clear(); |
| + model.SetSelectionFromAnchorTo(7); |
| + EXPECT_EQ("active=7 anchor=7 selection=7", StateAsString(model)); |
| +} |
| + |
| TEST_F(TabStripSelectionModelTest, Clear) { |
| TabStripSelectionModel model; |
| model.SetSelectedIndex(2); |