зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2996cc51cb0d (bug 1000305)
This commit is contained in:
Родитель
099c1c9b78
Коммит
be6a4e2137
|
@ -1,19 +1,13 @@
|
||||||
{
|
{
|
||||||
"name": "My W3C Web App",
|
"name": "My W3C Web App",
|
||||||
"short_name": "My App",
|
"short_name": "My App",
|
||||||
"icons": {
|
"icons": [
|
||||||
"15": "/tests/dom/apps/tests/icon15.png",
|
{
|
||||||
"48": "/tests/dom/apps/tests/icon48.png"
|
"src": "/favicon.ico",
|
||||||
},
|
"sizes": "64x64",
|
||||||
"start_url": "/index.html",
|
"type": "image/png"
|
||||||
"display": "standalone",
|
|
||||||
"entry_points": {
|
|
||||||
"ep1": {
|
|
||||||
"name": "This is an entry point",
|
|
||||||
"icons": {
|
|
||||||
"15": "/tests/dom/apps/tests/icon15alternate.png",
|
|
||||||
"48": "/tests/dom/apps/tests/icon48.png"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
|
"start_url": "/index.html",
|
||||||
|
"display": "standalone"
|
||||||
}
|
}
|
|
@ -17,13 +17,6 @@ var gAppName = "appname";
|
||||||
var gDevName = "devname";
|
var gDevName = "devname";
|
||||||
var gDevUrl = "http://dev.url";
|
var gDevUrl = "http://dev.url";
|
||||||
|
|
||||||
var gIconData =
|
|
||||||
"iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAABGdBTUEAANbY1E9YMgAAABl0RVh0" +
|
|
||||||
"U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA5UExURbVCQs6UlM6EhJwhIa0hIc5zc5wQ" +
|
|
||||||
"EL1SUu/W1rVjY6UQELUAAOfGxue1tZwAAIwAAP///3sAAK0AAOytg2MAAABmSURBVHjabIkLEsJA" +
|
|
||||||
"CEOz249aIUDvf1ihVWe208ADQvDeh8I+6s7zSw0wJ6vPA5z7o+u8LbrUD4SXnkln5XSHJnAhDWau" +
|
|
||||||
"tia1jeXlz7SeeRy5TC6wkBaWhLZoL4RF9Q/EqKv/CDAAFpEM3avxBREAAAAASUVORK5CYII=";
|
|
||||||
|
|
||||||
function handleRequest(request, response) {
|
function handleRequest(request, response) {
|
||||||
var query = getQuery(request);
|
var query = getQuery(request);
|
||||||
|
|
||||||
|
@ -94,9 +87,6 @@ function handleRequest(request, response) {
|
||||||
appName, devName, devUrl);
|
appName, devName, devUrl);
|
||||||
addZipEntry(zipWriter, app, "index.html");
|
addZipEntry(zipWriter, app, "index.html");
|
||||||
|
|
||||||
var iconString = atob(gIconData);
|
|
||||||
addZipEntry(zipWriter, iconString, "icon.png");
|
|
||||||
|
|
||||||
zipWriter.close();
|
zipWriter.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
"downloads": {}
|
"downloads": {}
|
||||||
},
|
},
|
||||||
"launch_path": "tests/dom/apps/tests/file_packaged_app.sjs",
|
"launch_path": "tests/dom/apps/tests/file_packaged_app.sjs",
|
||||||
"icons": {
|
|
||||||
"15": "icon.png"
|
|
||||||
},
|
|
||||||
"developer": {
|
"developer": {
|
||||||
"name": "DEVELOPERTOKEN",
|
"name": "DEVELOPERTOKEN",
|
||||||
"url": "DEVELOPERURLTOKEN"
|
"url": "DEVELOPERURLTOKEN"
|
||||||
|
|
Двоичные данные
dom/apps/tests/icon15.png
Двоичные данные
dom/apps/tests/icon15.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 281 B |
Двоичные данные
dom/apps/tests/icon15alternate.png
Двоичные данные
dom/apps/tests/icon15alternate.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 224 B |
Двоичные данные
dom/apps/tests/icon48.png
Двоичные данные
dom/apps/tests/icon48.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 4.7 KiB |
|
@ -28,9 +28,6 @@ support-files =
|
||||||
test_packaged_app_common.js
|
test_packaged_app_common.js
|
||||||
marketplace/*
|
marketplace/*
|
||||||
pkg_install_iframe.html
|
pkg_install_iframe.html
|
||||||
icon15.png
|
|
||||||
icon15alternate.png
|
|
||||||
icon48.png
|
|
||||||
|
|
||||||
[test_app_addons.html]
|
[test_app_addons.html]
|
||||||
skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
|
skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
|
||||||
|
|
|
@ -76,15 +76,6 @@ function checkInstalledApp(aMiniManifestURL,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var gIconData =
|
|
||||||
"iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAABGdBTUEAANbY1E9YMgAAABl0RVh0" +
|
|
||||||
"U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA5UExURbVCQs6UlM6EhJwhIa0hIc5zc5wQ" +
|
|
||||||
"EL1SUu/W1rVjY6UQELUAAOfGxue1tZwAAIwAAP///3sAAK0AAOytg2MAAABmSURBVHjabIkLEsJA" +
|
|
||||||
"CEOz249aIUDvf1ihVWe208ADQvDeh8I+6s7zSw0wJ6vPA5z7o+u8LbrUD4SXnkln5XSHJnAhDWau" +
|
|
||||||
"tia1jeXlz7SeeRy5TC6wkBaWhLZoL4RF9Q/EqKv/CDAAFpEM3avxBREAAAAASUVORK5CYII=";
|
|
||||||
|
|
||||||
var gIconSize = 15;
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
SimpleTest.requestFlakyTimeout("untriaged");
|
||||||
|
|
||||||
|
@ -204,7 +195,6 @@ var steps = [
|
||||||
info("== TEST == Install packaged app");
|
info("== TEST == Install packaged app");
|
||||||
var miniManifestURL = PackagedTestHelper.gSJS +
|
var miniManifestURL = PackagedTestHelper.gSJS +
|
||||||
"?getManifest=true";
|
"?getManifest=true";
|
||||||
|
|
||||||
navigator.mozApps.mgmt.oninstall = function(evt) {
|
navigator.mozApps.mgmt.oninstall = function(evt) {
|
||||||
info("Got oninstall event");
|
info("Got oninstall event");
|
||||||
PackagedTestHelper.gApp = evt.application;
|
PackagedTestHelper.gApp = evt.application;
|
||||||
|
@ -241,25 +231,6 @@ var steps = [
|
||||||
function() {
|
function() {
|
||||||
PackagedTestHelper.setAppVersion(3, PackagedTestHelper.next, false, true);
|
PackagedTestHelper.setAppVersion(3, PackagedTestHelper.next, false, true);
|
||||||
},
|
},
|
||||||
function() {
|
|
||||||
info("== TEST == Get icon");
|
|
||||||
var app = PackagedTestHelper.gApp;
|
|
||||||
|
|
||||||
navigator.mozApps.mgmt.getIcon(app, gIconSize).then((blob) => {
|
|
||||||
var reader = new FileReader();
|
|
||||||
|
|
||||||
reader.onloadend = function() {
|
|
||||||
var success = btoa(reader.result) == gIconData;
|
|
||||||
ok(success, "== TEST == Icon matches expected icon");
|
|
||||||
PackagedTestHelper.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
reader.readAsBinaryString(blob);
|
|
||||||
}, (err) => {
|
|
||||||
ok(false, "Can't get icon: " + err);
|
|
||||||
PackagedTestHelper.finish();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function() {
|
function() {
|
||||||
info("== TEST == Install packaged app with a cancel/resume");
|
info("== TEST == Install packaged app with a cancel/resume");
|
||||||
var miniManifestURL = PackagedTestHelper.gSJS +
|
var miniManifestURL = PackagedTestHelper.gSJS +
|
||||||
|
|
|
@ -19,19 +19,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1075716}
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script class="testbody" type="application/javascript;version=1.7">
|
<script class="testbody" type="application/javascript;version=1.7">
|
||||||
|
|
||||||
var gIconData =
|
|
||||||
"iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAABGdBTUEAANbY1E9YMgAAABl0RVh0" +
|
|
||||||
"U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA5UExURbVCQs6UlM6EhJwhIa0hIc5zc5wQ" +
|
|
||||||
"EL1SUu/W1rVjY6UQELUAAOfGxue1tZwAAIwAAP///3sAAK0AAOytg2MAAABmSURBVHjabIkLEsJA" +
|
|
||||||
"CEOz249aIUDvf1ihVWe208ADQvDeh8I+6s7zSw0wJ6vPA5z7o+u8LbrUD4SXnkln5XSHJnAhDWau" +
|
|
||||||
"tia1jeXlz7SeeRy5TC6wkBaWhLZoL4RF9Q/EqKv/CDAAFpEM3avxBREAAAAASUVORK5CYII=";
|
|
||||||
|
|
||||||
var gAlternateIconData =
|
|
||||||
"iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAAp0lEQVQoFWNklZ3AQDRgIlolSOFQ" +
|
|
||||||
"Vc0C8eWvR/nI3n1544a4hgZEZG9nm+dUbggbxZcLfFxv79wGlAAqBbKBCMhWcnCCKAWSULOBLKC6" +
|
|
||||||
"W9ePPM+/VHnjJYQNUfTnwzu4aoTZLAJCQNHPvz8BSQgbogiFDdcHMePD779AEWTzIAqAHrt/8gTU" +
|
|
||||||
"JUDWs/sPgEoFWJnhbKA6oJOA4kDGwRnTHl88zzho0gkAc2hLRzn46hoAAAAASUVORK5CYII=";
|
|
||||||
|
|
||||||
var gGenerator = runTest();
|
var gGenerator = runTest();
|
||||||
|
|
||||||
function go() {
|
function go() {
|
||||||
|
@ -58,20 +45,6 @@ function cbError(aEvent) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
function iconTest(app, iconSize, entryPoint, testFunction) {
|
|
||||||
navigator.mozApps.mgmt.getIcon(app, iconSize, entryPoint).then((blob) => {
|
|
||||||
var reader = new FileReader();
|
|
||||||
reader.onloadend = function() {
|
|
||||||
testFunction(reader.result);
|
|
||||||
continueTest();
|
|
||||||
}
|
|
||||||
reader.readAsBinaryString(blob);
|
|
||||||
}, (err) => {
|
|
||||||
ok(false, "Couldn't get icon.");
|
|
||||||
finish();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,30 +77,6 @@ function runTest() {
|
||||||
ok(app, "App is non-null");
|
ok(app, "App is non-null");
|
||||||
is(app.manifestURL, manifestURL, "App manifest url is correct.");
|
is(app.manifestURL, manifestURL, "App manifest url is correct.");
|
||||||
|
|
||||||
info("Fetching 15x15 icon");
|
|
||||||
iconTest(app, 15, undefined, (iconData) => {
|
|
||||||
is(btoa(iconData), gIconData, "Fetches 15x15 icon successfully.")
|
|
||||||
});
|
|
||||||
yield undefined;
|
|
||||||
|
|
||||||
info("Fetching 48x48 icon");
|
|
||||||
iconTest(app, 48, "ep1", (iconData) => {
|
|
||||||
ok(iconData.length == 4762, "Fetches 48x48 icon successfully.")
|
|
||||||
});
|
|
||||||
yield undefined;
|
|
||||||
|
|
||||||
info("Fetching 30x30 icon");
|
|
||||||
iconTest(app, 30, undefined, (iconData) => {
|
|
||||||
is(btoa(iconData), gIconData, "Fetches 15x15 icon as best fit for 30x30.")
|
|
||||||
});
|
|
||||||
yield undefined;
|
|
||||||
|
|
||||||
info("Fetching entry-point icon");
|
|
||||||
iconTest(app, 15, "ep1", (iconData) => {
|
|
||||||
is(btoa(iconData), gAlternateIconData, "Entry-point Icon fetched successfully.")
|
|
||||||
});
|
|
||||||
yield undefined;
|
|
||||||
|
|
||||||
request = navigator.mozApps.mgmt.uninstall(app);
|
request = navigator.mozApps.mgmt.uninstall(app);
|
||||||
request.onerror = cbError;
|
request.onerror = cbError;
|
||||||
request.onsuccess = continueTest;
|
request.onsuccess = continueTest;
|
||||||
|
|
|
@ -40,7 +40,6 @@ var mgmtProps = {
|
||||||
dispatchEvent: "function",
|
dispatchEvent: "function",
|
||||||
getEventHandler: "function",
|
getEventHandler: "function",
|
||||||
getAll: "function",
|
getAll: "function",
|
||||||
getIcon: "function",
|
|
||||||
getNotInstalled: "function",
|
getNotInstalled: "function",
|
||||||
uninstall: "function",
|
uninstall: "function",
|
||||||
oninstall: "object",
|
oninstall: "object",
|
||||||
|
|
|
@ -2741,8 +2741,6 @@ ServerHandler.prototype =
|
||||||
var sis = new ScriptableInputStream(fis);
|
var sis = new ScriptableInputStream(fis);
|
||||||
var s = Cu.Sandbox(gGlobalObject);
|
var s = Cu.Sandbox(gGlobalObject);
|
||||||
s.importFunction(dump, "dump");
|
s.importFunction(dump, "dump");
|
||||||
s.importFunction(atob, "atob");
|
|
||||||
s.importFunction(btoa, "btoa");
|
|
||||||
|
|
||||||
// Define a basic key-value state-preservation API across requests, with
|
// Define a basic key-value state-preservation API across requests, with
|
||||||
// keys initially corresponding to the empty string.
|
// keys initially corresponding to the empty string.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче