node/test/fixtures/wpt/FileAPI/url/resources/revoke-helper.js
Michaël Zasso 7be72850d3
test: add wpt tests for Blob
PR-URL: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-18 13:55:27 -08:00

9 lines
408 B
JavaScript

self.addEventListener('message', e => {
URL.revokeObjectURL(e.data.url);
// Registering a new object URL will make absolutely sure that the revocation
// has propagated. Without this at least in chrome it is possible for the
// below postMessage to arrive at its destination before the revocation has
// been fully processed.
URL.createObjectURL(new Blob([]));
self.postMessage('revoked');
});