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

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

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos tests Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/stubs/content_script.js
diff --git a/chrome/test/data/extensions/api_test/stubs/content_script.js b/chrome/test/data/extensions/api_test/stubs/content_script.js
index 409a6e23c5c08eb39ef2693384ea0eaad24858d8..92cde79fcd6c451fab49da8af28c897828cbe01a 100644
--- a/chrome/test/data/extensions/api_test/stubs/content_script.js
+++ b/chrome/test/data/extensions/api_test/stubs/content_script.js
@@ -16,10 +16,14 @@ console.log("asking for api ...");
chrome.extension.sendRequest("getApi", function(apis) {
var apiFeatures = chrome.test.getApiFeatures();
function isAvailableToContentScripts(namespace, path) {
+ function checkContexts(contextList) {
+ return contextList == 'all' ||
+ contextList.indexOf('content_script') != -1;
+ }
if (apiFeatures.hasOwnProperty(path))
- return apiFeatures[path]['contexts'].indexOf('content_script') != -1
+ return checkContexts(apiFeatures[path]['contexts']);
return apiFeatures.hasOwnProperty(namespace) &&
- apiFeatures[namespace]['contexts'].indexOf('content_script') != -1;
+ checkContexts(apiFeatures[namespace]['contexts']);
}
console.log("got api response");

Powered by Google App Engine
This is Rietveld 408576698