Bug 1558298: Part 12 - Remove nested OOP support from SpecialPowers and mochitest.
☠☠ backed out by f9bf5e4b0b4f ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 12 Jun 2019 10:52:47 -0700
changeset 543723 d2ee912c518913c33e4c63b5a5eddf6e10b0c9f4
parent 543722 7a0aab00327b089c82476bea30ea17373e0a1103
child 543724 61fa2745733f3631488a3ecccc144823683b7b6d
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1558298
milestone69.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 1558298: Part 12 - Remove nested OOP support from SpecialPowers and mochitest. Differential Revision: https://phabricator.services.mozilla.com/D34752
testing/mochitest/mochitest_options.py
testing/mochitest/moz.build
testing/mochitest/nested_setup.js
testing/mochitest/runtests.py
testing/mochitest/server.js
testing/specialpowers/content/SpecialPowers.jsm
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -416,21 +416,16 @@ class MochitestArguments(ArgumentContain
         [["--jscov-dir-prefix"],
          {"action": "store",
           "help": "Directory to store per-test line coverage data as json "
                   "(browser-chrome only). To emit lcov formatted data, set "
                   "JS_CODE_COVERAGE_OUTPUT_DIR in the environment.",
           "default": None,
           "suppress": True,
           }],
-        [["--nested_oop"],
-         {"action": "store_true",
-          "default": False,
-          "help": "Run tests with nested_oop preferences and test filtering enabled.",
-          }],
         [["--dmd"],
          {"action": "store_true",
           "default": False,
           "help": "Run tests with DMD active.",
           }],
         [["--dump-output-directory"],
          {"default": None,
           "dest": "dumpOutputDirectory",
@@ -622,19 +617,16 @@ class MochitestArguments(ArgumentContain
         # set to the SSL proxy setting. See:
         # see https://bugzilla.mozilla.org/show_bug.cgi?id=916517
         # args.webSocketPort = DEFAULT_PORTS['ws']
     }
 
     def validate(self, parser, options, context):
         """Validate generic options."""
 
-        # for test manifest parsing.
-        mozinfo.update({"nested_oop": options.nested_oop})
-
         # and android doesn't use 'app' the same way, so skip validation
         if parser.app != 'android':
             if options.app is None:
                 if build_obj:
                     options.app = build_obj.get_binary_path()
                 else:
                     parser.error(
                         "could not find the application path, --appname must be specified")
@@ -822,19 +814,16 @@ class MochitestArguments(ArgumentContain
                     'Missing gst-launch-{0.1,1.0}, required for '
                     '--use-test-media-devices')
 
             if not pactl:
                 parser.error(
                     'Missing binary pactl required for '
                     '--use-test-media-devices')
 
-        if options.nested_oop:
-            options.e10s = True
-
         # The a11y and chrome flavors can't run with e10s.
         if options.flavor in ('a11y', 'chrome') and options.e10s:
             parser.error("mochitest-{} does not support e10s, try again with "
                          "--disable-e10s.".format(options.flavor))
 
         options.leakThresholds = {
             "default": options.defaultLeakThreshold,
             "tab": options.defaultLeakThreshold,
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -24,17 +24,16 @@ FINAL_TARGET_FILES += [
 FINAL_TARGET_FILES.content += [
     'browser-harness.xul',
     'browser-test.js',
     'chrome-harness.js',
     'chunkifyTests.js',
     'harness.xul',
     'manifestLibrary.js',
     'mochitest-e10s-utils.js',
-    'nested_setup.js',
     'redirect.html',
     'server.js',
     'shutdown-leaks-collector.js',
     'ShutdownLeaksCollector.jsm',
 ]
 
 FINAL_TARGET_FILES.content.dynamic += [
     'dynamic/getMyDirectory.sjs',
@@ -101,17 +100,16 @@ TEST_HARNESS_FILES.testing.mochitest += 
     'chunkifyTests.js',
     'favicon.ico',
     'harness.xul',
     'leaks.py',
     'mach_test_package_commands.py',
     'manifest.webapp',
     'manifestLibrary.js',
     'mochitest_options.py',
-    'nested_setup.js',
     'pywebsocket_wrapper.py',
     'redirect.html',
     'runjunit.py',
     'runrobocop.py',
     'runtests.py',
     'runtestsremote.py',
     'server.js',
     'start_desktop.js',
deleted file mode 100644
--- a/testing/mochitest/nested_setup.js
+++ /dev/null
@@ -1,30 +0,0 @@
-
-/* global SpecialPowers */
-
-var gTestURL = "";
-
-function addPermissions() {
-  SpecialPowers.pushPermissions(
-    [{ type: "browser", allow: true, context: document }],
-    addPreferences);
-}
-
-function addPreferences() {
-  SpecialPowers.pushPrefEnv(
-    {"set": [["dom.mozBrowserFramesEnabled", true]]},
-    insertFrame);
-}
-
-function insertFrame() {
-  SpecialPowers.nestedFrameSetup();
-
-  var iframe = document.createElement("iframe");
-  iframe.id = "nested-parent-frame";
-  iframe.width = "100%";
-  iframe.height = "100%";
-  iframe.scoring = "no";
-  iframe.setAttribute("remote", "true");
-  iframe.setAttribute("mozbrowser", "true");
-  iframe.src = gTestURL;
-  document.getElementById("holder-div").appendChild(iframe);
-}
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -846,17 +846,16 @@ def update_mozinfo():
 class MochitestDesktop(object):
     """
     Mochitest class for desktop firefox.
     """
     oldcwd = os.getcwd()
 
     # Path to the test script on the server
     TEST_PATH = "tests"
-    NESTED_OOP_TEST_PATH = "nested_oop"
     CHROME_PATH = "redirect.html"
 
     certdbNew = False
     sslTunnel = None
     DEFAULT_TIMEOUT = 60.0
     mediaDevices = None
 
     patternFiles = {}
@@ -1097,18 +1096,16 @@ class MochitestDesktop(object):
                 testURL = "/".join([testURL, os.path.dirname(options.test_paths[0])])
             else:
                 testURL = "/".join([testURL, options.test_paths[0]])
 
         if options.flavor in ('a11y', 'chrome'):
             testURL = "/".join([testHost, self.CHROME_PATH])
         elif options.flavor == 'browser':
             testURL = "about:blank"
-        if options.nested_oop:
-            testURL = "/".join([testHost, self.NESTED_OOP_TEST_PATH])
         return testURL
 
     def getTestsByScheme(self, options, testsToFilter=None, disabled=True):
         """ Build the url path to the specific test harness and test file or directory
             Build a manifest of tests to run and write out a json file for the harness to read
             testsToFilter option is used to filter/keep the tests provided in the list
 
             disabled -- This allows to add all disabled tests on the build side
@@ -1918,17 +1915,16 @@ toolbar#nav-bar {
         # 3) Prefs from --setpref
 
         # Prefs from base profiles
         self.merge_base_profiles(options)
 
         # Hardcoded prefs (TODO move these into a base profile)
         prefs = {
             "browser.tabs.remote.autostart": options.e10s,
-            "dom.ipc.tabs.nested.enabled": options.nested_oop,
             # Enable tracing output for detailed failures in case of
             # failing connection attempts, and hangs (bug 1397201)
             "marionette.log.level": "Trace",
         }
 
         if options.flavor == 'browser' and options.timeout:
             prefs["testing.browserTestHarness.timeout"] = options.timeout
 
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -220,17 +220,16 @@ function runServer() {
 
 /** Creates and returns an HTTP server configured to serve Mochitests. */
 function createMochitestServer(serverBasePath) {
   var server = new nsHttpServer();
 
   server.registerDirectory("/", serverBasePath);
   server.registerPathHandler("/server/shutdown", serverShutdown);
   server.registerPathHandler("/server/debug", serverDebug);
-  server.registerPathHandler("/nested_oop", nestedTest);
   server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
   server.registerContentType("jar", "application/x-jar");
   server.registerContentType("ogg", "application/ogg");
   server.registerContentType("pdf", "application/pdf");
   server.registerContentType("ogv", "video/ogg");
   server.registerContentType("oga", "audio/ogg");
   server.registerContentType("opus", "audio/ogg; codecs=opus");
   server.registerContentType("dat", "text/plain; charset=utf-8");
@@ -598,40 +597,16 @@ function convertManifestToTestLinks(root
                                                                manifestStream.available()));
   var paths = manifestObj.tests;
   var pathPrefix = "/" + root + "/";
   return [paths.reduce(function(t, p) { t[pathPrefix + p.path] = true; return t; }, {}),
           paths.length];
 }
 
 /**
- * Produce a test harness page that has one remote iframe
- */
-function nestedTest(metadata, response) {
-  response.setStatusLine("1.1", 200, "OK");
-  response.setHeader("Content-type", "text/html;charset=utf-8", false);
-  response.write(
-    HTML(
-      HEAD(
-        TITLE("Mochitest | ", metadata.path),
-        LINK({rel: "stylesheet",
-              type: "text/css", href: "/static/harness.css"}),
-        SCRIPT({type: "text/javascript",
-                src: "/nested_setup.js"}),
-        SCRIPT({type: "text/javascript"},
-               "window.onload = addPermissions; gTestURL = '/tests?" + metadata.queryString + "';")
-        ),
-      BODY(
-        DIV({class: "container"},
-          DIV({class: "frameholder", id: "holder-div"})
-        )
-        )));
-}
-
-/**
  * Produce a test harness page containing all the test cases
  * below it, recursively.
  */
 function testListing(metadata, response) {
   var links = {};
   var count = 0;
   if (!metadata.queryString.includes("manifestFile")) {
     [links, count] = list(metadata.path,
--- a/testing/specialpowers/content/SpecialPowers.jsm
+++ b/testing/specialpowers/content/SpecialPowers.jsm
@@ -207,53 +207,16 @@ class SpecialPowers extends SpecialPower
     this.mm.sendAsyncMessage("SpecialPowers.RemoveFiles", {});
   }
 
   executeAfterFlushingMessageQueue(aCallback) {
     this._pongHandlers.push(aCallback);
     this.mm.sendAsyncMessage("SPPingService", { op: "ping" });
   }
 
-  nestedFrameSetup() {
-    let self = this;
-    Services.obs.addObserver(function onRemoteBrowserShown(subject, topic, data) {
-      let frameLoader = subject;
-      // get a ref to the app <iframe>
-      let frame = frameLoader.ownerElement;
-      let frameId = frame.getAttribute("id");
-      if (frameId === "nested-parent-frame") {
-        Services.obs.removeObserver(onRemoteBrowserShown, "remote-browser-shown");
-
-        let mm = frame.frameLoader.messageManager;
-        self._grandChildFrameMM = mm;
-
-        self.SP_SYNC_MESSAGES.forEach(function(msgname) {
-          mm.addMessageListener(msgname, function(msg) {
-            return self._sendSyncMessage(msgname, msg.data)[0];
-          });
-        });
-        self.SP_ASYNC_MESSAGES.forEach(function(msgname) {
-          mm.addMessageListener(msgname, function(msg) {
-            self._sendAsyncMessage(msgname, msg.data);
-          });
-        });
-        mm.addMessageListener("SPPAddNestedMessageListener", function(msg) {
-          self._addMessageListener(msg.json.name, function(aMsg) {
-            mm.sendAsyncMessage(aMsg.name, aMsg.data);
-            });
-        });
-
-        mm.loadFrameScript("resource://specialpowers/specialpowersFrameScript.js", false);
-
-        let frameScript = "SpecialPowers.prototype.IsInNestedFrame=true;";
-        mm.loadFrameScript("data:," + frameScript, false);
-      }
-    }, "remote-browser-shown");
-  }
-
   registeredServiceWorkers() {
     // For the time being, if parent_intercept is false, we can assume that
     // ServiceWorkers registered by the current test are all known to the SWM in
     // this process.
     if (!Services.prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false)) {
       let swm = Cc["@mozilla.org/serviceworkers/manager;1"]
                   .getService(Ci.nsIServiceWorkerManager);
       let regs = swm.getAllRegistrations();