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

Unified Diff: chrome/test/data/extensions/management/uninstall_extension/background.js

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 ExtensionWebstorePrivateApiTest.* and ExtensionManagementTest.ExternalPolicyRefresh 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/test/data/extensions/management/uninstall_extension/background.js
diff --git a/chrome/test/data/extensions/management/uninstall_extension/background.js b/chrome/test/data/extensions/management/uninstall_extension/background.js
index 5ea92dd57847f9f8192ddc5234cc423fd54db20e..f105df0913eb20f2c0199743fdc30a3f50a9432b 100644
--- a/chrome/test/data/extensions/management/uninstall_extension/background.js
+++ b/chrome/test/data/extensions/management/uninstall_extension/background.js
@@ -11,11 +11,13 @@ chrome.management.getAll(function(items) {
if (item.name != EXPECTED_NAME) continue;
var id = item.id;
chrome.test.assertEq(false, item.mayDisable);
- chrome.management.uninstall(id, function() {
- // Check that the right error occured.
- var expectedError = 'Extension ' + id + ' cannot be modified by user';
- chrome.test.assertEq(expectedError, chrome.runtime.lastError.message);
- chrome.test.sendMessage('ready');
+ chrome.test.runWithUserGesture(function() {
+ chrome.management.uninstall(id, function() {
+ // Check that the right error occured.
+ var expectedError = 'Extension ' + id + ' cannot be modified by user.';
+ chrome.test.assertEq(expectedError, chrome.runtime.lastError.message);
+ chrome.test.sendMessage('ready');
+ });
});
}
});

Powered by Google App Engine
This is Rietveld 408576698