| Index: ash/launcher/launcher_model_unittest.cc
|
| diff --git a/ash/launcher/launcher_model_unittest.cc b/ash/launcher/launcher_model_unittest.cc
|
| index c91a040b26574994efc4a32d53dfc3e16a700faa..23a3a34e95d667816fa87c7b7184371ad3050e8e 100644
|
| --- a/ash/launcher/launcher_model_unittest.cc
|
| +++ b/ash/launcher/launcher_model_unittest.cc
|
| @@ -129,6 +129,37 @@ TEST(LauncherModel, BasicAssertions) {
|
| EXPECT_EQ("moved=1", observer.StateStringAndClear());
|
| }
|
|
|
| +// Assertions about automatic index when adding items.
|
| +TEST(LauncherModel, AutomaticIndex) {
|
| + TestLauncherModelObserver observer;
|
| + LauncherModel model;
|
| +
|
| + // Model is initially populated with one item.
|
| + EXPECT_EQ(1, model.item_count());
|
| +
|
| + // Insert browser short cut at index 0.
|
| + LauncherItem browser_shortcut;
|
| + browser_shortcut.type = TYPE_BROWSER_SHORTCUT;
|
| + int browser_shortcut_index = model.Add(browser_shortcut);
|
| + EXPECT_EQ(0, browser_shortcut_index);
|
| +
|
| + // Tabbed (and any non-panel type) items are inserted at the right
|
| + LauncherItem item;
|
| + int tabbed_index1 = model.Add(item);
|
| + EXPECT_EQ(1, tabbed_index1);
|
| + int tabbed_index2 = model.Add(item);
|
| + EXPECT_EQ(2, tabbed_index2);
|
| +
|
| + // Panel items are inserted at the left of other panels.
|
| + item.type = TYPE_APP_PANEL;
|
| + int app_panel_index1 = model.Add(item);
|
| + EXPECT_EQ(4, app_panel_index1);
|
| +
|
| + item.type = TYPE_APP_PANEL;
|
| + int app_panel_index2 = model.Add(item);
|
| + EXPECT_EQ(4, app_panel_index2);
|
| +}
|
| +
|
| // Assertions around where items are added.
|
| TEST(LauncherModel, AddIndices) {
|
| TestLauncherModelObserver observer;
|
|
|