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

Side by Side Diff: chrome/test/data/extensions/api_test/stubs/content_script.js

Issue 13604005: Prevent chrome.app JSON schema from loading on every page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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
« no previous file with comments | « chrome/test/data/extensions/api_test/crazy_extension/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/crazy_extension/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698