OLD | NEW |
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 Loading... |
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); |
OLD | NEW |