Chromium Code Reviews| Index: chrome/browser/ui/app_list/app_context_menu_unittest.cc |
| diff --git a/chrome/browser/ui/app_list/app_context_menu_unittest.cc b/chrome/browser/ui/app_list/app_context_menu_unittest.cc |
| index cd7ea1dc8e96d43e84bf5643deb2a625bebb10e2..41918ac0e1abc51ddb67808ce5fe303e3c7f531a 100644 |
| --- a/chrome/browser/ui/app_list/app_context_menu_unittest.cc |
| +++ b/chrome/browser/ui/app_list/app_context_menu_unittest.cc |
| @@ -389,4 +389,47 @@ TEST_F(AppContextMenuTest, ArcMenu) { |
| EXPECT_EQ(true, menu->IsEnabledAt(2)); |
| EXPECT_EQ(false, menu->IsItemCheckedAt(2)); |
| } |
| + |
| +TEST_F(AppContextMenuTest, ArcMenuStickyItem) { |
| + ArcAppTest arc_test; |
| + arc_test.SetUp(profile()); |
| + arc_test.bridge_service()->SetReady(); |
| + |
| + arc_test.app_instance()->RefreshAppList(); |
| + arc_test.app_instance()->SendRefreshAppList(arc_test.fake_apps()); |
| + |
| + { |
| + // Verify menu of store |
| + const arc::AppInfo& store_info = arc_test.fake_apps()[0]; |
| + const std::string store_id = ArcAppTest::GetAppId(store_info); |
| + ArcAppItem item(profile(), nullptr, store_id, std::string(), true); |
| + ui::MenuModel* menu = item.GetContextMenuModel(); |
| + ASSERT_NE(nullptr, menu); |
| + |
| + ASSERT_EQ(2, menu->GetItemCount()); |
|
khmel
2016/03/07 21:11:52
I think pinnable item is missing. I would prefer t
victorhsieh0
2016/03/07 23:54:42
Done.
|
| + EXPECT_EQ(app_list::AppContextMenu::LAUNCH_NEW, menu->GetCommandIdAt(0)); |
| + EXPECT_EQ(true, menu->IsEnabledAt(0)); |
| + EXPECT_EQ(false, menu->IsItemCheckedAt(0)); |
| + EXPECT_EQ(-1, menu->GetCommandIdAt(1)); // separator |
| + // No "uninstall" entry. |
| + } |
| + |
| + { |
| + // Verify normal app menu |
| + const arc::AppInfo& app_info = arc_test.fake_apps()[1]; |
| + const std::string app_id = ArcAppTest::GetAppId(app_info); |
| + ArcAppItem item(profile(), nullptr, app_id, std::string(), true); |
| + ui::MenuModel* menu = item.GetContextMenuModel(); |
| + ASSERT_NE(nullptr, menu); |
| + |
| + ASSERT_EQ(3, menu->GetItemCount()); |
| + EXPECT_EQ(app_list::AppContextMenu::LAUNCH_NEW, menu->GetCommandIdAt(0)); |
| + EXPECT_EQ(true, menu->IsEnabledAt(0)); |
| + EXPECT_EQ(false, menu->IsItemCheckedAt(0)); |
| + EXPECT_EQ(-1, menu->GetCommandIdAt(1)); // separator |
| + EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(2)); |
| + EXPECT_EQ(true, menu->IsEnabledAt(2)); |
| + EXPECT_EQ(false, menu->IsItemCheckedAt(2)); |
| + } |
| +} |
| #endif |