Bug 1446676: Part 3 - Remove non-bootstrapped worker test add-on. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Fri, 16 Mar 2018 22:31:05 -0700
changeset 769184 788710ae8f01a24843db73e4c9b5d6d19e7cfc1d
parent 769183 f6a86f4ef76a23306d58123018dad41bdcd39f88
child 769606 e04291fc1ffa5886a29d093859e0d1b7a44d9d7c
push id103061
push usermaglione.k@gmail.com
push dateSun, 18 Mar 2018 22:05:48 +0000
reviewersaswan
bugs1446676
milestone61.0a1
Bug 1446676: Part 3 - Remove non-bootstrapped worker test add-on. r?aswan Non-restartless extensions are no longer supported in the wild, and none of the remaining automation extension rely on Workers in their components. MozReview-Commit-ID: bh3nwwfM1g
dom/workers/moz.build
dom/workers/test/chrome.ini
dom/workers/test/extensions/moz.build
dom/workers/test/extensions/traditional/WorkerTest.js
dom/workers/test/extensions/traditional/WorkerTest.manifest
dom/workers/test/extensions/traditional/install.rdf
dom/workers/test/extensions/traditional/jar.mn
dom/workers/test/extensions/traditional/moz.build
dom/workers/test/extensions/traditional/nsIWorkerTest.idl
dom/workers/test/extensions/traditional/worker-test@mozilla.org.xpi
dom/workers/test/extensions/traditional/worker.js
dom/workers/test/test_extension.xul
testing/mochitest/runrobocop.py
toolkit/mozapps/extensions/test/browser/browser_legacy.js
toolkit/mozapps/extensions/test/browser/browser_legacy_themes.js
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -77,17 +77,16 @@ LOCAL_INCLUDES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 TEST_DIRS += [
     'test/extensions/bootstrap',
-    'test/extensions/traditional',
 ]
 
 MOCHITEST_MANIFESTS += [
     'test/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'test/chrome.ini',
--- a/dom/workers/test/chrome.ini
+++ b/dom/workers/test/chrome.ini
@@ -64,17 +64,16 @@ skip-if = (os == 'linux') # Bug 1244697
 [test_WorkerDebuggerManager.xul]
 skip-if = (os == 'linux') # Bug 1244409
 [test_WorkerDebugger_console.xul]
 [test_WorkerDebugger_frozen.xul]
 [test_WorkerDebugger_promise.xul]
 [test_WorkerDebugger_suspended.xul]
 [test_chromeWorker.xul]
 [test_chromeWorkerJSM.xul]
-[test_extension.xul]
 [test_extensionBootstrap.xul]
 [test_file.xul]
 [test_fileBlobPosting.xul]
 [test_fileBlobSubWorker.xul]
 [test_filePosting.xul]
 [test_fileReadSlice.xul]
 [test_fileReaderSync.xul]
 [test_fileReaderSyncErrors.xul]
--- a/dom/workers/test/extensions/moz.build
+++ b/dom/workers/test/extensions/moz.build
@@ -1,7 +1,7 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DIRS += ['bootstrap', 'traditional']
+DIRS += ['bootstrap']
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/WorkerTest.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var gWorkerAndCallback = {
-  _worker: null,
-  _callback: null,
-
-  _ensureStarted: function() {
-    if (!this._worker) {
-      throw new Error("Not yet started!");
-    }
-  },
-
-  start: function() {
-    if (!this._worker) {
-      var worker = new Worker("chrome://worker/content/worker.js");
-      worker.onerror = function(event) {
-        Cu.reportError(event.message);
-        event.preventDefault();
-      };
-
-      this._worker = worker;
-    }
-  },
-
-  stop: function() {
-    if (this._worker) {
-      try {
-        this.terminate();
-      }
-      catch(e) {
-        Cu.reportError(e);
-      }
-      this._worker = null;
-    }
-  },
-
-  set callback(val) {
-    this._ensureStarted();
-    if (val) {
-      var callback = val.QueryInterface(Ci.nsIWorkerTestCallback);
-      if (this.callback != callback) {
-        this._worker.onmessage = function(event) {
-          callback.onmessage(event.data);
-        };
-        this._worker.onerror = function(event) {
-          callback.onerror(event.message);
-          event.preventDefault();
-        };
-        this._callback = callback;
-      }
-    }
-    else {
-      this._worker.onmessage = null;
-      this._worker.onerror = null;
-      this._callback = null;
-    }
-  },
-
-  get callback() {
-    return this._callback;
-  },
-
-  postMessage: function(data) {
-    this._ensureStarted();
-    this._worker.postMessage(data);
-  },
-
-  terminate: function() {
-    this._ensureStarted();
-    this._worker.terminate();
-    this.callback = null;
-  }
-};
-
-function WorkerTest() {
-}
-WorkerTest.prototype = {
-  observe: function(subject, topic, data) {
-    switch(topic) {
-      case "profile-after-change":
-        gWorkerAndCallback.start();
-        Services.obs.addObserver(this, "profile-before-change");
-        break;
-      case "profile-before-change":
-        gWorkerAndCallback.stop();
-        break;
-      default:
-        Cu.reportError("Unknown topic: " + topic);
-    }
-  },
-
-  set callback(val) {
-    gWorkerAndCallback.callback = val;
-  },
-
-  get callback() {
-    return gWorkerAndCallback.callback;
-  },
-
-  postMessage: function(message) {
-    gWorkerAndCallback.postMessage(message);
-  },
-
-  terminate: function() {
-    gWorkerAndCallback.terminate();
-  },
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsIWorkerTest]),
-  classID: Components.ID("{3b52b935-551f-4606-ba4c-decc18b67bfd}")
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WorkerTest]);
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/WorkerTest.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {3b52b935-551f-4606-ba4c-decc18b67bfd} WorkerTest.js
-contract @mozilla.org/test/workertest;1 {3b52b935-551f-4606-ba4c-decc18b67bfd}
-category profile-after-change WorkerTest @mozilla.org/test/workertest;1
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/install.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:name>WorkerTest</em:name>
-    <em:description>Worker functions for use in testing.</em:description>
-    <em:creator>Mozilla</em:creator>
-    <em:version>2016.03.09</em:version>
-    <em:id>worker-test@mozilla.org</em:id>
-    <em:type>2</em:type>
-    <em:targetApplication>
-      <Description>
-        <!-- Firefox -->
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>45.0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <Description>
-        <!-- Fennec -->
-        <em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id>
-        <em:minVersion>45.0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/jar.mn
+++ /dev/null
@@ -1,3 +0,0 @@
-worker.jar:
-% content worker %content/
-  content/worker.js (worker.js)
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_SOURCES += [
-    'nsIWorkerTest.idl',
-]
-
-XPIDL_MODULE = 'WorkerTest'
-
-EXTRA_COMPONENTS += [
-    'WorkerTest.js',
-    'WorkerTest.manifest',
-]
-
-XPI_NAME = 'worker'
-
-JAR_MANIFESTS += ['jar.mn']
-USE_EXTENSION_MANIFEST = True
-NO_JS_MANIFEST = True
-
-FINAL_TARGET_FILES += [
-    'install.rdf',
-]
-
-TEST_HARNESS_FILES.testing.mochitest.extensions += [
-    'worker-test@mozilla.org.xpi',
-]
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/nsIWorkerTest.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-[scriptable, uuid(10f8ebdf-1373-4640-9c34-53dee99f526f)]
-interface nsIWorkerTestCallback : nsISupports
-{
-  void onmessage(in DOMString data);
-  void onerror(in DOMString data);
-};
-
-[scriptable, uuid(887a0614-a0f0-4c0e-80e0-cf31e6d4e286)]
-interface nsIWorkerTest : nsISupports
-{
-  void postMessage(in DOMString data);
-  void terminate();
-
-  attribute nsIWorkerTestCallback callback;
-};
deleted file mode 100644
index 8d2386894c720d74ce83a474c353a5b4d417f948..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/workers/test/extensions/traditional/worker.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-onmessage = function(event) {
-  postMessage(event.data);
-}
deleted file mode 100644
--- a/dom/workers/test/test_extension.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="DOM Worker Threads Test"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="test();">
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-  <script type="application/javascript" src="dom_worker_helper.js"/>
-
-  <script type="application/javascript">
-  <![CDATA[
-
-    function test() {
-      const message = "woohoo";
-
-      var workertest =
-        Cc["@mozilla.org/test/workertest;1"].createInstance(Ci.nsIWorkerTest);
-
-      workertest.callback = {
-        onmessage: function(data) {
-          is(data, message, "Correct message");
-          workertest.callback = null;
-          workertest = null;
-          SimpleTest.finish();
-        },
-        onerror: function(data) {
-          ok(false, "Worker had an error: " + data.message);
-          workertest.callback = null;
-          workertest = null;
-          SimpleTest.finish();
-        },
-        QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerTestCallback])
-      };
-
-      workertest.postMessage(message);
-
-      SimpleTest.waitForExplicitFinish();
-    }
-
-  ]]>
-  </script>
-
-  <body xmlns="http://www.w3.org/1999/xhtml">
-    <p id="display"></p>
-    <div id="content" style="display:none;"></div>
-    <pre id="test"></pre>
-  </body>
-  <label id="test-result"/>
-</window>
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -221,17 +221,16 @@ class RobocopTestRunner(MochitestDesktop
         self.options.extraPrefs.append('browser.snippets.enabled=false')
         self.options.extraPrefs.append('extensions.autoupdate.enabled=false')
 
         # Override the telemetry init delay for integration testing.
         self.options.extraPrefs.append('toolkit.telemetry.initDelay=1')
 
         self.options.extensionsToExclude.extend([
             'mochikit@mozilla.org',
-            'worker-test@mozilla.org.xpi',
             'workerbootstrap-test@mozilla.org.xpi',
             'indexedDB-test@mozilla.org.xpi',
         ])
 
         manifest = MochitestDesktop.buildProfile(self, self.options)
         self.localProfile = self.options.profilePath
         self.log.debug("Profile created at %s" % self.localProfile)
         # some files are not needed for robocop; save time by not pushing
--- a/toolkit/mozapps/extensions/test/browser/browser_legacy.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_legacy.js
@@ -4,17 +4,16 @@ add_task(async function() {
 
   // The mochitest framework installs a bunch of legacy extensions.
   // Fortunately, the extensions.legacy.exceptions preference exists to
   // avoid treating some extensions as legacy for the purposes of the UI.
   const IGNORE = [
     "special-powers@mozilla.org",
     "mochikit@mozilla.org",
     "workerbootstrap-test@mozilla.org",
-    "worker-test@mozilla.org",
     "mozscreenshots@mozilla.org",
     "indexedDB-test@mozilla.org",
   ];
 
   let exceptions = Services.prefs.getCharPref("extensions.legacy.exceptions");
   exceptions = [ exceptions, ...IGNORE ].join(",");
 
   await SpecialPowers.pushPrefEnv({
--- a/toolkit/mozapps/extensions/test/browser/browser_legacy_themes.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_legacy_themes.js
@@ -2,17 +2,16 @@
 add_task(async function() {
   // The mochitest framework installs a bunch of legacy extensions.
   // Fortunately, the extensions.legacy.exceptions preference exists to
   // avoid treating some extensions as legacy for the purposes of the UI.
   const IGNORE = [
     "special-powers@mozilla.org",
     "mochikit@mozilla.org",
     "workerbootstrap-test@mozilla.org",
-    "worker-test@mozilla.org",
   ];
 
   let exceptions = Services.prefs.getCharPref("extensions.legacy.exceptions");
   exceptions = [ exceptions, ...IGNORE ].join(",");
 
   await SpecialPowers.pushPrefEnv({
     set: [
       ["extensions.legacy.enabled", false],