diff --git a/dom/media/tests/mochitest/head.js b/dom/media/tests/mochitest/head.js index d910620fff46..742ccbd72479 100644 --- a/dom/media/tests/mochitest/head.js +++ b/dom/media/tests/mochitest/head.js @@ -6,7 +6,6 @@ var Cc = SpecialPowers.Cc; var Ci = SpecialPowers.Ci; -var Cr = SpecialPowers.Cr; // Specifies whether we are using fake streams to run this automation var FAKE_ENABLED = true; @@ -34,7 +33,7 @@ try { * @param {boolean} [meta.visible=false] * Visibility of the media elements */ -function createHTML(meta) { +function realCreateHTML(meta) { var test = document.getElementById('test'); // Create the head content @@ -48,13 +47,13 @@ function createHTML(meta) { // Create the body content var anchor = document.createElement('a'); - anchor.setAttribute('target', '_blank'); - + anchor.textContent = meta.title; if (meta.bug) { anchor.setAttribute('href', 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + meta.bug); + } else { + anchor.setAttribute('target', '_blank'); } - anchor.textContent = meta.title; document.body.insertBefore(anchor, test); var display = document.createElement('p'); @@ -83,14 +82,16 @@ function createMediaElement(type, label) { var element = document.getElementById(id); // Sanity check that we haven't created the element already - if (element) + if (element) { return element; + } element = document.createElement(type === 'audio' ? 'audio' : 'video'); element.setAttribute('id', id); element.setAttribute('height', 100); element.setAttribute('width', 150); element.setAttribute('controls', 'controls'); + element.setAttribute('autoplay', 'autoplay'); document.getElementById('content').appendChild(element); return element; @@ -122,7 +123,7 @@ function getUserMedia(constraints) { * @param {Function} aCallback * Test method to execute after initialization */ -function runTest(aCallback) { +function realRunTest(aCallback) { if (window.SimpleTest) { // Running as a Mochitest. SimpleTest.waitForExplicitFinish(); @@ -169,10 +170,10 @@ function runTest(aCallback) { * tracks being checked */ function checkMediaStreamTracksByType(constraints, type, mediaStreamTracks) { - if(constraints[type]) { + if (constraints[type]) { is(mediaStreamTracks.length, 1, 'One ' + type + ' track shall be present'); - if(mediaStreamTracks.length) { + if (mediaStreamTracks.length) { is(mediaStreamTracks[0].kind, type, 'Track kind should be ' + type); ok(mediaStreamTracks[0].id, 'Track id should be defined'); } @@ -512,7 +513,7 @@ function IsMacOSX10_6orOlder() { if (navigator.platform.indexOf("Mac") == 0) { var version = Cc["@mozilla.org/system-info;1"] - .getService(SpecialPowers.Ci.nsIPropertyBag2) + .getService(Ci.nsIPropertyBag2) .getProperty("version"); // the next line is correct: Mac OS 10.6 corresponds to Darwin version 10.x ! // Mac OS 10.7 is Darwin version 11.x. the |version| string we've got here @@ -521,3 +522,11 @@ function IsMacOSX10_6orOlder() { } return is106orOlder; } + +(function(){ + var el = document.createElement("link"); + el.rel = "stylesheet"; + el.type = "text/css"; + el.href= "/tests/SimpleTest/test.css"; + document.head.appendChild(el); +}()); diff --git a/dom/media/tests/mochitest/identity/identityevent.js b/dom/media/tests/mochitest/identity/identityevent.js index 4221c7635043..e7b41b178045 100644 --- a/dom/media/tests/mochitest/identity/identityevent.js +++ b/dom/media/tests/mochitest/identity/identityevent.js @@ -1,7 +1,7 @@ (function(g) { 'use strict'; - g.trapIdentityEvents = function(target) { + g.trapIdentityEvents = target => { var state = {}; var identityEvents = ['idpassertionerror', 'idpvalidationerror', 'identityresult', 'peeridentity']; diff --git a/dom/media/tests/mochitest/identity/test_getIdentityAssertion.html b/dom/media/tests/mochitest/identity/test_getIdentityAssertion.html index 98464403b949..234d34433644 100644 --- a/dom/media/tests/mochitest/identity/test_getIdentityAssertion.html +++ b/dom/media/tests/mochitest/identity/test_getIdentityAssertion.html @@ -1,17 +1,15 @@
- - - + -- + - - -- + -diff --git a/dom/media/tests/mochitest/identity/test_setIdentityProviderWithErrors.html b/dom/media/tests/mochitest/identity/test_setIdentityProviderWithErrors.html index f9e7e7334cb4..fc81818628cb 100644 --- a/dom/media/tests/mochitest/identity/test_setIdentityProviderWithErrors.html +++ b/dom/media/tests/mochitest/identity/test_setIdentityProviderWithErrors.html @@ -1,23 +1,20 @@ - - - + -- - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html index f79e5f285a36..c012c9e3b6ac 100644 --- a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html +++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html index f3b83501f504..14e38e222cbf 100644 --- a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html +++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoNoBundle.html b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoNoBundle.html index ac43190aa7d7..7081df0f650d 100644 --- a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoNoBundle.html +++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoNoBundle.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html b/dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html index d94205b0b236..83aa6edc1baa 100644 --- a/dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html +++ b/dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_basicVideo.html b/dom/media/tests/mochitest/test_dataChannel_basicVideo.html index f7d97acbc7b7..becee67764c2 100644 --- a/dom/media/tests/mochitest/test_dataChannel_basicVideo.html +++ b/dom/media/tests/mochitest/test_dataChannel_basicVideo.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_bug1013809.html b/dom/media/tests/mochitest/test_dataChannel_bug1013809.html index 616f70a16e47..b74f9decaa64 100644 --- a/dom/media/tests/mochitest/test_dataChannel_bug1013809.html +++ b/dom/media/tests/mochitest/test_dataChannel_bug1013809.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_dataChannel_noOffer.html b/dom/media/tests/mochitest/test_dataChannel_noOffer.html index cd5043b690c2..982fb852594e 100644 --- a/dom/media/tests/mochitest/test_dataChannel_noOffer.html +++ b/dom/media/tests/mochitest/test_dataChannel_noOffer.html @@ -1,9 +1,6 @@ - - - diff --git a/dom/media/tests/mochitest/test_getUserMedia_basicAudio.html b/dom/media/tests/mochitest/test_getUserMedia_basicAudio.html index 0652fcceb659..c946ca08722c 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_basicAudio.html +++ b/dom/media/tests/mochitest/test_getUserMedia_basicAudio.html @@ -1,30 +1,18 @@ - - -getUserMedia Basic Audio Test - - - -getUserMedia Basic Audio Test - -- -getUserMedia Basic Screenshare Test - -- -getUserMedia Basic Video Test - -- -getUserMedia Basic Video & Audio Test - -- - -getUserMedia Basic Windowshare Test - -- -navigator.mozGetUserMedia Callback Test - -- - + + -Test mozGetUserMedia Constraints (desktop) - -- - + + -Test mozGetUserMedia Constraints (mobile) - -- -getUserMedia gum within gum - -- + -Test mozGetUserMedia peerIdentity Constraint - -- -getUserMedia Play Audio Twice - -- -getUserMedia Play Video and Audio Twice - -- -getUserMedia Play Video Twice - -- -getUserMedia Stop Audio Stream - -- -getUserMedia Stop Audio Stream With Followup Audio - -- -getUserMedia Stop Video Audio Stream - -- -getUserMedia Stop Video+Audio Stream With Followup Video+Audio - -- -getUserMedia Stop Video Audio Stream - -- - + -getUserMedia Stop Video Stream With Followup Video - -- - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_addSecondAudioStream.html b/dom/media/tests/mochitest/test_peerConnection_addSecondAudioStream.html index 9b8a7295b5fc..ad9200b607d0 100644 --- a/dom/media/tests/mochitest/test_peerConnection_addSecondAudioStream.html +++ b/dom/media/tests/mochitest/test_peerConnection_addSecondAudioStream.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudio.html b/dom/media/tests/mochitest/test_peerConnection_basicAudio.html index acfe7c0a6645..a9f4f125f59b 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudio.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudio.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html index 6caef1f69564..0af2b207af4d 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html index 37471c634ebf..ae51e4a1c0cb 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined_long.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined_long.html index f3bb28207358..3ac02f41cacc 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined_long.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined_long.html @@ -6,14 +6,8 @@ - - - - - -@@ -25,7 +19,7 @@ }); var test; - runTest(function (options) { + runNetworkTest(function (options) { options = options || {}; options.commands = commandsPeerConnection.slice(0); options.commands.push(generateIntervalCommand(verifyConnectionStatus, @@ -41,4 +35,3 @@- diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoNoBundle.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoNoBundle.html index fe5f031f3be7..ee5dccabb503 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoNoBundle.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoNoBundle.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,11 +11,8 @@ title: "Basic audio/video peer connection with no Bundle" }); - SimpleTest.requestFlakyTimeout("WebRTC is full of inherent timeouts"); - - var test; - runNetworkTest(function (options) { - test = new PeerConnectionTest(options); + runNetworkTest(options => { + var test = new PeerConnectionTest(options); test.chain.insertAfter( 'PC_LOCAL_CREATE_OFFER', [ diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudio_long.html b/dom/media/tests/mochitest/test_peerConnection_basicAudio_long.html index 8919b4d43071..cd371b3fcdfd 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudio_long.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudio_long.html @@ -6,14 +6,8 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html b/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html index 68f8ed12ea85..520a812c2b31 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicScreenshare.html b/dom/media/tests/mochitest/test_peerConnection_basicScreenshare.html index 0e1c93fc8d7b..08db1b161308 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicScreenshare.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicScreenshare.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicVideo.html b/dom/media/tests/mochitest/test_peerConnection_basicVideo.html index 9b36db061ea0..ce071a516f9c 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicVideo.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicVideo.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicVideo_long.html b/dom/media/tests/mochitest/test_peerConnection_basicVideo_long.html index bc15e9185e18..7c038f194e04 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicVideo_long.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicVideo_long.html @@ -6,14 +6,8 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_basicWindowshare.html b/dom/media/tests/mochitest/test_peerConnection_basicWindowshare.html index ae8369c06b7c..387ea9aec3df 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicWindowshare.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicWindowshare.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_bug1013809.html b/dom/media/tests/mochitest/test_peerConnection_bug1013809.html index 3877f9b95f18..69d36ee39901 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug1013809.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug1013809.html @@ -1,12 +1,7 @@ - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_bug1042791.html b/dom/media/tests/mochitest/test_peerConnection_bug1042791.html index 5086647e2220..5cfd22f48396 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug1042791.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug1042791.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_bug822674.html b/dom/media/tests/mochitest/test_peerConnection_bug822674.html index 3a555638f505..453566437db3 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug822674.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug822674.html @@ -1,9 +1,6 @@ - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_bug825703.html b/dom/media/tests/mochitest/test_peerConnection_bug825703.html index 9b5e729a9a85..b1aca12dea84 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug825703.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug825703.html @@ -1,9 +1,6 @@ - - - @@ -14,69 +11,69 @@ title: "RTCConfiguration valid/invalid permutations" }); - makePC = (config, expected_error) => { - var exception; - try { - new mozRTCPeerConnection(config).close(); - } catch (e) { - exception = e; - } - is((exception? exception.name : "success"), expected_error || "success", - "mozRTCPeerConnection(" + JSON.stringify(config) + ")"); +var makePC = (config, expected_error) => { + var exception; + try { + new mozRTCPeerConnection(config).close(); + } catch (e) { + exception = e; + } + is((exception? exception.name : "success"), expected_error || "success", + "mozRTCPeerConnection(" + JSON.stringify(config) + ")"); +}; + +// This is a test of the iceServers parsing code + readable errors +runNetworkTest(() => { + var exception = null; + + try { + new mozRTCPeerConnection().close(); + } catch (e) { + exception = e; + } + ok(!exception, "mozRTCPeerConnection() succeeds"); + exception = null; + + makePC(); + + makePC(1, "TypeError"); + + makePC({}); + + makePC({ iceServers: [] }); + + makePC({ iceServers: [{ urls:"" }] }, "SyntaxError"); + + makePC({ iceServers: [ + { urls:"stun:127.0.0.1" }, + { urls:"stun:localhost", foo:"" }, + { urls: ["stun:127.0.0.1", "stun:localhost"] }, + { urls:"stuns:localhost", foo:"" }, + { urls:"turn:[::1]:3478", username:"p", credential:"p" }, + { urls:"turn:localhost:3478?transport=udp", username:"p", credential:"p" }, + { urls: ["turn:[::1]:3478", "turn:localhost"], username:"p", credential:"p" }, + { urls:"turns:localhost:3478?transport=udp", username:"p", credential:"p" }, + { url:"stun:localhost", foo:"" }, + { url:"turn:localhost", username:"p", credential:"p" } + ]}); + + makePC({ iceServers: [{ urls: ["stun:127.0.0.1", ""] }] }, "SyntaxError"); + + makePC({ iceServers: [{ urls:"turns:localhost:3478", username:"p" }] }, "InvalidAccessError"); + + makePC({ iceServers: [{ url:"turns:localhost:3478", credential:"p" }] }, "InvalidAccessError"); + + makePC({ iceServers: [{ urls:"http:0.0.0.0" }] }, "SyntaxError"); + + try { + new mozRTCPeerConnection({ iceServers: [{ url:"http:0.0.0.0" }] }).close(); + } catch (e) { + ok(e.message.indexOf("http") > 0, + "mozRTCPeerConnection() constructor has readable exceptions"); } - // This is a test of the iceServers parsing code + readable errors - - runNetworkTest(function () { - var exception = null; - - try { - new mozRTCPeerConnection().close(); - } catch (e) { - exception = e; - } - ok(!exception, "mozRTCPeerConnection() succeeds"); - exception = null; - - makePC(); - - makePC(1, "TypeError"); - - makePC({}); - - makePC({ iceServers: [] }); - - makePC({ iceServers: [{ urls:"" }] }, "SyntaxError"); - - makePC({ iceServers: [ - { urls:"stun:127.0.0.1" }, - { urls:"stun:localhost", foo:"" }, - { urls: ["stun:127.0.0.1", "stun:localhost"] }, - { urls:"stuns:localhost", foo:"" }, - { urls:"turn:[::1]:3478", username:"p", credential:"p" }, - { urls:"turn:localhost:3478?transport=udp", username:"p", credential:"p" }, - { urls: ["turn:[::1]:3478", "turn:localhost"], username:"p", credential:"p" }, - { urls:"turns:localhost:3478?transport=udp", username:"p", credential:"p" }, - { url:"stun:localhost", foo:"" }, - { url:"turn:localhost", username:"p", credential:"p" } - ]}); - - makePC({ iceServers: [{ urls: ["stun:127.0.0.1", ""] }] }, "SyntaxError"); - - makePC({ iceServers: [{ urls:"turns:localhost:3478", username:"p" }] }, "InvalidAccessError"); - - makePC({ iceServers: [{ url:"turns:localhost:3478", credential:"p" }] }, "InvalidAccessError"); - - makePC({ iceServers: [{ urls:"http:0.0.0.0" }] }, "SyntaxError"); - try { - new mozRTCPeerConnection({ iceServers: [{ url:"http:0.0.0.0" }] }).close(); - } catch (e) { - ok(e.message.indexOf("http") > 0, - "mozRTCPeerConnection() constructor has readable exceptions"); - } - - networkTestFinished(); - }); + networkTestFinished(); +});diff --git a/dom/media/tests/mochitest/test_peerConnection_bug827843.html b/dom/media/tests/mochitest/test_peerConnection_bug827843.html index 8bcd757a1f91..01d566981f00 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug827843.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug827843.html @@ -1,12 +1,7 @@ - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_bug834153.html b/dom/media/tests/mochitest/test_peerConnection_bug834153.html index 204de74342df..66503c800baa 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug834153.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug834153.html @@ -1,9 +1,6 @@ - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_callbacks.html b/dom/media/tests/mochitest/test_peerConnection_callbacks.html index 2e74df479147..9c67c9525f49 100644 --- a/dom/media/tests/mochitest/test_peerConnection_callbacks.html +++ b/dom/media/tests/mochitest/test_peerConnection_callbacks.html @@ -1,26 +1,19 @@ - - - - -
- - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_close.html b/dom/media/tests/mochitest/test_peerConnection_close.html index d5118c4f81d4..ef882659c65b 100644 --- a/dom/media/tests/mochitest/test_peerConnection_close.html +++ b/dom/media/tests/mochitest/test_peerConnection_close.html @@ -1,9 +1,6 @@ - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html b/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html index 9b62ddbc4734..8c638c25ef4b 100644 --- a/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html +++ b/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html @@ -1,9 +1,6 @@ - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html index def81f23b8e4..88db25f39f1d 100644 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html +++ b/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html @@ -1,14 +1,8 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html index 0114b46696d7..ac88277a2668 100644 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html +++ b/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html @@ -1,14 +1,8 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html index 10fc60d47d6e..9f8668eb6a89 100644 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html +++ b/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html @@ -1,14 +1,8 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html index 9e53abbe81d5..dffe43db878f 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html @@ -1,12 +1,7 @@ - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html index 7d2c2c98ea15..e70e75656567 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html @@ -1,12 +1,7 @@ - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html index 25c0ec428a09..ec8007971676 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html @@ -1,12 +1,7 @@ - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html b/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html index 6430c5b49d6c..963538bf0dd6 100644 --- a/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html +++ b/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html @@ -1,14 +1,9 @@ - - - - -
- - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html index f3c2af34edcc..ab5ff099e6ef 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html +++ b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setLocalDescription (answer) in 'have-local-offer'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION"); diff --git a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html index f0bb4a2b1978..35e0654d18c1 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html +++ b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setLocalDescription (answer) in 'stable'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_LOCAL_CREATE_OFFER"); diff --git a/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html b/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html index 00e245f11336..5ac1502902d3 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html +++ b/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setLocalDescription (offer) in 'have-remote-offer'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION"); diff --git a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html index 02135596b4a2..da1b2451e8fb 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html +++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setRemoteDescription (answer) in 'have-remote-offer'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION"); diff --git a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html index a5937967bae6..6c9546bf0602 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html +++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setRemoteDescription (answer) in 'stable'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_LOCAL_CREATE_OFFER"); diff --git a/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html b/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html index e9ada0f9f474..d651a14f1bd8 100644 --- a/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html +++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html @@ -1,13 +1,7 @@ - - - - - -@@ -17,9 +11,8 @@ title: "setRemoteDescription (offer) in 'have-local-offer'" }); -var test; runNetworkTest(function () { - test = new PeerConnectionTest(); + var test = new PeerConnectionTest(); test.setMediaConstraints([{audio: true}], [{audio: true}]); test.chain.removeAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION"); diff --git a/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html b/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html index d91be41a1eaf..f03065241dc9 100644 --- a/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html +++ b/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html b/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html index fb424fb5ae61..75a10e7ccc8c 100644 --- a/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html +++ b/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html @@ -1,10 +1,6 @@ - - - - @@ -15,9 +11,23 @@ title: "Throw in PeerConnection callbacks" }); +runNetworkTest(function () { + function finish() { + window.onerror = oldOnError; + is(error_count, 7, "Seven expected errors verified."); + networkTestFinished(); + } + + function getFail() { + return err => { + window.onerror = oldOnError; + generateErrorCallback()(err); + }; + } + let error_count = 0; let oldOnError = window.onerror; - window.onerror = function (errorMsg, url, lineNumber) { + window.onerror = (errorMsg, url, lineNumber) => { if (errorMsg.indexOf("Expected") == -1) { getFail()(errorMsg); } @@ -31,27 +41,21 @@ } let pc0, pc1, pc2; + // Test failure callbacks (limited to 1 for now) + pc0 = new mozRTCPeerConnection(); + pc0.createOffer(getFail(), function(err) { + pc1 = new mozRTCPeerConnection(); + pc2 = new mozRTCPeerConnection(); - runNetworkTest(function () { - error_count = 0; - - // Test failure callbacks (limited to 1 for now) - pc0 = new mozRTCPeerConnection(); - pc0.createOffer(getFail(), function(err) { - pc1 = new mozRTCPeerConnection(); - pc2 = new mozRTCPeerConnection(); - - // Test success callbacks (happy path) - navigator.mozGetUserMedia({video:true, fake: true}, function(video1) { - pc1.addStream(video1); - pc1.createOffer(function(offer) { - pc1.setLocalDescription(offer, function() { - pc2.setRemoteDescription(offer, function() { - pc2.createAnswer(function(answer) { - pc2.setLocalDescription(answer, function() { - pc1.setRemoteDescription(answer, function() { - throw new Error("Expected"); - }, getFail()); + // Test success callbacks (happy path) + navigator.mozGetUserMedia({video:true, fake: true}, function(video1) { + pc1.addStream(video1); + pc1.createOffer(function(offer) { + pc1.setLocalDescription(offer, function() { + pc2.setRemoteDescription(offer, function() { + pc2.createAnswer(function(answer) { + pc2.setLocalDescription(answer, function() { + pc1.setRemoteDescription(answer, function() { throw new Error("Expected"); }, getFail()); throw new Error("Expected"); @@ -62,23 +66,13 @@ }, getFail()); throw new Error("Expected"); }, getFail()); + throw new Error("Expected"); }, getFail()); - throw new Error("Expected"); - }); + }, getFail()); + throw new Error("Expected"); }); +}); - function finish() { - window.onerror = oldOnError; - is(error_count, 7, "Seven expected errors verified."); - networkTestFinished(); - } - - function getFail() { - return function (err) { - window.onerror = oldOnError; - generateErrorCallback()(err); - }; - }diff --git a/dom/media/tests/mochitest/test_peerConnection_toJSON.html b/dom/media/tests/mochitest/test_peerConnection_toJSON.html index ce53d09d166e..6753c10f61c6 100644 --- a/dom/media/tests/mochitest/test_peerConnection_toJSON.html +++ b/dom/media/tests/mochitest/test_peerConnection_toJSON.html @@ -1,14 +1,6 @@ - - -Test for Bug 872377 and Bug 928304 - - - diff --git a/dom/media/tests/mochitest/test_peerConnection_twoAudioStreams.html b/dom/media/tests/mochitest/test_peerConnection_twoAudioStreams.html index e22ffc90d159..a88623163662 100644 --- a/dom/media/tests/mochitest/test_peerConnection_twoAudioStreams.html +++ b/dom/media/tests/mochitest/test_peerConnection_twoAudioStreams.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreams.html b/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreams.html index 396e489dfa04..6264e7cc868b 100644 --- a/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreams.html +++ b/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreams.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreamsCombined.html b/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreamsCombined.html index 2377faf591ad..61e0313b4f59 100644 --- a/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreamsCombined.html +++ b/dom/media/tests/mochitest/test_peerConnection_twoAudioVideoStreamsCombined.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_peerConnection_twoVideoStreams.html b/dom/media/tests/mochitest/test_peerConnection_twoVideoStreams.html index e87952d1a481..102c2f11ce5e 100644 --- a/dom/media/tests/mochitest/test_peerConnection_twoVideoStreams.html +++ b/dom/media/tests/mochitest/test_peerConnection_twoVideoStreams.html @@ -1,13 +1,7 @@ - - - - - -diff --git a/dom/media/tests/mochitest/test_zmedia_cleanup.html b/dom/media/tests/mochitest/test_zmedia_cleanup.html index 89d75e3f951a..2d29bcb75c1a 100644 --- a/dom/media/tests/mochitest/test_zmedia_cleanup.html +++ b/dom/media/tests/mochitest/test_zmedia_cleanup.html @@ -1,24 +1,22 @@ - - - + +