| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 extension_id = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; | 5 var extension_id = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; |
| 6 | 6 |
| 7 var assertEq = chrome.test.assertEq; | 7 var assertEq = chrome.test.assertEq; |
| 8 var assertNoLastError = chrome.test.assertNoLastError; | 8 var assertNoLastError = chrome.test.assertNoLastError; |
| 9 var succeed = chrome.test.succeed; | 9 var succeed = chrome.test.succeed; |
| 10 | 10 |
| 11 // Calls |callback| with true/false indicating whether an item with an id of | 11 // Calls |callback| with true/false indicating whether an item with an id of |
| 12 // extension_id is installed. | 12 // extension_id is installed. |
| 13 function checkInstalled(callback) { | 13 function checkInstalled(callback) { |
| 14 chrome.management.getAll(function(extensions) { | 14 chrome.management.getAll(function(extensions) { |
| 15 var found = false; | 15 var found = false; |
| 16 callback(extensions.some(function(ext) { | 16 callback(extensions.some(function(ext) { |
| 17 return ext.id == extension_id; | 17 return ext.id == extension_id; |
| 18 })); | 18 })); |
| 19 }); | 19 }); |
| 20 } | 20 } |
| OLD | NEW |