Bug 1769791, part 2 - Add allowXULXBL for file URIs for reftests even if not http. r=jmaher

This ensures we have the permission to load XUL files from file URIs when we are
not using HTTP, which we seem to need for remote reftests, like Android.

This also removes the setting of dom.allow_XUL_XBL_for_file in the reftest pref
file, which doesn't seem to be enough to make Android remote reftests work for
some reason, so I don't think it is doing anything.

Differential Revision: https://phabricator.services.mozilla.com/D154690
This commit is contained in:
Andrew McCreight 2022-08-18 22:14:54 +00:00
Родитель a3fb85df7b
Коммит 8f54548bda
2 изменённых файлов: 6 добавлений и 13 удалений

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

@ -714,16 +714,7 @@ function ServeTestBase(aURL, depth) {
// this one is needed so tests can use example.org urls for cross origin testing
g.server.registerDirectory("/", directory);
var secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
.getService(Ci.nsIScriptSecurityManager);
var testbase = g.ioService.newURI("http://localhost:" + g.httpServerPort +
path + dirPath);
var testBasePrincipal = secMan.createContentPrincipal(testbase, {});
// Give the testbase URI access to XUL and XBL
Services.perms.addFromPrincipal(testBasePrincipal, "allowXULXBL", Services.perms.ALLOW_ACTION);
return testbase;
return g.ioService.newURI("http://localhost:" + g.httpServerPort + path + dirPath);
}
function CreateUrls(test) {
@ -733,8 +724,12 @@ function CreateUrls(test) {
let manifestURL = g.ioService.newURI(test.manifest);
let testbase = manifestURL;
if (test.runHttp)
if (test.runHttp) {
testbase = ServeTestBase(manifestURL, test.httpDepth)
}
let testbasePrincipal = secMan.createContentPrincipal(testbase, {});
Services.perms.addFromPrincipal(testbasePrincipal, "allowXULXBL", Services.perms.ALLOW_ACTION);
function FileToURI(file)
{

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

@ -25,8 +25,6 @@ user_pref("browser.startup.page", 0);
// assumed 980px content.
user_pref("browser.viewport.desktopWidth", 800);
user_pref("datareporting.healthreport.uploadEnabled", false);
// Allow XUL and XBL files to be opened from file:// URIs
user_pref("dom.allow_XUL_XBL_for_file", true);
// Don't forcibly kill content processes after a timeout
user_pref("dom.ipc.tabs.shutdownTimeoutSecs", 0);
// For mochitests, we're more interested in testing the behavior of in-