Chromium Code Reviews| Index: content/test/data/media/peerconnection-call.html |
| diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html |
| index 535498f45d409b115b8c39774cd2d173bfd7d2a0..4a943450a522d1be66d447beaff640386d458885 100644 |
| --- a/content/test/data/media/peerconnection-call.html |
| +++ b/content/test/data/media/peerconnection-call.html |
| @@ -9,6 +9,8 @@ |
| var gFirstConnection = null; |
| var gSecondConnection = null; |
| var gTestWithoutMsid = false; |
| + var gTestNonCrypto = false; |
|
phoglund_chromium
2013/11/08 09:29:26
I still think you can get rid of these. See more b
elham
2013/11/08 23:30:40
Done.
|
| + var gTestUnsupportedVideoCodec = false; |
| var gLocalStream = null; |
| var gSentTones = ''; |
| @@ -119,6 +121,24 @@ |
| waitForVideo('remote-view-2'); |
| } |
| + // Test that we can't setup a call with an unsupported video codec |
| + function negotiateUnsupportedVideoCodec() { |
| + createConnections(null); |
| + gTestUnsupportedVideoCodec = true; |
| + transformSdp = removeVideoCodec; |
|
phoglund_chromium
2013/11/08 09:29:26
Here you'll have something like
onLocalDescriptio
elham
2013/11/08 23:30:40
Done.
|
| + navigator.webkitGetUserMedia({audio: true, video: true}, |
| + addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
|
phoglund_chromium
2013/11/08 09:29:26
Nit: should be indented four spaces (this is wrong
elham
2013/11/08 23:30:40
Done.
|
| + } |
| + |
| + // Test that we can't setup a call if one peer does not support encryption |
| + function negotiateNonCryptoCall() { |
| + createConnections(null); |
| + gTestNonCrypto = true; |
| + transformSdp = removeCrypto; |
| + navigator.webkitGetUserMedia({audio: true, video: true}, |
| + addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
| + } |
| + |
| // Test that we can setup call with legacy settings. |
| function callWithLegacySdp() { |
| transformSdp = function(sdp) { |
| @@ -420,9 +440,28 @@ |
| } |
| // Called if getUserMedia fails. |
| - function printGetUserMediaError(error) { |
| + function printGetUserMediaError(error) { |
| document.title = 'getUserMedia request failed with code ' + error.code; |
| } |
| + |
| + function printLocalDescriptionError(error) { |
| + if ((gTestUnsupportedVideoCodec == true) && |
| + (error=='SetLocalDescription failed: Failed to update session state:' |
| + +'ERROR_CONTENT', error)) { |
| + document.title = 'OK'; |
| + gTestUnsupportedVideoCodec = false; |
| + } |
| + if ((gTestNonCrypto == true) && |
| + (error=='SetLocalDescription failed: Called with a SDP without crypto' |
| + +'enabled', error)) { |
| + document.title = 'OK'; |
| + gTestNonCrypto = false; |
| + } |
| + } |
| + |
| + function printLocalDescriptionSuccess() { |
| + document.title = 'setLocalDescription Success' |
| + } |
| // Called if getUserMedia succeeds and we want to send from both connections. |
| function addStreamToBothConnectionsAndNegotiate(localStream) { |
| @@ -510,7 +549,8 @@ |
| function onOfferCreated(offer, caller, callee) { |
| offer.sdp = transformSdp(offer.sdp); |
| - caller.setLocalDescription(offer); |
| + caller.setLocalDescription(offer, printLocalDescriptionError, |
|
phoglund_chromium
2013/11/08 09:29:26
Pass in an empty function which does nothing as th
elham
2013/11/08 23:30:40
Done.
|
| + printLocalDescriptionError); |
| expectEquals('have-local-offer', caller.signalingState); |
| receiveOffer(offer.sdp, caller, callee); |
| } |
| @@ -535,6 +575,18 @@ |
| return offerSdp; |
| } |
| + function removeVideoCodec(offerSdp) { |
| + offerSdp= offerSdp.replace('a=rtpmap:100 VP8/90000\r\n', |
| + 'a=rtpmap:100 XVP8/90000\r\n'); |
| + return offerSdp; |
| + } |
| + |
| + function removeCrypto(offerSdp) { |
| + offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); |
| + offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); |
| + return offerSdp; |
| + } |
| + |
| function removeBundle(sdp) { |
| return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
| } |