diff options
author | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 15:34:32 +0000 |
---|---|---|
committer | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 15:34:32 +0000 |
commit | 8d181bfcdc9134e9d98577d77ce340501e8ee922 (patch) | |
tree | c5c6c3b589e677d002000ab6a734cc31e629e3df /ash/launcher/launcher_model_unittest.cc | |
parent | f21df145f1fb916ad95dc375c6a0bf3485fbf875 (diff) | |
download | chromium_src-8d181bfcdc9134e9d98577d77ce340501e8ee922.zip chromium_src-8d181bfcdc9134e9d98577d77ce340501e8ee922.tar.gz chromium_src-8d181bfcdc9134e9d98577d77ce340501e8ee922.tar.bz2 |
Remove BrowserLauncherItemController and ash::TYPE_TABBED
After removing old launcher, new launcher don't need BrowserLauncherItemController as LauncherItemController.
New launcher only needs the functionality of monitoring browser and its status change.
To handle this, BrowserStatusMonitor is introduced.
BrowserStatusMonitor monitors BrowserLists to detects creation and deletion of Browser and its
TabStripModel to keep the launcher representation up to date as the active tab changes.
Also ash::TYPE_TABBED is removed from LauncherItemType since ash::TYPE_TABBED is only used by PerBrowser Launcher.
Existing unit tests that used TYPE_TABBED is replaced with TYPE_PLATFORM_APP.
No new unit tests are added for this. Existing unit tests(browser_tests, unit_tests, ash_unittests) can cover this modification.
R=skuhne@chromium.org, sky@chromium.org
BUG=169303, 277241
TEST=Compiles, Manual test, unit_tests, browser_tests, ash_unittests
Review URL: https://chromiumcodereview.appspot.com/22795003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_model_unittest.cc')
-rw-r--r-- | ash/launcher/launcher_model_unittest.cc | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/ash/launcher/launcher_model_unittest.cc b/ash/launcher/launcher_model_unittest.cc index c91a040..7011e27 100644 --- a/ash/launcher/launcher_model_unittest.cc +++ b/ash/launcher/launcher_model_unittest.cc @@ -83,6 +83,7 @@ TEST(LauncherModel, BasicAssertions) { // Add an item. model.AddObserver(&observer); LauncherItem item; + item.type = TYPE_APP_SHORTCUT; int index = model.Add(item); EXPECT_EQ(2, model.item_count()); EXPECT_EQ("added=1", observer.StateStringAndClear()); @@ -93,12 +94,13 @@ TEST(LauncherModel, BasicAssertions) { ids.insert(model.items()[i].id); EXPECT_EQ(model.item_count(), static_cast<int>(ids.size())); - // Change a tabbed image. + // Change to a platform app item. LauncherID original_id = model.items()[index].id; - model.Set(index, LauncherItem()); + item.type = TYPE_PLATFORM_APP; + model.Set(index, item); EXPECT_EQ(original_id, model.items()[index].id); EXPECT_EQ("changed=1", observer.StateStringAndClear()); - EXPECT_EQ(TYPE_TABBED, model.items()[index].type); + EXPECT_EQ(TYPE_PLATFORM_APP, model.items()[index].type); // Remove the item. model.RemoveItemAt(index); @@ -143,16 +145,17 @@ TEST(LauncherModel, AddIndices) { int browser_shortcut_index = model.Add(browser_shortcut); EXPECT_EQ(0, browser_shortcut_index); - // Tabbed items should be after browser shortcut. + // platform app items should be after browser shortcut. LauncherItem item; - int tabbed_index1 = model.Add(item); - EXPECT_EQ(1, tabbed_index1); + item.type = TYPE_PLATFORM_APP; + int platform_app_index1 = model.Add(item); + EXPECT_EQ(1, platform_app_index1); - // Add another tabbed item, it should follow first. - int tabbed_index2 = model.Add(item); - EXPECT_EQ(2, tabbed_index2); + // Add another platform app item, it should follow first. + int platform_app_index2 = model.Add(item); + EXPECT_EQ(2, platform_app_index2); - // APP_SHORTCUT's priority is higher than TABBED but same as + // APP_SHORTCUT's priority is higher than PLATFORM_APP but same as // BROWSER_SHORTCUT. So APP_SHORTCUT is located after BROWSER_SHORCUT. item.type = TYPE_APP_SHORTCUT; int app_shortcut_index1 = model.Add(item); @@ -181,26 +184,27 @@ TEST(LauncherModel, AddIndices) { // Before there are any panels, no icons should be right aligned. EXPECT_EQ(model.item_count(), model.FirstPanelIndex()); - // Check that AddAt() figures out the correct indexes for tabs and panels. - item.type = TYPE_TABBED; - int tabbed_index3 = model.AddAt(2, item); - EXPECT_EQ(6, tabbed_index3); + // Check that AddAt() figures out the correct indexes for platform apps and + // panels. + item.type = TYPE_PLATFORM_APP; + int platform_app_index3 = model.AddAt(2, item); + EXPECT_EQ(6, platform_app_index3); item.type = TYPE_APP_PANEL; int app_panel_index1 = model.AddAt(2, item); EXPECT_EQ(10, app_panel_index1); - item.type = TYPE_TABBED; - int tabbed_index4 = model.AddAt(11, item); - EXPECT_EQ(9, tabbed_index4); + item.type = TYPE_PLATFORM_APP; + int platform_app_index4 = model.AddAt(11, item); + EXPECT_EQ(9, platform_app_index4); item.type = TYPE_APP_PANEL; int app_panel_index2 = model.AddAt(12, item); EXPECT_EQ(12, app_panel_index2); - item.type = TYPE_TABBED; - int tabbed_index5 = model.AddAt(7, item); - EXPECT_EQ(7, tabbed_index5); + item.type = TYPE_PLATFORM_APP; + int platform_app_index5 = model.AddAt(7, item); + EXPECT_EQ(7, platform_app_index5); item.type = TYPE_APP_PANEL; int app_panel_index3 = model.AddAt(13, item); @@ -236,7 +240,7 @@ TEST(LauncherModel, LauncherIDTests) { // Adding another item to the list should also produce a new ID. LauncherItem item; - item.type = TYPE_TABBED; + item.type = TYPE_PLATFORM_APP; model.Add(item); EXPECT_NE(model.next_id(), id2); } |