Bug 1520012 - Test which delayedLoad frame scripts are loaded during content process startup. r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D16502

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Felipe Gomes 2019-01-14 22:31:59 +00:00
Родитель 8b80c64ea5
Коммит 6d74998c5d
2 изменённых файлов: 29 добавлений и 2 удалений

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

@ -10,6 +10,9 @@ prefs =
browser.migration.version=9999999
browser.startup.record=true
gfx.canvas.willReadFrequently.enable=true
# The form autofill framescript is only used in certain locales if this
# pref is set to 'detect', which is the default value on non-Nightly.
extensions.formautofill.available='on'
support-files =
head.js
[browser_appmenu.js]

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

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* This test records which services, JS components, process scripts, and JS
* modules are loaded when creating a new content process.
/* This test records which services, JS components, frame scripts, process
* scripts, and JS modules are loaded when creating a new content process.
*
* If you made changes that cause this test to fail, it's likely because you
* are loading more JS code during content process startup.
@ -68,6 +68,23 @@ const whitelist = {
"resource://gre/modules/ExtensionUtils.jsm",
"resource://gre/modules/MessageChannel.jsm",
]),
frameScripts: new Set([
// Test related
"resource://specialpowers/MozillaLogger.js",
"resource://specialpowers/specialpowersFrameScript.js",
"chrome://mochikit/content/shutdown-leaks-collector.js",
"chrome://mochikit/content/tests/SimpleTest/AsyncUtilsContent.js",
"chrome://mochikit/content/tests/BrowserTestUtils/content-utils.js",
// Browser front-end
"chrome://global/content/browser-content.js",
// Forms
"chrome://formautofill/content/FormAutofillFrameScript.js",
// Extensions
"resource://gre/modules/addons/Content.js",
]),
processScripts: new Set([
"chrome://global/content/process-content.js",
"resource:///modules/ContentObservers.js",
@ -89,6 +106,7 @@ const intermittently_loaded_whitelist = {
modules: new Set([
"resource://gre/modules/sessionstore/Utils.jsm",
]),
frameScripts: new Set([]),
processScripts: new Set([]),
};
@ -140,6 +158,12 @@ add_task(async function() {
let loadedInfo = await promise;
// Gather loaded frame scripts.
loadedInfo.frameScripts = {};
for (let [uri] of Services.mm.getDelayedFrameScripts()) {
loadedInfo.frameScripts[uri] = "";
}
// Gather loaded process scripts.
loadedInfo.processScripts = {};
for (let [uri] of Services.ppmm.getDelayedProcessScripts()) {