| Index: ash/launcher/launcher_model_unittest.cc
|
| diff --git a/ash/launcher/launcher_model_unittest.cc b/ash/launcher/launcher_model_unittest.cc
|
| index dd2745e489e53922102a94e3007a59d67bf5a11a..ba8883fa06d9d08fe2509b3e87ece8b384fb233c 100644
|
| --- a/ash/launcher/launcher_model_unittest.cc
|
| +++ b/ash/launcher/launcher_model_unittest.cc
|
| @@ -175,6 +175,9 @@ TEST(LauncherModel, AddIndices) {
|
| int app_shortcut_index5 = model.AddAt(2, item);
|
| EXPECT_EQ(browser + 2, app_shortcut_index5);
|
|
|
| + // Before there are any panels, no icons should be right aligned.
|
| + EXPECT_EQ(model.item_count(), model.EndAlignedIndex());
|
| +
|
| // Check that AddAt() figures out the correct indexes for tabs and panels.
|
| item.type = TYPE_TABBED;
|
| int tabbed_index3 = model.AddAt(2, item);
|
| @@ -182,27 +185,30 @@ TEST(LauncherModel, AddIndices) {
|
|
|
| item.type = TYPE_APP_PANEL;
|
| int app_panel_index1 = model.AddAt(2, item);
|
| - EXPECT_EQ(browser + 6, app_panel_index1);
|
| + EXPECT_EQ(browser + 10, app_panel_index1);
|
|
|
| item.type = TYPE_TABBED;
|
| int tabbed_index4 = model.AddAt(11, item);
|
| - EXPECT_EQ(browser + 10, tabbed_index4);
|
| + EXPECT_EQ(browser + 9, tabbed_index4);
|
|
|
| item.type = TYPE_APP_PANEL;
|
| - int app_panel_index2 = model.AddAt(12, item);
|
| - EXPECT_EQ(browser + 11, app_panel_index2);
|
| + int app_panel_index2 = model.AddAt(15, item);
|
| + EXPECT_EQ(browser + 12, app_panel_index2);
|
|
|
| item.type = TYPE_TABBED;
|
| int tabbed_index5 = model.AddAt(7, item);
|
| EXPECT_EQ(browser + 7, tabbed_index5);
|
|
|
| item.type = TYPE_APP_PANEL;
|
| - int app_panel_index3 = model.AddAt(8, item);
|
| - EXPECT_EQ(browser + 8, app_panel_index3);
|
| + int app_panel_index3 = model.AddAt(13, item);
|
| + EXPECT_EQ(browser + 13, app_panel_index3);
|
| +
|
| + // Right aligned index should be the first app panel index.
|
| + EXPECT_EQ(browser + 12, model.EndAlignedIndex());
|
|
|
| // Browser shortcut and app list should still be first and second.
|
| EXPECT_EQ(TYPE_BROWSER_SHORTCUT, model.items()[0].type);
|
| - EXPECT_EQ(TYPE_APP_LIST, model.items()[model.items().size() - 1].type);
|
| + EXPECT_EQ(TYPE_APP_LIST, model.items()[model.EndAlignedIndex() - 1].type);
|
| }
|
|
|
| } // namespace ash
|
|
|