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

Side by Side Diff: chrome/test/data/extensions/api_test/management/management_policy/allowed.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: 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
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 var callback = chrome.test.callback; 5 var callback = chrome.test.callback;
6 6
7 // The names of the extensions to operate on, from their manifest.json files. 7 // The names of the extensions to operate on, from their manifest.json files.
8 var ENABLED_NAME = 'enabled_extension'; 8 var ENABLED_NAME = 'enabled_extension';
9 var DISABLED_NAME = 'disabled_extension'; 9 var DISABLED_NAME = 'disabled_extension';
10 var UNINSTALL_NAME = 'enabled_extension'; 10 var UNINSTALL_NAME = 'enabled_extension';
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 })); 57 }));
58 }, 58 },
59 59
60 // Tests uninstalling an extension, expecting it to succeed. 60 // Tests uninstalling an extension, expecting it to succeed.
61 function allowedUninstall() { 61 function allowedUninstall() {
62 chrome.management.getAll(callback(function(items) { 62 chrome.management.getAll(callback(function(items) {
63 var item = findByName(items, UNINSTALL_NAME); 63 var item = findByName(items, UNINSTALL_NAME);
64 chrome.test.assertEq(true, item.mayDisable); 64 chrome.test.assertEq(true, item.mayDisable);
65 65
66 var id = item.id; 66 var id = item.id;
67 chrome.management.uninstall(id, callback(function() { 67 chrome.test.runWithUserGesture(function() {
68 chrome.test.assertNoLastError(); 68 chrome.management.uninstall(id, callback(function() {
69 // The calling api test will verify that the item was uninstalled. 69 chrome.test.assertNoLastError();
70 })); 70 // The calling api test will verify that the item was uninstalled.
71 }));
72 });
71 })); 73 }));
72 } 74 }
73 ]; 75 ];
74 76
75 chrome.test.runTests(tests); 77 chrome.test.runTests(tests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698