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

Unified Diff: chrome/browser/extensions/api/management/management_apitest.cc

Issue 137793011: Require user confirmation for chrome.management.uninstall except when uninstalling self. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ExtensionManagementApiBrowserTest.LaunchApp Created 6 years, 11 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: chrome/browser/extensions/api/management/management_apitest.cc
diff --git a/chrome/browser/extensions/api/management/management_apitest.cc b/chrome/browser/extensions/api/management/management_apitest.cc
index 3710b3ac3b5b0ca71b9cf39f09bc8ae36c6413b0..facca8feaff565993d9aacb005069dab3381457d 100644
--- a/chrome/browser/extensions/api/management/management_apitest.cc
+++ b/chrome/browser/extensions/api/management/management_apitest.cc
@@ -5,6 +5,7 @@
#include <map>
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/extensions/api/management/management_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
@@ -125,6 +126,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, NoPermission) {
IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, MAYBE_Uninstall) {
LoadExtensions();
+ // Confirmation dialog will be shown for uninstallations except for self.
+ extensions::ManagementUninstallFunction::SetAutoConfirmForTest(true);
ASSERT_TRUE(RunExtensionSubtest("management/test", "uninstall.html"));
}
@@ -138,6 +141,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, MAYBE_Uninstall) {
IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest,
MAYBE_ManagementPolicyAllowed) {
LoadExtensions();
+ extensions::ManagementUninstallFunction::SetAutoConfirmForTest(true);
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
EXPECT_TRUE(service->GetExtensionById(extension_ids_["enabled_extension"],

Powered by Google App Engine
This is Rietveld 408576698