Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 824670 - Tests. r=mounir

  • Loading branch information...
commit 7d671855ac0a1e5c2383494c31f0cbe6de958e05 1 parent b850efe
@bholley bholley authored
View
6 dom/tests/mochitest/webapps/apps/Makefile.in
@@ -34,6 +34,12 @@ MOCHITEST_CHROME_FILES = \
invalid_entry_point.webapp^headers^ \
invalid_locale_entry_point.webapp \
invalid_locale_entry_point.webapp^headers^ \
+ invalid_activity_href.webapp \
+ invalid_activity_href.webapp^headers^ \
+ invalid_activity_href2.webapp \
+ invalid_activity_href2.webapp^headers^ \
+ invalid_message.webapp \
+ invalid_message.webapp^headers^ \
launch_paths.webapp \
launch_paths.webapp^headers^ \
$(NULL)
View
14 dom/tests/mochitest/webapps/apps/basic.webapp
@@ -1,4 +1,16 @@
{
"name": "Basic App",
- "installs_allowed_from": ["*"]
+ "installs_allowed_from": ["*"],
+ "activities": {
+ "without_href": {
+ "returnValue": true
+ },
+ "valid_href": {
+ "returnvalue": true,
+ "href": "/foo.html"
+ }
+ },
+ "messages": [
+ { "valid_message_href": "/bar.html" }
+ ]
}
View
14 dom/tests/mochitest/webapps/apps/invalid_activity_href.webapp
@@ -0,0 +1,14 @@
+{
+ "name": "Absolute Activity Href App",
+ "description": "App with an invalid activity href",
+ "installs_allowed_from": [ "*" ],
+ "activities": {
+ "without_href": { },
+ "absolute_href": {
+ "href": "http://www.mozilla.org"
+ },
+ "valid_href": {
+ "href": "/transfer.html"
+ }
+ }
+}
View
1  dom/tests/mochitest/webapps/apps/invalid_activity_href.webapp^headers^
@@ -0,0 +1 @@
+Content-Type: application/x-web-app-manifest+json
View
14 dom/tests/mochitest/webapps/apps/invalid_activity_href2.webapp
@@ -0,0 +1,14 @@
+{
+ "name": "data:URI Activity Href App",
+ "description": "App with an invalid activity href",
+ "installs_allowed_from": [ "*" ],
+ "activities": {
+ "without_href": { },
+ "valid_href": {
+ "href": "/transfer.html"
+ },
+ "invalid_href": {
+ "href": "data:text/html;base64,PGh0bWw+DQo8aGVhZD4NCjwvaGVhZD4NCjxib2R5Pg0KPGI+SGFoITwvYj4NCjwvYm9keT4NCjwvaHRtbD4="
+ }
+ }
+}
View
1  dom/tests/mochitest/webapps/apps/invalid_activity_href2.webapp^headers^
@@ -0,0 +1 @@
+Content-Type: application/x-web-app-manifest+json
View
8 dom/tests/mochitest/webapps/apps/invalid_message.webapp
@@ -0,0 +1,8 @@
+{
+ "name": "Absolute Message Href App",
+ "description": "App with an invalid message href",
+ "installs_allowed_from": [ "*" ],
+ "messages": [
+ { "absolute_href": "http://www.mozilla.org" }
+ ]
+}
View
1  dom/tests/mochitest/webapps/apps/invalid_message.webapp^headers^
@@ -0,0 +1 @@
+Content-Type: application/x-web-app-manifest+json
View
33 dom/tests/mochitest/webapps/test_install_errors.xul
@@ -29,6 +29,9 @@ var steps = [
invalidLaunchPath2,
invalidEntryPoint,
invalidLocaleEntryPoint,
+ invalidActivityHref,
+ invalidActivityHref2,
+ invalidMessage,
fileURL,
originNotAllowed,
originAllowed,
@@ -144,6 +147,36 @@ function invalidLocaleEntryPoint(next) {
};
}
+function invalidActivityHref(next) {
+ var url = "http://test/chrome/dom/tests/mochitest/webapps/apps/invalid_activity_href.webapp";
+
+ confirmNextInstall();
+ navigator.mozApps.install(url, null).onerror = function onInstallError() {
+ is(this.error.name, "INVALID_MANIFEST", "Manifest has non-relative URI for activity href");
+ next();
+ };
+}
+
+function invalidActivityHref2(next) {
+ var url = "http://test/chrome/dom/tests/mochitest/webapps/apps/invalid_activity_href2.webapp";
+
+ confirmNextInstall();
+ navigator.mozApps.install(url, null).onerror = function onInstallError() {
+ is(this.error.name, "INVALID_MANIFEST", "Manifest has data: URI for activity href");
+ next();
+ };
+}
+
+function invalidMessage(next) {
+ var url = "http://test/chrome/dom/tests/mochitest/webapps/apps/invalid_message.webapp";
+
+ confirmNextInstall();
+ navigator.mozApps.install(url, null).onerror = function onInstallError() {
+ is(this.error.name, "INVALID_MANIFEST", "Manifest has absolute message href");
+ next();
+ };
+}
+
function installPackageNotImplemented(next) {
ok(!("installPackage" in navigator.mozApps),
"installPackage not in navigator.mozApps");
Please sign in to comment.
Something went wrong with that request. Please try again.