| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service_unittest.h" | 7 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
| 9 #include "chrome/browser/extensions/test_management_policy.h" | 9 #include "chrome/browser/extensions/test_management_policy.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Actions should be enabled. | 53 // Actions should be enabled. |
| 54 ASSERT_TRUE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL)); | 54 ASSERT_TRUE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL)); |
| 55 | 55 |
| 56 extensions::TestManagementPolicyProvider policy_provider( | 56 extensions::TestManagementPolicyProvider policy_provider( |
| 57 extensions::TestManagementPolicyProvider::PROHIBIT_MODIFY_STATUS); | 57 extensions::TestManagementPolicyProvider::PROHIBIT_MODIFY_STATUS); |
| 58 system->management_policy()->RegisterProvider(&policy_provider); | 58 system->management_policy()->RegisterProvider(&policy_provider); |
| 59 | 59 |
| 60 // Now the actions are disabled. | 60 // Now the actions are disabled. |
| 61 ASSERT_FALSE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL)); | 61 ASSERT_FALSE(menu->IsCommandIdEnabled(ExtensionContextMenuModel::UNINSTALL)); |
| 62 |
| 63 // Don't leave |policy_provider| dangling. |
| 64 system->management_policy()->UnregisterAllProviders(); |
| 62 } | 65 } |
| 63 | 66 |
| 64 } // namespace | 67 } // namespace |
| 65 } // namespace extensions | 68 } // namespace extensions |
| OLD | NEW |