diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index 35e1a1f1d9ce..bb9addcfb501 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -53,6 +53,7 @@ skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g) [test_peerConnection_bug834153.html] [test_peerConnection_bug835370.html] +[test_peerConnection_close.html] [test_peerConnection_errorCallbacks.html] [test_peerConnection_offerRequiresReceiveAudio.html] skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g) diff --git a/dom/media/tests/mochitest/pc.js b/dom/media/tests/mochitest/pc.js index 605524765b62..1788913f640d 100644 --- a/dom/media/tests/mochitest/pc.js +++ b/dom/media/tests/mochitest/pc.js @@ -568,7 +568,7 @@ function PCT_setLocalDescription(peer, desc, onSuccess) { } peer.onsignalingstatechange = function () { - info(peer + ": 'onsignalingstatechange' event registered for async check"); + info(peer + ": 'onsignalingstatechange' event registered, signalingState: " + peer.signalingState); eventFired = true; check_next_test(); @@ -629,7 +629,7 @@ function PCT_setRemoteDescription(peer, desc, onSuccess) { } peer.onsignalingstatechange = function () { - info(peer + ": 'onsignalingstatechange' event registered for async check"); + info(peer + ": 'onsignalingstatechange' event registered, signalingState: " + peer.signalingState); eventFired = true; check_next_test(); diff --git a/dom/media/tests/mochitest/test_peerConnection_bug825703.html b/dom/media/tests/mochitest/test_peerConnection_bug825703.html index 2cba0b5570a5..b6236e8fe9d7 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug825703.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug825703.html @@ -15,12 +15,17 @@ makePC = function (config, expect_success) { var exception = null; + var pc = null; try { - var pc = new mozRTCPeerConnection(config); + pc = new mozRTCPeerConnection(config); } catch (e) { exception = e; } + if (pc !== null) { + pc.close(); + } + pc = null if (expect_success) { ok(!exception, "mozRTCPeerConnection(" + @@ -34,12 +39,19 @@ // This is a test of the iceServers parsing code + readable errors runTest(function () { - var pc, pcs; + var pcs = null; var exception = null; var config; - try { pcs = new mozRTCPeerConnection(); } catch (e) { exception = e; } + try { + pcs = new mozRTCPeerConnection(); + } catch (e) { + exception = e; + } ok(!exception, "mozRTCPeerConnection() succeeds"); + if (pcs !== null) { + pcs.close(); + } pcs = null; exception = null; @@ -69,6 +81,9 @@ ok(e.message.indexOf("http") > 0, "mozRTCPeerConnection() constructor has readable exceptions"); } + if (pcs !== null) { + pcs.close(); + } pcs = null; SimpleTest.finish(); diff --git a/dom/media/tests/mochitest/test_peerConnection_bug834153.html b/dom/media/tests/mochitest/test_peerConnection_bug834153.html index 3f9717fa5fe9..052998c4e1f1 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug834153.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug834153.html @@ -15,6 +15,8 @@ function croak(msg) { ok(0, msg); + pc1.close(); + pc2.close(); SimpleTest.finish(); } @@ -30,6 +32,8 @@ pc2.setRemoteDescription(d, function (x) {}, function (x) {}); pc2.createAnswer(function (d) { is(d.type,"answer","CreateAnswer created an answer"); + pc1.close(); + pc2.close(); SimpleTest.finish(); }, function (err) { croak("createAnswer failed: " + err); diff --git a/dom/media/tests/mochitest/test_peerConnection_close.html b/dom/media/tests/mochitest/test_peerConnection_close.html new file mode 100644 index 000000000000..141240249c81 --- /dev/null +++ b/dom/media/tests/mochitest/test_peerConnection_close.html @@ -0,0 +1,80 @@ + + +
+ + + + + ++ ++ +