OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 id of an extension we're using for install tests. | 5 // The id of an extension we're using for install tests. |
6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje"; | 6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje"; |
7 | 7 |
8 // The id of an app we're using for install tests. | 8 // The id of an app we're using for install tests. |
9 var appId = "iladmdjkfniedhfhcfoefgojhgaiaccc"; | 9 var appId = "iladmdjkfniedhfhcfoefgojhgaiaccc"; |
10 | 10 |
11 var assertEq = chrome.test.assertEq; | 11 var assertEq = chrome.test.assertEq; |
12 var assertNoLastError = chrome.test.assertNoLastError; | 12 var assertNoLastError = chrome.test.assertNoLastError; |
| 13 var assertTrue = chrome.test.assertTrue; |
13 var callbackFail = chrome.test.callbackFail; | 14 var callbackFail = chrome.test.callbackFail; |
14 var callbackPass = chrome.test.callbackPass; | 15 var callbackPass = chrome.test.callbackPass; |
15 var listenOnce = chrome.test.listenOnce; | 16 var listenOnce = chrome.test.listenOnce; |
16 var runTests = chrome.test.runTests; | 17 var runTests = chrome.test.runTests; |
17 var succeed = chrome.test.succeed; | 18 var succeed = chrome.test.succeed; |
18 | 19 |
19 // Calls |callback| with true/false indicating whether an item with an id of | 20 // Calls |callback| with true/false indicating whether an item with an id of |
20 // extensionId is installed. | 21 // extensionId is installed. |
21 function checkInstalled(callback) { | 22 function checkInstalled(callback) { |
22 chrome.management.getAll(function(extensions) { | 23 chrome.management.getAll(function(extensions) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return cachedManifest; | 60 return cachedManifest; |
60 | 61 |
61 // Do a synchronous XHR to get the manifest. | 62 // Do a synchronous XHR to get the manifest. |
62 var xhr = new XMLHttpRequest(); | 63 var xhr = new XMLHttpRequest(); |
63 xhr.open("GET", | 64 xhr.open("GET", |
64 alternativePath ? alternativePath : "extension/manifest.json", | 65 alternativePath ? alternativePath : "extension/manifest.json", |
65 false); | 66 false); |
66 xhr.send(null); | 67 xhr.send(null); |
67 return xhr.responseText; | 68 return xhr.responseText; |
68 } | 69 } |
OLD | NEW |