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

Unified Diff: chrome/browser/extensions/api/management/management_api_browsertest.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_api_browsertest.cc
diff --git a/chrome/browser/extensions/api/management/management_api_browsertest.cc b/chrome/browser/extensions/api/management/management_api_browsertest.cc
index 8b98a4f92a603c02a97f083945eca658947bd83e..0f1e15dadfb56417f3d7de85ea1e806bfc02c9ff 100644
--- a/chrome/browser/extensions/api/management/management_api_browsertest.cc
+++ b/chrome/browser/extensions/api/management/management_api_browsertest.cc
@@ -111,9 +111,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiBrowserTest,
const std::string id = extension->id();
+ scoped_refptr<Extension> empty_extension(
+ extension_function_test_utils::CreateEmptyExtension());
// Uninstall, then cancel via the confirm dialog.
scoped_refptr<ManagementUninstallFunction> uninstall_function(
new ManagementUninstallFunction());
+ uninstall_function->set_extension(empty_extension);
+ uninstall_function->set_user_gesture(true);
ManagementUninstallFunction::SetAutoConfirmForTest(false);
EXPECT_TRUE(MatchPattern(
@@ -129,8 +133,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiBrowserTest,
// Uninstall, then accept via the confirm dialog.
uninstall_function = new ManagementUninstallFunction();
+ uninstall_function->set_extension(empty_extension);
ManagementUninstallFunction::SetAutoConfirmForTest(true);
-
+ uninstall_function->set_user_gesture(true);
util::RunFunctionAndReturnSingleResult(
uninstall_function.get(),
base::StringPrintf("[\"%s\", {\"showConfirmDialog\": true}]", id.c_str()),

Powered by Google App Engine
This is Rietveld 408576698