Bug 1251372 - Sign extensions in dom/workers/test/extensions for mochitest, r=khuey

For details on extensions in automation and signing, see:
https://wiki.mozilla.org/EngineeringProductivity/HowTo/SignExtensions

MozReview-Commit-ID: JL8A02zZFTH

--HG--
extra : rebase_source : 8faff1b058f48bdc7cb047d282c8c70892ab88a8
extra : amend_source : 814ab85495075824cb6fd9c43358cad3c2a798e0
extra : intermediate-source : 4fa5b5a25f04f976fdc54c03683382062a55ae37
extra : source : c664e3daa54d79fec8b9b7ea2c4bf12e2c47c7ec
This commit is contained in:
Andrew Halberstadt 2016-02-26 10:46:43 -05:00
parent 280b1b39cd
commit 035506cb0e
12 changed files with 51 additions and 63 deletions

View File

@ -1,12 +0,0 @@
# 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/.
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
include $(topsrcdir)/config/rules.mk
libs::
@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)

View File

@ -26,17 +26,7 @@ var gWorkerAndCallback = {
start: function(data) {
if (!this._worker) {
var file = data.installPath;
var fileuri = file.isDirectory() ?
Services.io.newFileURI(file) :
Services.io.newURI('jar:' + file.path + '!/', null, null);
var resourceName = encodeURIComponent(data.id);
Services.io.getProtocolHandler("resource").
QueryInterface(Ci.nsIResProtocolHandler).
setSubstitution(resourceName, fileuri);
this._worker = new Worker("resource://" + resourceName + "/worker.js");
this._worker = new Worker("chrome://workerbootstrap/content/worker.js");
this._worker.onerror = function(event) {
Cu.reportError(event.message);
event.preventDefault();

View File

@ -7,15 +7,24 @@
<em:name>WorkerTestBootstrap</em:name>
<em:description>Worker functions for use in testing.</em:description>
<em:creator>Mozilla</em:creator>
<em:version>2011.10.10</em:version>
#expand <em:id>__XPI_NAME__-test@mozilla.org</em:id>
<em:version>2016.03.09</em:version>
<em:id>workerbootstrap-test@mozilla.org</em:id>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
#expand <em:minVersion>__MOZILLA_VERSION_U__</em:minVersion>
#expand <em:maxVersion>__MOZILLA_VERSION_U__</em:maxVersion>
<!-- 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>

View File

@ -0,0 +1,3 @@
workerbootstrap.jar:
% content workerbootstrap %content/
content/worker.js (worker.js)

View File

@ -6,11 +6,15 @@
XPI_NAME = 'workerbootstrap'
FINAL_TARGET_PP_FILES += [
'install.rdf',
]
JAR_MANIFESTS += ['jar.mn']
USE_EXTENSION_MANIFEST = True
NO_JS_MANIFEST = True
FINAL_TARGET_FILES += [
'bootstrap.js',
'worker.js',
'install.rdf',
]
TEST_HARNESS_FILES.testing.mochitest.extensions += [
'workerbootstrap-test@mozilla.org.xpi',
]

View File

@ -1,12 +0,0 @@
# 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/.
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
include $(topsrcdir)/config/rules.mk
libs::
@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)

View File

@ -22,17 +22,7 @@ var gWorkerAndCallback = {
start: function() {
if (!this._worker) {
var file = __LOCATION__.parent.parent;
var fileuri = file.isDirectory() ?
Services.io.newFileURI(file) :
Services.io.newURI('jar:' + file.path + '!/', null, null);
var resourceName = "worker-test";
Services.io.getProtocolHandler("resource").
QueryInterface(Ci.nsIResProtocolHandler).
setSubstitution(resourceName, fileuri);
var worker = new Worker("resource://" + resourceName + "/worker.js");
var worker = new Worker("chrome://worker/content/worker.js");
worker.onerror = function(event) {
Cu.reportError(event.message);
event.preventDefault();

View File

@ -7,14 +7,23 @@
<em:name>WorkerTest</em:name>
<em:description>Worker functions for use in testing.</em:description>
<em:creator>Mozilla</em:creator>
<em:version>2011.10.10</em:version>
#expand <em:id>__XPI_NAME__-test@mozilla.org</em:id>
<em:version>2016.03.09</em:version>
<em:id>worker-test@mozilla.org</em:id>
<em:type>2</em:type>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
#expand <em:minVersion>__MOZILLA_VERSION_U__</em:minVersion>
#expand <em:maxVersion>__MOZILLA_VERSION_U__</em:maxVersion>
<!-- 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>

View File

@ -0,0 +1,3 @@
worker.jar:
% content worker %content/
content/worker.js (worker.js)

View File

@ -17,10 +17,14 @@ EXTRA_COMPONENTS += [
XPI_NAME = 'worker'
FINAL_TARGET_PP_FILES += [
JAR_MANIFESTS += ['jar.mn']
USE_EXTENSION_MANIFEST = True
NO_JS_MANIFEST = True
FINAL_TARGET_FILES += [
'install.rdf',
]
FINAL_TARGET_FILES += [
'worker.js',
TEST_HARNESS_FILES.testing.mochitest.extensions += [
'worker-test@mozilla.org.xpi',
]