Bug 1040179 - Test marketplace-dev certificates. r=fabrice

This commit is contained in:
Marco Castelluccio 2014-07-19 13:51:24 +02:00
parent b74e67ea7b
commit 4da9c38f85
13 changed files with 77 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -215,3 +215,4 @@ http://example.fi:80 privileged
# Hosts for testing marketplace apps installations
https://marketplace.firefox.com:443 privileged
https://marketplace-dev.allizom.org:443 privileged

View File

@ -0,0 +1 @@
{"name": "Flashlight (Linterna)", "icons": {"60": "/img/icons/mortar-60.png", "128": "/img/icons/mortar-128.png", "48": "/img/icons/mortar-48.png", "16": "/img/icons/mortar-16.png"}, "version": "3.0", "package_path": "marketplace_dev_app.zip", "size": 211752, "release_notes": "", "locales": {"es": {"description": "Una simple linterna que puedes utilizar en cualquier lugar sin conexi\u00f3n a internet y con opciones geniales: * Modo Linterna - * Modo Disco - * Modo Colores", "developer": {"url": "https://twitter.com/tecnowilliam", "name": "William Vargas"}}}, "developer": {"url": "https://twitter.com/tecnowilliam", "name": "William Vargas"}}

View File

@ -0,0 +1 @@
Content-Type: application/x-web-app-manifest+json

Binary file not shown.

View File

@ -0,0 +1 @@
{"name": "KitchenSink", "icons": {"128": "/img/icons/logo-128.png", "32": "/img/icons/logo-32.png", "64": "/img/icons/logo-64.png", "256": "/img/icons/logo-256.png", "16": "/img/icons/logo-16.png"}, "version": "0.2.2", "package_path": "marketplace_dev_privileged_app.zip", "size": 253433, "release_notes": "Fixed the browser API test and its documentation link.", "developer": {"url": "http://www.mozillalabs.com", "name": "Piotr Zalewa"}}

View File

@ -0,0 +1 @@
Content-Type: application/x-web-app-manifest+json

View File

@ -0,0 +1 @@
{"name": "Test WebAPI Permissions", "icons": {"128": "/qalogo.png"}, "version": "1.8", "package_path": "marketplace_dev_reviewers_app.zip", "size": 18850, "release_notes": null, "developer": {"url": "http://jasondanielsmith.wordpress.com/", "name": "Mozilla QA"}}

View File

@ -0,0 +1 @@
Content-Type: application/x-web-app-manifest+json

View File

@ -31,6 +31,9 @@ let gExternalAppsPath = gExternalInstallOrigin + "tests/dom/apps/tests/marketpla
let gMarketplaceInstallOrigin = "https://marketplace.firefox.com/";
let gMarketplaceAppsPath = gMarketplaceInstallOrigin + "tests/dom/apps/tests/marketplace/";
let gMarketplaceDevInstallOrigin = "https://marketplace-dev.allizom.org/";
let gMarketplaceDevAppsPath = gMarketplaceDevInstallOrigin + "tests/dom/apps/tests/marketplace/";
SimpleTest.waitForExplicitFinish();
function checkAppOnInstallSuccess(aExpected) {
@ -184,6 +187,73 @@ PackagedTestHelper.setSteps([
checkAppOnInstallError("INVALID_SIGNATURE");
installApp(gExternalInstallOrigin, gExternalAppsPath + "marketplace_reviewers_app.webapp");
},
function() {
let signedAppOrigins = SpecialPowers.getCharPref("dom.mozApps.signed_apps_installable_from");
signedAppOrigins = signedAppOrigins.concat("," + gMarketplaceDevInstallOrigin.slice(0,-1));
SpecialPowers.pushPrefEnv({
set: [
['dom.mozApps.signed_apps_installable_from', signedAppOrigins],
["dom.mozApps.use_reviewer_certs", true],
]
}, PackagedTestHelper.next);
},
function() {
info("== TEST == Marketplace-dev packaged app from https://marketplace.firefox.com/");
checkAppOnInstallError("INVALID_SIGNATURE");
installApp(gMarketplaceInstallOrigin, gMarketplaceAppsPath + "marketplace_dev_app.webapp");
},
function() {
info("== TEST == Marketplace-dev packaged app from https://marketplace-dev.allizom.org/");
let miniManifestURL = gMarketplaceDevAppsPath + "marketplace_dev_app.webapp";
let expected = {
name: "Flashlight (Linterna)",
manifestURL: miniManifestURL,
installOrigin: gMarketplaceDevInstallOrigin.slice(0, -1),
progress: 0,
installState: "installed",
downloadAvailable: false,
downloading: false,
readyToApplyDownload: false,
launch_path: "/index.html",
version: "3.0",
};
checkAppOnInstallSuccess(expected);
installApp(gMarketplaceDevInstallOrigin, miniManifestURL);
},
function() {
info("== TEST == Marketplace-dev privileged app from https://marketplace.firefox.com/");
checkAppOnInstallError("INVALID_SIGNATURE");
installApp(gMarketplaceInstallOrigin, gMarketplaceAppsPath + "marketplace_dev_privileged_app.webapp");
},
function() {
info("== TEST == Marketplace-dev privileged app from https://marketplace-dev.allizom.org/");
let miniManifestURL = gMarketplaceDevAppsPath + "marketplace_dev_privileged_app.webapp";
let expected = {
name: "KitchenSink",
manifestURL: miniManifestURL,
installOrigin: gMarketplaceDevInstallOrigin.slice(0, -1),
progress: 0,
installState: "installed",
downloadAvailable: false,
downloading: false,
readyToApplyDownload: false,
launch_path: "/index.html",
version: "0.2.2",
};
checkAppOnInstallSuccess(expected);
installApp(gMarketplaceDevInstallOrigin, miniManifestURL);
},
function() {
info("== TEST == Marketplace-dev reviewers packaged app from https://marketplace.firefox.com/");
checkAppOnInstallError("INVALID_SIGNATURE");
installApp(gMarketplaceInstallOrigin, gMarketplaceAppsPath + "marketplace_dev_reviewers_app.webapp");
},
function() {
info("== TEST == Marketplace-dev reviewers packaged app from https://marketplace-dev.allizom.org/");
checkAppOnInstallError("INVALID_SIGNATURE");
installApp(gMarketplaceDevInstallOrigin, gMarketplaceDevAppsPath + "marketplace_dev_reviewers_app.webapp");
},
function() {
PackagedTestHelper.finish();
}