summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 05:14:15 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 05:14:15 +0000
commit1631f7c651fbc7f4460a852126f545afc5513531 (patch)
tree7176f3052f69c0c0debf48172d533f9acc4c83d3 /chrome/test
parent42a17153ee389574560b91b185bcec6c4db5b5c3 (diff)
downloadchromium_src-1631f7c651fbc7f4460a852126f545afc5513531.zip
chromium_src-1631f7c651fbc7f4460a852126f545afc5513531.tar.gz
chromium_src-1631f7c651fbc7f4460a852126f545afc5513531.tar.bz2
Implement web app definition parsing.
This required moving some code from webkit/glue to chrome/common/web_apps.cc so that it could rely on chrome/common/json_schema_validator.h. BUG=49233 TEST=Convered by unit tests. Review URL: http://codereview.chromium.org/4979003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/web_app_info/full.json14
-rw-r--r--chrome/test/data/web_app_info/invalid_icon_url.json8
-rw-r--r--chrome/test/data/web_app_info/invalid_launch_url.json4
-rw-r--r--chrome/test/data/web_app_info/invalid_urls.json9
-rw-r--r--chrome/test/data/web_app_info/minimal.json4
-rw-r--r--chrome/test/data/web_app_info/missing_name.json3
6 files changed, 42 insertions, 0 deletions
diff --git a/chrome/test/data/web_app_info/full.json b/chrome/test/data/web_app_info/full.json
new file mode 100644
index 0000000..ef38f53
--- /dev/null
+++ b/chrome/test/data/web_app_info/full.json
@@ -0,0 +1,14 @@
+{
+ "name": "hello",
+ "description": "This app is super awesome",
+ "launch_url": "launch_url",
+ "launch_container": "panel",
+ "permissions": [ "geolocation", "notifications" ],
+ "urls": [ "foobar", "baz" ],
+ "icons": {
+ "ignored": "ignored.png",
+ "16": "16.png",
+ // We also ignore this because it is larger than 128.
+ "500": "500.png"
+ }
+}
diff --git a/chrome/test/data/web_app_info/invalid_icon_url.json b/chrome/test/data/web_app_info/invalid_icon_url.json
new file mode 100644
index 0000000..3389d26
--- /dev/null
+++ b/chrome/test/data/web_app_info/invalid_icon_url.json
@@ -0,0 +1,8 @@
+{
+ "name": "hello",
+ "launch_url": "launch_url",
+ "icons": {
+ "16", "16.png",
+ "32": "http://someotherdomain.com/32"
+ ]
+}
diff --git a/chrome/test/data/web_app_info/invalid_launch_url.json b/chrome/test/data/web_app_info/invalid_launch_url.json
new file mode 100644
index 0000000..3c9c81e
--- /dev/null
+++ b/chrome/test/data/web_app_info/invalid_launch_url.json
@@ -0,0 +1,4 @@
+{
+ "name": "hello",
+ "launch_url": "http://someotherdomain.com/monkey"
+}
diff --git a/chrome/test/data/web_app_info/invalid_urls.json b/chrome/test/data/web_app_info/invalid_urls.json
new file mode 100644
index 0000000..f347073
--- /dev/null
+++ b/chrome/test/data/web_app_info/invalid_urls.json
@@ -0,0 +1,9 @@
+{
+ "name": "hello",
+ "launch_url": "launch_url",
+ "urls": [
+ "relative",
+ "http://example.com/valid_absolute",
+ "http://someotherdomain.com/invalid_absolute"
+ ]
+}
diff --git a/chrome/test/data/web_app_info/minimal.json b/chrome/test/data/web_app_info/minimal.json
new file mode 100644
index 0000000..e5b6a6a
--- /dev/null
+++ b/chrome/test/data/web_app_info/minimal.json
@@ -0,0 +1,4 @@
+{
+ "name": "hello",
+ "launch_url": "launch_url"
+}
diff --git a/chrome/test/data/web_app_info/missing_name.json b/chrome/test/data/web_app_info/missing_name.json
new file mode 100644
index 0000000..d1833e5
--- /dev/null
+++ b/chrome/test/data/web_app_info/missing_name.json
@@ -0,0 +1,3 @@
+{
+ "launch_url": "monkey"
+}