Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2060)

Unified Diff: ash/launcher/launcher_model_unittest.cc

Issue 17673004: Insert panel icons on the left of other panel icons. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix test assertions. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698