Bug 1520012 - Test which delayedLoad frame scripts are loaded during content process startup. r=MattN
authorFelipe Gomes <felipc@gmail.com>
Mon, 14 Jan 2019 22:31:59 +0000
changeset 510947 e4177ef055d37264b366b86312dbd5e612895321
parent 510946 547d738dabfa0fc3064399a6ea1c0c950af59971
child 510948 a01a559aa6117261c0fa9bbc1d9bd1555ef9a4d0
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1520012
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 1520012 - Test which delayedLoad frame scripts are loaded during content process startup. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D16502
browser/base/content/test/performance/browser.ini
browser/base/content/test/performance/browser_startup_content.js
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -5,16 +5,19 @@
 # set during early startup to have an impact as a canvas will be used by
 # startupRecorder.js
 prefs =
   # Skip migration work in BG__migrateUI for browser_startup.js since it isn't
   # representative of common startup.
   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]
 skip-if = asan || debug || (os == 'win' && bits == 32) # Bug 1382809, bug 1369959, Win32 because of intermittent OOM failures
 [browser_preferences_usage.js]
 skip-if = !debug
 [browser_startup.js]
 [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, 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.
  *
  * 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,16 +63,33 @@ 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",
   ]),
+  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",
     "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    }",
@@ -84,16 +101,17 @@ const whitelist = {
 // which are all required.
 const intermittently_loaded_whitelist = {
   components: new Set([
     "nsAsyncShutdown.js",
   ]),
   modules: new Set([
     "resource://gre/modules/sessionstore/Utils.jsm",
   ]),
+  frameScripts: new Set([]),
   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",
@@ -135,16 +153,22 @@ add_task(async function() {
         }
       } catch (e) {}
     }
     sendAsyncMessage("Test:LoadedScripts", {components, modules, services});
   } + ")()", false);
 
   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()) {
     loadedInfo.processScripts[uri] = "";
   }
 
   let loadedList = {};