Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 47923023: Automate WebRTC-in-Chrome test cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: corrected string Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c2acbdcd44d48ff42e88c8f56048f2b189e59615..87a3c0b13ea30c67275cbe95d8e7047f8cf166f6 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 gTestWithoutMsidAndBundle = false;
+ var gTestNonCrypto = false;
phoglund_chromium 2013/11/04 09:34:56 You don't need these. See more below.
+ var gTestUnsupportedVideoCodec = false;
var gLocalStream = null;
var gSentTones = '';
@@ -98,6 +100,22 @@
waitForVideo('remote-view-2');
}
+// Test that we can't setup a call with an unsupported video codec
phoglund_chromium 2013/11/04 09:34:56 Nit: indentation
elham 2013/11/07 23:48:00 Done.
+ function negotiateUnsupportedVideoCodec() {
+ createConnections(null);
+ gTestUnsupportedVideoCodec = true;
+ navigator.webkitGetUserMedia({audio:true, video:true},
+ addStreamToBothConnectionsAndNegotiate, printGetUserMediaError);
phoglund_chromium 2013/11/04 09:34:56 It's weird to pass in addStreamToBothConnectionsAn
elham 2013/11/07 23:48:00 No GetUserMedia had nothing to do with offer.sdp a
phoglund_chromium 2013/11/08 09:17:29 You are right: my bad.
+ }
+
+ // Test that we can't setup a call if one peer does not support encryption
+ function negotiateNonCryptoCall() {
+ createConnections(null);
+ gTestNonCrypto = true;
+ navigator.webkitGetUserMedia({audio: true, video: true},
+ addStreamToBothConnectionsAndNegotiate, printGetUserMediaError);
+ }
+
// Test only a data channel.
function callWithDataOnly() {
createConnections({optional:[{RtpDataChannels: true}]});
@@ -387,6 +405,28 @@
document.title = 'getUserMedia request failed with code ' + error.code;
}
+ // Called if setLocaDescription fails.
phoglund_chromium 2013/11/04 09:34:56 Nit: setLocalDescription.
elham 2013/11/07 23:48:00 I still need this, since I wanted to check if we g
+ function printLocalDescriptionError(error) {
phoglund_chromium 2013/11/04 09:34:56 It's misleading to call this function printLocalDe
phoglund_chromium 2013/11/08 09:17:29 Oh, you are right again. You are passing this call
+ 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;
+ }
+ }
+
+ // Called if setLocalDescription success
phoglund_chromium 2013/11/04 09:34:56 This doesn't seem to be used.
elham 2013/11/07 23:48:00 It will be used every time setLocalDescription suc
phoglund_chromium 2013/11/08 09:17:29 Yes, except you pass in the error handler function
+ function printLocalDescriptionSuccess(error) {
+ document.title = 'setLocalDescription Success'
+ }
+
+
// Called if getUserMedia succeeds and we want to send from both connections.
function addStreamToBothConnectionsAndNegotiate(localStream) {
displayAndRemember(localStream);
@@ -467,7 +507,16 @@
caller.createOffer(
function (offer) {
- caller.setLocalDescription(offer);
+ if (gTestNonCrypto) {
phoglund_chromium 2013/11/04 09:34:56 Good news and bad news: bemasc@ just refactored th
elham 2013/11/07 23:48:00 Done.
+ offer.sdp = offer.sdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n');
+ offer.sdp = offer.sdp.replace(/a=fingerprint.*\r\n/g, '');
+ }
+ if (gTestUnsupportedVideoCodec) {
+ offer.sdp = offer.sdp.replace('a=rtpmap:100 VP8/90000\r\n',
+ 'a=rtpmap:100 XVP8/90000\r\n');
+ }
+ caller.setLocalDescription(offer, printLocalDescriptionSuccess,
+ printLocalDescriptionError);
expectEquals('have-local-offer', caller.signalingState);
receiveOffer(offer.sdp, caller, callee);
});
@@ -506,6 +555,7 @@
if (gTestWithoutMsidAndBundle) {
answerSdp = removeMsidAndBundle(answerSdp);
}
+
var parsedAnswer = new RTCSessionDescription({ type: 'answer',
sdp: answerSdp });
caller.setRemoteDescription(parsedAnswer);
« content/browser/media/webrtc_browsertest.cc ('K') | « content/browser/media/webrtc_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698