Bug 1519574 - Test which delayedLoad process scripts are loaded during content process startup. r=Felipe
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Sat, 12 Jan 2019 21:48:26 +0000
changeset 453650 d924b4e44ff4
parent 453649 f033eb7f5cee
child 453651 173e847312e0
push id35364
push userdvarga@mozilla.com
push dateSun, 13 Jan 2019 10:04:23 +0000
treeherdermozilla-central@173e847312e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1519574
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519574 - Test which delayedLoad process scripts are loaded during content process startup. r=Felipe Differential Revision: https://phabricator.services.mozilla.com/D16367
browser/base/content/test/performance/browser_startup_content.js
--- a/browser/base/content/test/performance/browser_startup_content.js
+++ b/browser/base/content/test/performance/browser_startup_content.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* This test records which services, JS components and JS modules are loaded
- * when creating a new content process.
+/* This test records which services, JS components, 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.
  *
  * If your code isn't strictly required to show a page, consider loading it
  * lazily. If you can't, consider delaying its load until after we have started
  * handling user events.
  */
@@ -63,28 +63,38 @@ const whitelist = {
     "resource://gre/modules/TelemetryController.jsm", // bug 1470339
     "resource://gre/modules/TelemetryUtils.jsm", // bug 1470339
 
     // Extensions
     "resource://gre/modules/ExtensionProcessScript.jsm",
     "resource://gre/modules/ExtensionUtils.jsm",
     "resource://gre/modules/MessageChannel.jsm",
   ]),
+  processScripts: new Set([
+    "chrome://global/content/process-content.js",
+    "resource:///modules/ContentObservers.js",
+    "data:,ChromeUtils.import('resource://gre/modules/ExtensionProcessScript.jsm')",
+    "chrome://satchel/content/formSubmitListener.js",
+    "resource://devtools/client/jsonview/converter-observer.js",
+    "resource://gre/modules/WebRequestContent.js",
+    "data:,new function() {\n      ChromeUtils.import(\"resource://formautofill/FormAutofillContent.jsm\");\n    }",
+  ]),
 };
 
 // Items on this list are allowed to be loaded but not
 // required, as opposed to items in the main whitelist,
 // which are all required.
 const intermittently_loaded_whitelist = {
   components: new Set([
     "nsAsyncShutdown.js",
   ]),
   modules: new Set([
     "resource://gre/modules/sessionstore/Utils.jsm",
   ]),
+  processScripts: new Set([]),
 };
 
 const blacklist = {
   services: new Set([
     "@mozilla.org/base/telemetry-startup;1",
     "@mozilla.org/embedcomp/default-tooltiptextprovider;1",
     "@mozilla.org/push/Service;1",
   ]),
@@ -124,16 +134,23 @@ add_task(async function() {
           services[contractID] = "";
         }
       } catch (e) {}
     }
     sendAsyncMessage("Test:LoadedScripts", {components, modules, services});
   } + ")()", false);
 
   let loadedInfo = await promise;
+
+  // Gather loaded process scripts.
+  loadedInfo.processScripts = {};
+  for (let [uri] of Services.ppmm.getDelayedProcessScripts()) {
+    loadedInfo.processScripts[uri] = "";
+  }
+
   let loadedList = {};
 
   for (let scriptType in whitelist) {
     loadedList[scriptType] = Object.keys(loadedInfo[scriptType]).filter(c => {
       if (!whitelist[scriptType].has(c))
         return true;
       whitelist[scriptType].delete(c);
       return false;