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

Unified Diff: chrome/browser/extensions/extension_context_menu_model_unittest.cc

Issue 1140763003: [Extensions] Show enterprise policy icon in the context menu when unremovable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 7 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
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_context_menu_model_unittest.cc
diff --git a/chrome/browser/extensions/extension_context_menu_model_unittest.cc b/chrome/browser/extensions/extension_context_menu_model_unittest.cc
index 31b77bcb2a923b216dab0ae09c3380bd69e369bd..ac634bd11f4832ae5610bf5d9ca3a20db50f414a 100644
--- a/chrome/browser/extensions/extension_context_menu_model_unittest.cc
+++ b/chrome/browser/extensions/extension_context_menu_model_unittest.cc
@@ -158,7 +158,7 @@ TEST_F(ExtensionContextMenuModelTest, RequiredInstallationsDisablesItems) {
system->management_policy()->UnregisterAllProviders();
// Uninstallation should be, by default, enabled.
- ASSERT_TRUE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL));
+ EXPECT_TRUE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL));
TestManagementPolicyProvider policy_provider(
TestManagementPolicyProvider::PROHIBIT_MODIFY_STATUS);
@@ -166,7 +166,14 @@ TEST_F(ExtensionContextMenuModelTest, RequiredInstallationsDisablesItems) {
// If there's a policy provider that requires the extension stay enabled, then
// uninstallation should be disabled.
- ASSERT_FALSE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL));
+ EXPECT_FALSE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL));
+ int uninstall_index =
+ menu->GetIndexOfCommandId(ExtensionContextMenuModel::UNINSTALL);
+ // There should also be an icon to visually indicate why uninstallation is
+ // forbidden.
+ gfx::Image icon;
+ EXPECT_TRUE(menu->GetIconAt(uninstall_index, &icon));
+ EXPECT_FALSE(icon.IsEmpty());
// Don't leave |policy_provider| dangling.
system->management_policy()->UnregisterProvider(&policy_provider);
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698