mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Backed out changeset 878c54ec3954 (bug 1250453
)
This commit is contained in:
parent
31c9baf084
commit
25fbf67b66
@ -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", {
|
||||
|
Loading…
Reference in New Issue
Block a user