| 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 // TODO(cduvall): Make this inspect _api_features.json. | 34 if (module.unprivileged || entry.unprivileged) { |
| 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') { | |
| 39 unprivilegedPaths.push(path); | 35 unprivilegedPaths.push(path); |
| 40 } else { | 36 } else { |
| 41 privilegedPaths.push(path); | 37 privilegedPaths.push(path); |
| 42 } | 38 } |
| 43 }); | 39 }); |
| 44 }); | 40 }); |
| 45 | 41 |
| 46 if (module.properties) { | 42 if (module.properties) { |
| 47 for (var propName in module.properties) { | 43 for (var propName in module.properties) { |
| 48 var path = namespace + "." + propName; | 44 var path = namespace + "." + propName; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 console.log(success ? "pass" : "fail"); | 157 console.log(success ? "pass" : "fail"); |
| 162 if (success) { | 158 if (success) { |
| 163 reportSuccess(); | 159 reportSuccess(); |
| 164 } else { | 160 } else { |
| 165 logToConsoleAndStdout("failures on:\n" + failures.join("\n") + | 161 logToConsoleAndStdout("failures on:\n" + failures.join("\n") + |
| 166 "\n\n\n>>> See comment in stubs_apitest.cc for a " + | 162 "\n\n\n>>> See comment in stubs_apitest.cc for a " + |
| 167 "hint about fixing this failure.\n\n"); | 163 "hint about fixing this failure.\n\n"); |
| 168 reportFailure(); | 164 reportFailure(); |
| 169 } | 165 } |
| 170 } | 166 } |
| OLD | NEW |