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

Side by Side Diff: chrome/test/data/webrtc/jsep01_call.js

Issue 10958074: Added workaround to the current API revision chaos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 // Public interface towards the other javascript files, such as 7 // Public interface towards the other javascript files, such as
8 // message_handling.js. The contract for these functions is described in 8 // message_handling.js. The contract for these functions is described in
9 // message_handling.js. 9 // message_handling.js.
10 10
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 addTestFailure("unknown message received"); 31 addTestFailure("unknown message received");
32 return; 32 return;
33 } 33 }
34 34
35 function createPeerConnection(stun_server) { 35 function createPeerConnection(stun_server) {
36 servers = {iceServers:[{url:"stun:" + stun_server}]}; 36 servers = {iceServers:[{url:"stun:" + stun_server}]};
37 try { 37 try {
38 peerConnection = new webkitRTCPeerConnection(servers, null); 38 peerConnection = new webkitRTCPeerConnection(servers, null);
39 } catch (exception) { 39 } catch (exception) {
40 failTest('Failed to create peer connection: ' + exception); 40 // TODO(phoglund): Remove once the URI-requiring revisions are gone.
41 debug('Failed to create connection: maybe we need to fall ' +
42 'back to the old API?');
43 servers = {iceServers:[{uri:"stun:" + stun_server}]};
44 try {
45 peerConnection = new webkitRTCPeerConnection(servers, null);
46 debug('Yeah, we could use the old API.');
47 } catch (exception) {
48 failTest('Failed to create peer connection: ' + exception);
49 }
41 } 50 }
42 peerConnection.onaddstream = addStreamCallback_; 51 peerConnection.onaddstream = addStreamCallback_;
43 peerConnection.onremovestream = removeStreamCallback_; 52 peerConnection.onremovestream = removeStreamCallback_;
44 peerConnection.onicecandidate = iceCallback_; 53 peerConnection.onicecandidate = iceCallback_;
45 return peerConnection; 54 return peerConnection;
46 } 55 }
47 56
48 function setupCall(peerConnection) { 57 function setupCall(peerConnection) {
49 peerConnection.createOffer( 58 peerConnection.createOffer(
50 setLocalAndSendMessage_, 59 setLocalAndSendMessage_,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // This only mean that we have received a valid SDP message with an offer or 101 // This only mean that we have received a valid SDP message with an offer or
93 // an answer, it does not mean that audio and video works. 102 // an answer, it does not mean that audio and video works.
94 returnToTest('ok-got-remote-stream'); 103 returnToTest('ok-got-remote-stream');
95 } 104 }
96 105
97 /** @private */ 106 /** @private */
98 function removeStreamCallback_(event) { 107 function removeStreamCallback_(event) {
99 debug('Call ended.'); 108 debug('Call ended.');
100 document.getElementById("remote-view").src = ''; 109 document.getElementById("remote-view").src = '';
101 } 110 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698