Backed out changeset 878c54ec3954 (bug 1250453)

This commit is contained in:
Carsten "Tomcat" Book 2016-03-10 14:45:59 +01:00
Родитель 31c9baf084
Коммит 25fbf67b66
76 изменённых файлов: 131 добавлений и 0 удалений

Просмотреть файл

@ -45,6 +45,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Screenshot",
"resource://gre/modules/Screenshot.jsm");
Cu.import('resource://gre/modules/Webapps.jsm');
DOMApplicationRegistry.allAppsLaunchable = true;
XPCOMUtils.defineLazyServiceGetter(Services, 'env',
'@mozilla.org/process/environment;1',

Просмотреть файл

@ -204,6 +204,7 @@ function installApp() {
function setup() {
info("Setting up");
return new Promise((resolve, reject) => {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set": [
["dom.mozBrowserFramesEnabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],

Просмотреть файл

@ -71,6 +71,7 @@ var steps = [
function() {
info("== SETUP ==");
// Set up
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
SpecialPowers.addPermission("browser", true, document);
SpecialPowers.addPermission("embed-apps", true, document);

Просмотреть файл

@ -80,7 +80,10 @@ function setup() {
Components.utils.import("resource://testing-common/AppInfo.jsm");
updateAppInfo();
// We have to toggle this flag in order to have apps being listed in getAll
// as only launchable apps are returned
Components.utils.import('resource://gre/modules/Webapps.jsm');
DOMApplicationRegistry.allAppsLaunchable = true;
// Enable launch/close method of the webapps actor
let {WebappsActor} = require("devtools/server/actors/webapps");

Просмотреть файл

@ -163,6 +163,8 @@ obsService.addObserver(continueTest, "new-activity-registered-failure", false);
* Test dev mode activity.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -124,6 +124,8 @@ function continueTest() {
}
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -196,6 +196,7 @@ this.DOMApplicationRegistry = {
// Path to the webapps.json file where we store the registry data.
appsFile: null,
webapps: { },
allAppsLaunchable: false,
_updateHandlers: [ ],
_pendingUninstalls: {},
_contentActions: new Map(),

Просмотреть файл

@ -1,4 +1,5 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.setAllAppsLaunchable(true);
var fileTestOnCurrentOrigin = 'http://example.org/tests/dom/apps/tests/file_bug_779982.html';

Просмотреть файл

@ -193,6 +193,7 @@ var tests = [
// No confirmation needed when an app is installed
function() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(() => {
SpecialPowers.autoConfirmAppUninstall(runTest);
});

Просмотреть файл

@ -8,6 +8,19 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function runAll(steps) {
SimpleTest.waitForExplicitFinish();
/**
* On Mac, apps aren't considered launchable right after they've been
* installed because the OS takes some time to detect them (so
* nsIMacWebAppUtils::pathForAppWithIdentifier() returns null).
* That causes methods like mgmt.getAll() to exclude the app from their
* results, even though the app is installed and is in the registry.
* See the tests under toolkit/webapps for a viable solution.
*
* To work around this problem, set allAppsLaunchable to true, which makes
* all apps considered as launchable.
*/
SpecialPowers.setAllAppsLaunchable(true);
// Clone the array so we don't modify the original.
steps = steps.concat();
function next() {

Просмотреть файл

@ -104,6 +104,7 @@ function installApp(manifestURL, expectedError) {
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.allowUnsignedAddons();
SpecialPowers.debugUserCustomizations(true);
SpecialPowers.pushPrefEnv({'set': [

Просмотреть файл

@ -113,6 +113,8 @@ function installApp(manifestURL) {
* Test blocking of an add-on.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -53,6 +53,8 @@ SimpleTest.waitForExplicitFinish();
* Flip the `enabled` state of an app back and forth.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -61,6 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=826058
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
// Test Bug 927699 - navigator.mozApps.install(url) lets NS_ERROR_FAILURE
// onto the web
var request = navigator.mozApps.install("");

Просмотреть файл

@ -40,6 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1168300
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -20,6 +20,8 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.setAllAppsLaunchable(true);
var mmListener = {
receiveMessage: function(aMessage) {
ppmm.removeMessageListener("Webapps:Install", mmListener);

Просмотреть файл

@ -19,6 +19,8 @@
<script>
SimpleTest.waitForExplicitFinish();
SpecialPowers.setAllAppsLaunchable(true);
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PopupNotifications.jsm");

Просмотреть файл

@ -41,6 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=795164
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -47,6 +47,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=945152
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({
"set": [
["dom.mozBrowserFramesEnabled", true],

Просмотреть файл

@ -53,6 +53,8 @@ function cbError(aError) {
SimpleTest.waitForExplicitFinish();
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -149,6 +149,7 @@ function launchApp(app) {
const tests = [() => {
info("Test start");
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(() => {
SpecialPowers.autoConfirmAppUninstall(next);
});

Просмотреть файл

@ -81,6 +81,8 @@ SimpleTest.waitForExplicitFinish();
* Test exporting and importing hosted and packaged apps.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -60,6 +60,8 @@ SimpleTest.waitForExplicitFinish();
* Install 2 apps from the same origin and uninstall them.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -53,6 +53,8 @@ SimpleTest.waitForExplicitFinish();
* Install 2 apps from the same origin and uninstall them.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
var manifestURL1 = gManifestURL + "&app=1";
var manifestURL2 = gManifestURL + "&app=2";

Просмотреть файл

@ -53,6 +53,8 @@ function cbError(aError) {
SimpleTest.waitForExplicitFinish();
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -93,6 +93,7 @@ function installApp(manifestURL) {
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({'set': [
["dom.mozBrowserFramesEnabled", true],
["dom.apps.allow_unsigned_langpacks", true] ]},continueTest);

Просмотреть файл

@ -128,6 +128,7 @@ function installApp(installOrigin, manifestURL) {
PackagedTestHelper.setSteps([
function() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
SpecialPowers.addPermission("browser", true, document);
SpecialPowers.autoConfirmAppInstall(() =>

Просмотреть файл

@ -125,6 +125,7 @@ function testNoPrecompile(aPrecompile, aCallback) {
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({'set': [["dom.mozBrowserFramesEnabled", true]]},
continueTest);
yield undefined;

Просмотреть файл

@ -87,6 +87,7 @@ SimpleTest.requestFlakyTimeout("untriaged");
var steps = [
function() {
// Set up
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
info("Set up");
PackagedTestHelper.next();

Просмотреть файл

@ -142,6 +142,7 @@ function validatePermissions(aList, aDontFail) {
var steps = [
function() {
// Set up
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
info("Set up");
// Note that without useCurrentProfile the permissions just aren't added.

Просмотреть файл

@ -53,6 +53,8 @@ function cbError(aEvent) {
SimpleTest.waitForExplicitFinish();
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -95,6 +95,7 @@ var steps = [
var url = SimpleTest.getTestFileURL("chromeAddCert.js");
var script = SpecialPowers.loadChromeScript(url);
script.addMessageListener("addCertCompleted", function() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
info("Test CA Certificate Selected");
PackagedTestHelper.next();

Просмотреть файл

@ -56,6 +56,8 @@ SimpleTest.waitForExplicitFinish();
* Checks that no apps that are not certified can be installed as themes.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -146,6 +146,8 @@ SimpleTest.waitForExplicitFinish();
* Test third-party homescreen (permission |homescreen-webapps-manage|)
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -41,6 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830258
function runTest() {
// Set up.
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -103,6 +103,8 @@ SimpleTest.waitForExplicitFinish();
* Install a web app from a manifest with application/manifest+json MIME type.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
var manifestURL = "http://test/tests/dom/apps/tests/file_manifest.json";
SpecialPowers.autoConfirmAppInstall(continueTest);

Просмотреть файл

@ -10,6 +10,8 @@ SimpleTest.waitForExplicitFinish();
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
SpecialPowers.setAllAppsLaunchable(true);
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', 'true');

Просмотреть файл

@ -8,6 +8,8 @@ SimpleTest.waitForExplicitFinish();
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
SpecialPowers.setAllAppsLaunchable(true);
function testAppElement(expectAnApp, callback) {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', 'true');

Просмотреть файл

@ -14,6 +14,8 @@ SimpleTest.waitForExplicitFinish();
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
SpecialPowers.setAllAppsLaunchable(true);
function runTest() {
var canEmbedApp = !browserElementTestHelpers.getOOPByDefaultPref();
var iframe = document.createElement('iframe');

Просмотреть файл

@ -124,6 +124,7 @@ function runNextTest() {
}
function startTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -117,6 +117,7 @@ function runNextTest() {
}
function runTests() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -23,6 +23,7 @@ let gApp;
function setup() {
return new Promise((resolve, reject) => {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({'set': [
['dom.mozBrowserFramesEnabled', true],
['dom.serviceWorkers.exemptFromPerDomainMax', true],

Просмотреть файл

@ -49,6 +49,7 @@
ok("getDataStores" in navigator, "getDataStores exists");
is(typeof navigator.getDataStores, "function", "getDataStores exists and it's a function");
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest)
},

Просмотреть файл

@ -89,6 +89,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -93,6 +93,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -93,6 +93,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -86,6 +86,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set": [["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -95,6 +95,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -132,6 +132,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set": [["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -87,6 +87,7 @@
},
function() {
SpecialPowers.setAllAppsLaunchable(true);
// No confirmation needed when an app is installed.
SpecialPowers.autoConfirmAppInstall(() => {
SpecialPowers.autoConfirmAppUninstall(runTest);

Просмотреть файл

@ -89,6 +89,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -117,6 +117,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -36,6 +36,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -88,6 +88,7 @@
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
}
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTest);
},

Просмотреть файл

@ -166,6 +166,7 @@
function() {
info("enabling use of mozbrowser");
//SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
runTests();
},

Просмотреть файл

@ -115,6 +115,8 @@ function start()
SpecialPowers.addPermission("embed-apps", true, document);
SpecialPowers.addPermission("indexedDB", true, { manifestURL: manifestURL });
SpecialPowers.setAllAppsLaunchable(true);
window.addEventListener("unload", function cleanup(event) {
if (event.target == document) {
window.removeEventListener("unload", cleanup, false);

Просмотреть файл

@ -31,6 +31,8 @@ var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('test_per
// Delay reporting a result until after finish() got called
SimpleTest.waitForExplicitFinish();
// Allow tests to disable the per platform app validity checks
SpecialPowers.setAllAppsLaunchable(true);
// Run tests in order
function runTests() {

Просмотреть файл

@ -140,6 +140,7 @@ function testBroadcastMessage(aMessage, aExpectedManifestURL, aMsg) {
*/
let steps = [() => {
Services.obs.notifyObservers(null, "webapps-registry-ready", null);
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(next);
}, () => {
SpecialPowers.autoConfirmAppUninstall(next);

Просмотреть файл

@ -86,6 +86,7 @@
function() {
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTests);
},

Просмотреть файл

@ -26,6 +26,7 @@
function setupTest() {
// We have to install an app in order for the app URL to be valid
// (otherwise we get a "DummyChannel" that throws NS_NOT_IMPLEMENTED)
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.addPermission("webapps-manage", true, document);
SpecialPowers.autoConfirmAppInstall(function () {
let req = navigator.mozApps.install(gManifestURL);

Просмотреть файл

@ -24,6 +24,7 @@ let gApp;
function setup() {
info('Setting up');
return new Promise((resolve, reject) => {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.pushPrefEnv({'set': [
['dom.mozBrowserFramesEnabled', true]
]}, () => {

Просмотреть файл

@ -76,6 +76,9 @@ SimpleTest.registerCleanupFunction(() => {
Ci.nsIPermissionManager.ALLOW_ACTION);
});
// We want to simulate that all apps are launchable, for testing purpose.
SpecialPowers.setAllAppsLaunchable(true);
// URL of the manifest of the app we want to install.
const gManifestURL = "http://www.example.com/chrome/dom/apps/tests/apps/basic.webapp";
// ID of the installed app.

Просмотреть файл

@ -9,6 +9,7 @@ var NotificationTest = (function () {
SimpleTest.waitForExplicitFinish();
// turn on testing pref (used by notification.cpp, and mock the alerts
SpecialPowers.setBoolPref("notification.prompt.testing", true);
SpecialPowers.setAllAppsLaunchable(true);
}
function teardown_testing_env() {

Просмотреть файл

@ -91,6 +91,7 @@ function runTest() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Install the app
SpecialPowers.setAllAppsLaunchable(true);
var manifestURL = "http://test/tests/dom/apps/tests/file_app.sjs?apptype=hosted&getmanifest=true";
SpecialPowers.autoConfirmAppInstall(continueTest);

Просмотреть файл

@ -1070,6 +1070,7 @@ SimpleTest.finish = function() {
}
if (!parentRunner || parentRunner.showTestReport) {
SpecialPowers.flushAllAppsLaunchable();
SpecialPowers.flushPermissions(function () {
SpecialPowers.flushPrefEnv(function() {
SimpleTest.showReport();

Просмотреть файл

@ -596,6 +596,7 @@ TestRunner.testFinished = function(tests) {
SpecialPowers.executeAfterFlushingMessageQueue(function() {
cleanUpCrashDumpFiles();
SpecialPowers.flushAllAppsLaunchable();
SpecialPowers.flushPermissions(function () { SpecialPowers.flushPrefEnv(runNextTest); });
});
};

Просмотреть файл

@ -355,6 +355,10 @@ SpecialPowersObserverAPI.prototype = {
let Webapps = {};
Components.utils.import("resource://gre/modules/Webapps.jsm", Webapps);
switch (aMessage.json.op) {
case "set-launchable":
let val = Webapps.DOMApplicationRegistry.allAppsLaunchable;
Webapps.DOMApplicationRegistry.allAppsLaunchable = aMessage.json.launchable;
return val;
case "allow-unsigned-addons":
{
let utils = {};

Просмотреть файл

@ -1130,6 +1130,15 @@ SpecialPowersAPI.prototype = {
this.pushPrefEnv({set: [['dom.mozApps.auto_confirm_uninstall', true]]}, cb);
},
// Allow tests to disable the per platform app validity checks so we can
// test higher level WebApp functionality without full platform support.
setAllAppsLaunchable: function(launchable) {
this._sendSyncMessage("SPWebAppService", {
op: "set-launchable",
launchable: launchable
});
},
// Allow tests to install addons without signing the package, for convenience.
allowUnsignedAddons: function() {
this._sendSyncMessage("SPWebAppService", {
@ -1145,6 +1154,14 @@ SpecialPowersAPI.prototype = {
});
},
// Restore the launchable property to its default value.
flushAllAppsLaunchable: function() {
this._sendSyncMessage("SPWebAppService", {
op: "set-launchable",
launchable: false
});
},
// Force-registering an app in the registry
injectApp: function(aAppId, aApp) {
this._sendSyncMessage("SPWebAppService", {