mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 824670 - Tests. r=mounir
This commit is contained in:
parent
4a4a0c0bc0
commit
9db284dbf1
@ -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)
|
||||
|
@ -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" }
|
||||
]
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
Content-Type: application/x-web-app-manifest+json
|
@ -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="
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
Content-Type: application/x-web-app-manifest+json
|
8
dom/tests/mochitest/webapps/apps/invalid_message.webapp
Normal file
8
dom/tests/mochitest/webapps/apps/invalid_message.webapp
Normal file
@ -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" }
|
||||
]
|
||||
}
|
@ -0,0 +1 @@
|
||||
Content-Type: application/x-web-app-manifest+json
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user