Bug 1732918 - Revert PR 29848 - Close a worker test environment in the completion callback, a=testonly

This causes sharedworker tests to be unstable (frequent intermittent
timeouts) in gecko.
This commit is contained in:
moz-wptsync-bot 2021-09-28 13:49:10 +00:00
Родитель e5c79f8bd1
Коммит b57c5d7e6e
1 изменённых файлов: 0 добавлений и 30 удалений

Просмотреть файл

@ -312,13 +312,6 @@
status: harness_status.structured_clone(),
asserts: asserts.map(assert => assert.structured_clone()),
});
// Close the worker after completion.
// TODO: Worker tests don't have an implicit timeout, so in
// cases where an async/promise test never resolves, the
// completion callback won't be called and the worker won't
// be closed.
this_obj.close_worker();
});
};
@ -330,9 +323,6 @@
return null;
};
// Closes the worker, if applicable.
WorkerTestEnvironment.prototype.close_worker = function() {};
/*
* Dedicated web workers.
* https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope
@ -356,10 +346,6 @@
tests.wait_for_finish = true;
};
DedicatedWorkerTestEnvironment.prototype.close_worker = function() {
self.close();
};
/*
* Shared web workers.
* https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope
@ -370,19 +356,11 @@
function SharedWorkerTestEnvironment() {
WorkerTestEnvironment.call(this);
var this_obj = this;
this.connected = false;
this.close_on_connect = false;
// Shared workers receive message ports via the 'onconnect' event for
// each connection.
self.addEventListener("connect",
function(message_event) {
this_obj.connected = true;
this_obj._add_message_port(message_event.source);
if (this_obj.close_on_connect) {
self.close();
}
}, false);
}
SharedWorkerTestEnvironment.prototype = Object.create(WorkerTestEnvironment.prototype);
@ -394,14 +372,6 @@
tests.wait_for_finish = true;
};
SharedWorkerTestEnvironment.prototype.close_worker = function() {
if (this.connected) {
self.close();
} else {
this.close_on_connect = true;
}
};
/*
* Service workers.
* http://www.w3.org/TR/service-workers/