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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/management/launch_app/test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // The name of the extension to uninstall, from manifest.json. 5 // The name of the extension to uninstall, from manifest.json.
6 var EXPECTED_NAME = 'Auto-Update Test'; 6 var EXPECTED_NAME = 'Auto-Update Test';
7 7
8 chrome.management.getAll(function(items) { 8 chrome.management.getAll(function(items) {
9 for (var i = 0; i < items.length; i++) { 9 for (var i = 0; i < items.length; i++) {
10 var item = items[i]; 10 var item = items[i];
11 if (item.name != EXPECTED_NAME) continue; 11 if (item.name != EXPECTED_NAME) continue;
12 var id = item.id; 12 var id = item.id;
13 chrome.test.assertEq(false, item.mayDisable); 13 chrome.test.assertEq(false, item.mayDisable);
14 chrome.management.uninstall(id, function() { 14 chrome.test.runWithUserGesture(function() {
15 // Check that the right error occured. 15 chrome.management.uninstall(id, function() {
16 var expectedError = 'Extension ' + id + ' cannot be modified by user'; 16 // Check that the right error occured.
17 chrome.test.assertEq(expectedError, chrome.runtime.lastError.message); 17 var expectedError = 'Extension ' + id + ' cannot be modified by user.';
18 chrome.test.sendMessage('ready'); 18 chrome.test.assertEq(expectedError, chrome.runtime.lastError.message);
19 chrome.test.sendMessage('ready');
20 });
19 }); 21 });
20 } 22 }
21 }); 23 });
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/management/launch_app/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698