From 15dd6c71e1fe3b8961bc914601f86e2f5cc2fb13 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 17 Nov 2015 23:38:39 +0000 Subject: [PATCH] Bug 1221852 - SharedWorker.port should be always not null, r=smaug --- dom/workers/SharedWorker.cpp | 1 - dom/workers/test/sharedWorker_ports.js | 1 + dom/workers/test/test_sharedWorker_ports.html | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/workers/SharedWorker.cpp b/dom/workers/SharedWorker.cpp index 568844ac3fd..f50c2687fe6 100644 --- a/dom/workers/SharedWorker.cpp +++ b/dom/workers/SharedWorker.cpp @@ -136,7 +136,6 @@ SharedWorker::Close() if (mMessagePort) { mMessagePort->Close(); - mMessagePort = nullptr; } } diff --git a/dom/workers/test/sharedWorker_ports.js b/dom/workers/test/sharedWorker_ports.js index a0d29e29a2d..64672e6abb2 100644 --- a/dom/workers/test/sharedWorker_ports.js +++ b/dom/workers/test/sharedWorker_ports.js @@ -17,6 +17,7 @@ onconnect = function(evt) { test: (evtFromPort2.data.type == "connected"), msg: "The original message received" }); port.postMessage({type: "finish"}); + close(); } } } diff --git a/dom/workers/test/test_sharedWorker_ports.html b/dom/workers/test/test_sharedWorker_ports.html index 8233b3f71f3..32698ab5277 100644 --- a/dom/workers/test/test_sharedWorker_ports.html +++ b/dom/workers/test/test_sharedWorker_ports.html @@ -28,6 +28,9 @@ sw1.port.onmessage = function(event) { } if (event.data.type == "finish") { + info("Finished!"); + ok(sw1.port, "The port still exists"); + sw1.port.foo = sw1; // Just a test to see if we leak. SimpleTest.finish(); } }