summaryrefslogtreecommitdiffstats
path: root/chrome/test/data
diff options
context:
space:
mode:
authorcduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:40:24 +0000
committercduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:40:24 +0000
commit4770acb6f4ddbd70a38820be0432b3cbc691d81c (patch)
tree185c543abf9d29825b13d13fb860e03423b3906a /chrome/test/data
parented1d3603713f71d894f1ff2cd73634d5c7d6eb34 (diff)
downloadchromium_src-4770acb6f4ddbd70a38820be0432b3cbc691d81c.zip
chromium_src-4770acb6f4ddbd70a38820be0432b3cbc691d81c.tar.gz
chromium_src-4770acb6f4ddbd70a38820be0432b3cbc691d81c.tar.bz2
Implement API features for the Extension API feature system
Now features can be declared in the _api_features.json file, and dependencies of the form "api:<api_name>" will refer to these features. This patch also prevents schemas for APIs using the feature system from being loaded when calling ExtensionAPI::IsAvailable(). TBR=ben@chromium.org BUG=55316, 120070, 224206 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=190836 Review URL: https://chromiumcodereview.appspot.com/12846011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data')
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/api_features.json54
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/is_privileged_features_1.json8
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/is_privileged_features_2.json8
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/is_privileged_features_3.json8
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/is_privileged_features_4.json18
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/is_privileged_features_5.json18
-rw-r--r--chrome/test/data/extensions/extension_api_unittest/privileged_api_features.json32
7 files changed, 86 insertions, 60 deletions
diff --git a/chrome/test/data/extensions/extension_api_unittest/api_features.json b/chrome/test/data/extensions/extension_api_unittest/api_features.json
new file mode 100644
index 0000000..476525d
--- /dev/null
+++ b/chrome/test/data/extensions/extension_api_unittest/api_features.json
@@ -0,0 +1,54 @@
+{
+ "test1": {
+ "contexts": ["content_script", "blessed_extension", "unblessed_extension"]
+ },
+ "test2": {
+ "contexts": ["web_page"],
+ "matches": ["<all_urls>"]
+ },
+ "test2.foo": {
+ "contexts": ["content_script"]
+ },
+ "test3": {
+ "contexts": ["content_script"]
+ },
+ "test3.foo": {
+ "contexts": ["web_page", "blessed_extension"],
+ "matches": ["<all_urls>"]
+ },
+ "test4": {
+ "contexts": ["blessed_extension"],
+ "dependencies": ["api:test3.foo"]
+ },
+ "test4.foo": {
+ "contexts": ["unblessed_extension"],
+ "dependencies": ["api:test4"]
+ },
+ "test4.foo.foo": {
+ "contexts": ["content_script"]
+ },
+ "test5": {
+ "contexts": ["web_page"],
+ "matches": ["http://foo.com/*"]
+ },
+ "test6": {
+ "contexts": ["content_script"]
+ },
+ "test6.foo": {
+ "contexts": ["blessed_extension"]
+ },
+ "test7": {
+ "contexts": ["web_page"],
+ "matches": ["http://foo.com/*"]
+ },
+ "test7.foo": {
+ "contexts": ["web_page"],
+ "matches": ["<all_urls>"],
+ "dependencies": ["test7"]
+ },
+ "test7.bar": {
+ "contexts": ["web_page"],
+ "matches": ["http://bar.com/*"],
+ "dependencies": ["test7.foo"]
+ }
+}
diff --git a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_1.json b/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_1.json
deleted file mode 100644
index ae509f69..0000000
--- a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_1.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "namespace": "test",
- "uses_feature_system": true,
- "extension_types": ["extension"],
- "contexts": ["content_script"]
- }
-]
diff --git a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_2.json b/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_2.json
deleted file mode 100644
index 91b9d13..0000000
--- a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_2.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "namespace": "test",
- "uses_feature_system": true,
- "extension_types": ["extension"],
- "contexts": ["blessed_extension"]
- }
-]
diff --git a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_3.json b/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_3.json
deleted file mode 100644
index 47b1290e..0000000
--- a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_3.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "namespace": "test",
- "uses_feature_system": true,
- "extension_types": ["extension"],
- "contexts": ["content_script", "blessed_extension"]
- }
-]
diff --git a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_4.json b/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_4.json
deleted file mode 100644
index 8839ce1..0000000
--- a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_4.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "namespace": "test",
- "uses_feature_system": true,
- "extension_types": ["extension"],
- "contexts": ["blessed_extension"],
- "functions": [
- {
- "name": "foo",
- "contexts": ["content_script", "blessed_extension"]
- },
- {
- "name": "bar",
- "dependencies": ["api:test.foo"]
- }
- ]
- }
-]
diff --git a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_5.json b/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_5.json
deleted file mode 100644
index 9db5b2d..0000000
--- a/chrome/test/data/extensions/extension_api_unittest/is_privileged_features_5.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "namespace": "test",
- "uses_feature_system": true,
- "extension_types": ["extension"],
- "contexts": ["blessed_extension"],
- "functions": [
- {
- "name": "foo",
- "dependencies": ["test2:monkey"]
- },
- {
- "name": "bar",
- "dependencies": ["api:test.foo"]
- }
- ]
- }
-]
diff --git a/chrome/test/data/extensions/extension_api_unittest/privileged_api_features.json b/chrome/test/data/extensions/extension_api_unittest/privileged_api_features.json
new file mode 100644
index 0000000..b32781d
--- /dev/null
+++ b/chrome/test/data/extensions/extension_api_unittest/privileged_api_features.json
@@ -0,0 +1,32 @@
+{
+ "test1": {
+ "contexts": ["content_script"]
+ },
+ "test1.foo": {
+ "contexts": ["blessed_extension"]
+ },
+ "test2": {
+ "contexts": ["blessed_extension"],
+ "dependencies": ["api:test1"]
+ },
+ "test2.foo": {
+ "contexts": ["content_script"]
+ },
+ "test2.bar": {
+ "contexts": ["content_script", "blessed_extension"]
+ },
+ "test2.baz": {
+ "contexts": ["blessed_extension"],
+ "dependencies": ["api:test2.foo"]
+ },
+ "test3": {
+ "contexts": ["content_script", "blessed_extension"]
+ },
+ "test3.foo": {
+ "contexts": ["blessed_extension"]
+ },
+ "test4": {
+ "contexts": ["content_script"],
+ "dependencies": ["api:test1.foo"]
+ }
+}