1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- describe("Module Worker", function() {
- const blob = new Blob([""], { type: "text/javascript" });
- const url = URL.createObjectURL(blob);
- let supportsModuleWorker = false;
- const options = {
- get type() {
- supportsModuleWorker = true;
- }
- };
- new Worker(url, options).terminate();
- URL.revokeObjectURL(url);
- beforeEach(function() {
- if (!supportsModuleWorker) {
- return this.skip();
- }
- this.ifr = document.createElement("iframe");
- document.body.append(this.ifr);
- });
- afterEach(function() {
- this.ifr.remove();
- });
- it("work", function(done) {
- window.addEventListener("message", function l(ev) {
- if (ev.data === "a") {
- window.removeEventListener("message", l);
- done();
- }
- });
- this.ifr.src = "/base/tests/fixtures/module-worker/build/runner.html";
- });
- });
|