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 // Helper function to log message to both the local console and to the | 5 // Helper function to log message to both the local console and to the |
6 // background page, so that the latter can output the message via the | 6 // background page, so that the latter can output the message via the |
7 // chrome.test.log() function. | 7 // chrome.test.log() function. |
8 function logToConsoleAndStdout(msg) { | 8 function logToConsoleAndStdout(msg) { |
9 console.log(msg); | 9 console.log(msg); |
10 chrome.extension.sendRequest("log: " + msg); | 10 chrome.extension.sendRequest("log: " + msg); |
(...skipping 13 matching lines...) Expand all Loading... |
24 if (typeof(module[section]) == "undefined") | 24 if (typeof(module[section]) == "undefined") |
25 return; | 25 return; |
26 module[section].forEach(function(entry) { | 26 module[section].forEach(function(entry) { |
27 // Ignore entries that are not applicable to the manifest that we're | 27 // Ignore entries that are not applicable to the manifest that we're |
28 // running under. | 28 // running under. |
29 if (entry.maximumManifestVersion && entry.maximumManifestVersion < 2) { | 29 if (entry.maximumManifestVersion && entry.maximumManifestVersion < 2) { |
30 return; | 30 return; |
31 } | 31 } |
32 | 32 |
33 var path = namespace + "." + entry.name; | 33 var path = namespace + "." + entry.name; |
34 if (module.unprivileged || entry.unprivileged) { | 34 // TODO(cduvall): Make this inspect _api_features.json. |
| 35 // http://crbug.com/232247 |
| 36 // Manually add chrome.app to the unprivileged APIs since it uses the |
| 37 // feature system now. |
| 38 if (module.unprivileged || entry.unprivileged || namespace == 'app') { |
35 unprivilegedPaths.push(path); | 39 unprivilegedPaths.push(path); |
36 } else { | 40 } else { |
37 privilegedPaths.push(path); | 41 privilegedPaths.push(path); |
38 } | 42 } |
39 }); | 43 }); |
40 }); | 44 }); |
41 | 45 |
42 if (module.properties) { | 46 if (module.properties) { |
43 for (var propName in module.properties) { | 47 for (var propName in module.properties) { |
44 var path = namespace + "." + propName; | 48 var path = namespace + "." + propName; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 console.log(success ? "pass" : "fail"); | 161 console.log(success ? "pass" : "fail"); |
158 if (success) { | 162 if (success) { |
159 reportSuccess(); | 163 reportSuccess(); |
160 } else { | 164 } else { |
161 logToConsoleAndStdout("failures on:\n" + failures.join("\n") + | 165 logToConsoleAndStdout("failures on:\n" + failures.join("\n") + |
162 "\n\n\n>>> See comment in stubs_apitest.cc for a " + | 166 "\n\n\n>>> See comment in stubs_apitest.cc for a " + |
163 "hint about fixing this failure.\n\n"); | 167 "hint about fixing this failure.\n\n"); |
164 reportFailure(); | 168 reportFailure(); |
165 } | 169 } |
166 } | 170 } |
OLD | NEW |