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

Side by Side Diff: chrome/test/data/extensions/api_test/runtime/uninstall_url/test.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // extension api test 5 // extension api test
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ChromeRuntimeUninstallURL 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ChromeRuntimeUninstallURL
7 7
8 var pass = chrome.test.callbackPass; 8 var pass = chrome.test.callbackPass;
9 var uninstall_url = 'http://www.google.com/'; 9 var uninstall_url = 'http://www.google.com/';
10 var sets_uninstall_url = 'Sets Uninstall Url'; 10 var sets_uninstall_url = 'Sets Uninstall Url';
11 var uninstalled = false; 11 var uninstalled = false;
12 chrome.test.runTests([ 12 chrome.test.runTests([
13 function uninstallURL() { 13 function uninstallURL() {
14 chrome.management.getAll(function(results) { 14 chrome.management.getAll(function(results) {
15 for(var i = 0;i<results.length;i++) 15 for(var i = 0; i < results.length; i++) {
16 {
17 if (results[i].name == sets_uninstall_url) { 16 if (results[i].name == sets_uninstall_url) {
18 chrome.management.uninstall(results[i].id, pass(function() { 17 chrome.test.runWithUserGesture(pass(function() {
19 chrome.tabs.query({'url': uninstall_url}, pass(function(tabs) { 18 chrome.management.uninstall(results[i].id, pass(function() {
20 chrome.test.assertEq(tabs.length, 1); 19 chrome.tabs.query({'url': uninstall_url}, pass(function(tabs) {
21 chrome.test.assertEq(tabs[0].url, uninstall_url); 20 chrome.test.assertEq(tabs.length, 1);
21 chrome.test.assertEq(tabs[0].url, uninstall_url);
22 }));
22 })); 23 }));
23 })); 24 }));
24 uninstalled = true; 25 uninstalled = true;
25 break; 26 break;
26 } 27 }
27 } 28 }
28 chrome.test.assertTrue(uninstalled); 29 chrome.test.assertTrue(uninstalled);
29 }); 30 });
30 } 31 }
31 ]); 32 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698