Changeset 164602 in webkit
- Timestamp:
- Feb 24, 2014 1:00:36 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164600 r164602 1 2014-02-24 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 3 [WebRTC] Validating RTCConfiguration according to the spec 4 https://bugs.webkit.org/show_bug.cgi?id=129182 5 6 Reviewed by Eric Carlson. 7 8 Spec states that: 9 - iceServers should not be an empty list 10 - the entry in the configuration dictionary is "urls", instead of "url" 11 - urls can be either a list or a string 12 Fixing all that in RTCConfiguration validation when creating a RTCPeerConnection 13 14 * fast/mediastream/RTCPeerConnection-AddRemoveStream.html: 15 * fast/mediastream/RTCPeerConnection-createAnswer.html: 16 * fast/mediastream/RTCPeerConnection-createOffer.html: 17 * fast/mediastream/RTCPeerConnection-datachannel.html: 18 * fast/mediastream/RTCPeerConnection-dtmf.html: 19 * fast/mediastream/RTCPeerConnection-events.html: 20 * fast/mediastream/RTCPeerConnection-expected.txt: 21 * fast/mediastream/RTCPeerConnection-have-local-answer.html: 22 * fast/mediastream/RTCPeerConnection-have-local-offer.html: 23 * fast/mediastream/RTCPeerConnection-have-local-pranswer.html: 24 * fast/mediastream/RTCPeerConnection-have-remote-offer.html: 25 * fast/mediastream/RTCPeerConnection-have-remote-pranswer.html: 26 * fast/mediastream/RTCPeerConnection-ice-expected.txt: 27 * fast/mediastream/RTCPeerConnection-ice.html: 28 * fast/mediastream/RTCPeerConnection-localDescription.html: 29 * fast/mediastream/RTCPeerConnection-onnegotiationneeded.html: 30 * fast/mediastream/RTCPeerConnection-remoteDescription.html: 31 * fast/mediastream/RTCPeerConnection-stable.html: 32 * fast/mediastream/RTCPeerConnection-state-expected.txt: 33 * fast/mediastream/RTCPeerConnection-state.html: 34 * fast/mediastream/RTCPeerConnection-stats-expected.txt: 35 * fast/mediastream/RTCPeerConnection-stats.html: 36 * fast/mediastream/RTCPeerConnection-statsSelector-expected.txt: 37 * fast/mediastream/RTCPeerConnection-statsSelector.html: 38 * fast/mediastream/RTCPeerConnection.html: 39 1 40 2014-02-24 Radu Stavila <stavila@adobe.com> 2 41 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html
r160181 r164602 76 76 stream = s; 77 77 78 pc = new webkitRTCPeerConnection({iceServers:[ ]});78 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 79 79 pc.onnegotiationneeded = onErroneousNegotiationNeeded; 80 80 shouldThrow("pc.addStream(stream, {mandatory:{invalid:1}})"); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
r160553 r164602 82 82 } 83 83 84 pc = new webkitRTCPeerConnection({iceServers:[ ]});84 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 85 85 shouldNotThrow('pc.createAnswer(requestSucceeded1, requestFailed1);'); 86 86 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html
r160553 r164602 51 51 } 52 52 53 pc = new webkitRTCPeerConnection({iceServers:[ ]});53 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 54 54 shouldNotThrow('pc.createOffer(requestSucceeded1, requestFailed1, {mandatory:{"succeed":true}});'); 55 55 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-datachannel.html
r158991 r164602 82 82 } 83 83 84 pc = new webkitRTCPeerConnection({iceServers:[ ]});84 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 85 85 shouldNotThrow('dc = pc.createDataChannel("label1");'); 86 86 shouldNotThrow('dc = pc.createDataChannel("label2", {});'); … … 90 90 shouldNotThrow('dc = pc.createDataChannel("label3", {maxRetransmitTime:0});'); 91 91 92 pc = new webkitRTCPeerConnection({iceServers:[ ]});92 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 93 93 pc.oniceconnectionstatechange = pc_onicechange; 94 94 pc.ondatachannel = pc_ondatachannel; -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-dtmf.html
r158991 r164602 53 53 shouldBe('stream.getVideoTracks().length', '0'); 54 54 55 pc = new webkitRTCPeerConnection({iceServers:[ ]});55 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 56 56 pc.oniceconnectionstatechange = pc_onicechange; 57 57 } -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-events.html
r158991 r164602 42 42 stream = s; 43 43 44 pc = new webkitRTCPeerConnection({iceServers:[ ]});44 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 45 45 pc.onnegotiationneeded = onNegotiationNeeded; 46 46 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt
r164372 r164602 19 19 PASS new webkitRTCPeerConnection(undefined, {}); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary. 20 20 PASS new webkitRTCPeerConnection({iceServers:[]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 21 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 22 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 23 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 24 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 25 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 26 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 27 PASS new webkitRTCPeerConnection({iceServers:[]}); did not throw exception. 28 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'}); did not throw exception. 29 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay'}); did not throw exception. 30 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}); did not throw exception. 31 PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'yes'}); did not throw exception. 32 PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'no'}); did not throw exception. 33 PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'ifconfigured'}); did not throw exception. 34 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'bar'}); did not throw exception. 35 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'bar'}); did not throw exception. 36 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'no'}); did not throw exception. 37 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'yes'}); did not throw exception. 38 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'no'}); did not throw exception. 39 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'ifconfigured'}); did not throw exception. 40 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'yes'}); did not throw exception. 41 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'no'}); did not throw exception. 42 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'ifconfigured'}); did not throw exception. 43 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'yes'}); did not throw exception. 44 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'no'}); did not throw exception. 45 PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception. 46 PASS new webkitRTCPeerConnection({iceServers:[]}, {}); did not throw exception. 47 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, {}); did not throw exception. 48 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}]}, {}); did not throw exception. 49 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, {}); did not throw exception. 50 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}]}, {}); did not throw exception. 51 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, {}); did not throw exception. 52 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, {}); did not throw exception. 53 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 54 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 55 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 56 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 57 PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 21 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 22 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 23 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 24 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 25 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 26 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary. 27 PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}); threw exception TypeError: Error creating RTCPeerConnection. 28 PASS new webkitRTCPeerConnection({iceServers:[{urls:'http:foo.com'}]}); threw exception TypeError: Error creating RTCPeerConnection. 29 PASS new webkitRTCPeerConnection({iceServers:[]}); threw exception TypeError: Error creating RTCPeerConnection. 30 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception. 31 PASS new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:foo.com']}]}); did not throw exception. 32 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none'}); did not throw exception. 33 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay'}); did not throw exception. 34 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all'}); did not throw exception. 35 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'yes'}); did not throw exception. 36 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'no'}); did not throw exception. 37 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'ifconfigured'}); did not throw exception. 38 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'foo', requestIdentity:'bar'}); did not throw exception. 39 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'bar'}); did not throw exception. 40 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'foo', requestIdentity:'no'}); did not throw exception. 41 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'yes'}); did not throw exception. 42 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'no'}); did not throw exception. 43 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'ifconfigured'}); did not throw exception. 44 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'yes'}); did not throw exception. 45 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'no'}); did not throw exception. 46 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'ifconfigured'}); did not throw exception. 47 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'yes'}); did not throw exception. 48 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'no'}); did not throw exception. 49 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception. 50 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {}); did not throw exception. 51 PASS new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:bar.com']}]}, {}); did not throw exception. 52 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:foo.com', 'turn:bar.com']}]}, {}); did not throw exception. 53 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]}, {}); did not throw exception. 54 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}]}, {}); did not throw exception. 55 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]}, {}); did not throw exception. 56 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]}, {}); did not throw exception. 57 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]}, {}); did not throw exception. 58 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:['stun:bar.com', 'turn:foo.com', 'turn:foo2.com'], username:'user2', credential:'x'}]}, {}); did not throw exception. 59 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 60 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 61 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 62 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 63 PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception. 58 64 PASS new webkitRTCPeerConnection({fooServers:[]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 59 65 PASS new webkitRTCPeerConnection({iceServers:true}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 60 66 PASS new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 61 PASS new webkitRTCPeerConnection({iceServers:[{}]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 62 PASS new webkitRTCPeerConnection({iceServers:[{url:'foo'}]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 63 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:true}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 64 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:false}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 65 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:{}}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 66 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:1}}); did not throw exception. 67 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}}); did not throw exception. 68 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0}]}); did not throw exception. 69 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]}); did not throw exception. 70 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]}); did not throw exception. 67 PASS new webkitRTCPeerConnection({iceServers:[{}]}, {}); threw exception TypeError: Error creating RTCPeerConnection. 68 PASS new webkitRTCPeerConnection({iceServers:[{urls:'foo'}]}, {}); threw exception TypeError: Error creating RTCPeerConnection. 69 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:true}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 70 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:false}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 71 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:{}}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments. 72 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:{valid_and_supported_1:1}}); did not throw exception. 73 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}}); did not throw exception. 74 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_and_supported_1:0}]}); did not throw exception. 75 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]}); did not throw exception. 76 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]}); did not throw exception. 77 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {mandatory:{valid_and_supported_1:1}}); did not throw exception. 78 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}}); did not throw exception. 79 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_and_supported_1:0}]}); did not throw exception. 80 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]}); did not throw exception. 81 PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]}); did not throw exception. 71 82 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:66}}); threw exception TypeError: Error creating RTCPeerConnection. 72 83 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{invalid:1}}); threw exception TypeError: Error creating RTCPeerConnection. 73 84 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1}}); threw exception TypeError: Error creating RTCPeerConnection. 74 85 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1, valid_and_supported_1:1}}); threw exception TypeError: Error creating RTCPeerConnection. 75 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:{valid_and_supported_1:0}}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.76 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0,valid_and_supported_2:0}]}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.86 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:{valid_and_supported_1:0}}); threw exception TypeError: Error creating RTCPeerConnection. 87 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0,valid_and_supported_2:0}]}); threw exception TypeError: Error creating RTCPeerConnection. 77 88 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{invalid:0}]}); threw exception TypeError: Error creating RTCPeerConnection. 78 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_1:1}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.79 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_but_unsupported_1:1}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.80 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_2:1, mandatory:{valid_and_supported_1:1}}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.89 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_1:1}); threw exception TypeError: Error creating RTCPeerConnection. 90 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_but_unsupported_1:1}); threw exception TypeError: Error creating RTCPeerConnection. 91 PASS new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_2:1, mandatory:{valid_and_supported_1:1}}); threw exception TypeError: Error creating RTCPeerConnection. 81 92 PASS successfullyParsed is true 82 93 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-have-local-answer.html
r160693 r164602 90 90 } 91 91 92 pc = new webkitRTCPeerConnection({iceServers:[ ]});92 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 93 93 shouldBe('pc.signalingState', '"stable"'); 94 94 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-have-local-offer.html
r160693 r164602 29 29 testPassed('setRemoteDescription succeeded.'); 30 30 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"'); 31 pc = new webkitRTCPeerConnection({iceServers:[ ]});31 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 32 32 check("", "", "", "", '"stable"'); 33 33 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); … … 110 110 } 111 111 112 pc = new webkitRTCPeerConnection({iceServers:[ ]});112 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 113 113 shouldBe('pc.signalingState', '"stable"'); 114 114 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-have-local-pranswer.html
r160693 r164602 106 106 } 107 107 108 pc = new webkitRTCPeerConnection({iceServers:[ ]});108 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 109 109 shouldBe('pc.signalingState', '"stable"'); 110 110 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-offer.html
r160693 r164602 29 29 testPassed('setLocalDescription succeeded.'); 30 30 check("answer", "local", "offer", "remote", '"stable"'); 31 pc = new webkitRTCPeerConnection({iceServers:[ ]});31 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 32 32 check("", "", "", "", '"stable"'); 33 33 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); … … 110 110 } 111 111 112 pc = new webkitRTCPeerConnection({iceServers:[ ]});112 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 113 113 shouldBe('pc.signalingState', '"stable"'); 114 114 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-pranswer.html
r160693 r164602 106 106 } 107 107 108 pc = new webkitRTCPeerConnection({iceServers:[ ]});108 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 109 109 shouldBe('pc.signalingState', '"stable"'); 110 110 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-ice-expected.txt
r159938 r164602 4 4 5 5 6 PASS pc = new webkitRTCPeerConnection({iceServers:[ ]}); did not throw exception.6 PASS pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception. 7 7 PASS iceConnectionState is completed 8 8 PASS pc.addIceCandidate(null, null, null); threw exception TypeError: Type error. -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
r158991 r164602 44 44 } 45 45 46 shouldNotThrow( 'pc = new webkitRTCPeerConnection({iceServers:[]});');46 shouldNotThrow("pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});"); 47 47 pc.oniceconnectionstatechange = onIceChange1; 48 48 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html
r158991 r164602 43 43 } 44 44 45 pc = new webkitRTCPeerConnection({iceServers:[ ]});45 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 46 46 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); 47 47 shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded1, requestFailed1);'); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded.html
r160181 r164602 51 51 stream = s; 52 52 53 pc = new webkitRTCPeerConnection({iceServers:[ ]});53 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 54 54 pc.onnegotiationneeded = onNegotiationNeeded; 55 55 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
r160693 r164602 43 43 } 44 44 45 pc = new webkitRTCPeerConnection({iceServers:[ ]});45 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 46 46 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); 47 47 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, requestFailed1);'); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stable.html
r160693 r164602 21 21 testPassed('setLocalDescription succeeded.'); 22 22 check("offer", "local", "", "", '"have-local-offer"') 23 pc = new webkitRTCPeerConnection({iceServers:[ ]});23 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 24 24 check("", "", "", "", '"stable"'); 25 25 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}); … … 96 96 } 97 97 98 pc = new webkitRTCPeerConnection({iceServers:[ ]});98 pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); 99 99 shouldBe('pc.signalingState', '"stable"'); 100 100 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"}); -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-state-expected.txt
r159938 r164602 4 4 5 5 6 PASS pc = new webkitRTCPeerConnection({iceServers:[ ]}); did not throw exception.6 PASS pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception. 7 7 PASS pc.signalingState is "stable" 8 8 PASS stateChanged was called -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-state.html
r158991 r164602 17 17 } 18 18 19 shouldNotThrow( 'pc = new webkitRTCPeerConnection({iceServers:[]});');19 shouldNotThrow("pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});"); 20 20 shouldBeEqualToString('pc.signalingState', 'stable'); 21 21 pc.onsignalingstatechange = stateChanged; -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt
r158964 r164602 4 4 5 5 6 PASS pc = new webkitRTCPeerConnection({iceServers:[ ]}) did not throw exception.6 PASS pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}) did not throw exception. 7 7 PASS pc.getStats(statsHandler1) did not throw exception. 8 8 PASS statsHandler1 was called -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
r158987 r164602 73 73 74 74 var startTime = new Date().getTime(); 75 shouldNotThrow( 'pc = new webkitRTCPeerConnection({iceServers:[]})');75 shouldNotThrow("pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]})"); 76 76 shouldNotThrow('pc.getStats(statsHandler1)'); 77 77 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector-expected.txt
r158964 r164602 4 4 5 5 6 PASS pc = new webkitRTCPeerConnection({iceServers:[ ]}) did not throw exception.6 PASS pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}) did not throw exception. 7 7 PASS getUserMedia({audio:true, video:true}, gotStream) did not throw exception. 8 8 PASS Got a stream. -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html
r158987 r164602 48 48 49 49 var startTime = new Date().getTime(); 50 shouldNotThrow( 'pc = new webkitRTCPeerConnection({iceServers:[]})');50 shouldNotThrow("pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]})"); 51 51 shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)'); 52 52 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html
r164372 r164602 23 23 shouldThrow("new webkitRTCPeerConnection(undefined, {});"); 24 24 shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, null);"); 25 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, null);"); 26 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}]}, null);"); 27 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, null);"); 28 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}]}, null);"); 29 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, null);"); 30 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, null);") 25 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, null);"); 26 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]}, null);"); 27 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, null);"); 28 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]}, null);"); 29 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]}, null);"); 30 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]}, null);") 31 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]});"); 32 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'http:foo.com'}]});"); 33 shouldThrow("new webkitRTCPeerConnection({iceServers:[]});"); 31 34 32 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]});"); 35 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});"); 36 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:foo.com']}]});"); 33 37 34 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'none'});");35 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'relay'});");36 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'all'});");37 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], requestIdentity:'yes'});");38 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], requestIdentity:'no'});");39 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], requestIdentity:'ifconfigured'});");40 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'foo', requestIdentity:'bar'});");41 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'none', requestIdentity:'bar'});");42 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'foo', requestIdentity:'no'});");43 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'none', requestIdentity:'yes'});");44 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'none', requestIdentity:'no'});");45 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'none', requestIdentity:'ifconfigured'});");46 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'relay', requestIdentity:'yes'});");47 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'relay', requestIdentity:'no'});");48 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'relay', requestIdentity:'ifconfigured'});");49 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'all', requestIdentity:'yes'});");50 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'all', requestIdentity:'no'});");51 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[ ], iceTransports:'all', requestIdentity:'ifconfigured'});");38 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none'});"); 39 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay'});"); 40 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all'});"); 41 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'yes'});"); 42 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'no'});"); 43 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], requestIdentity:'ifconfigured'});"); 44 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'foo', requestIdentity:'bar'});"); 45 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'bar'});"); 46 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'foo', requestIdentity:'no'});"); 47 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'yes'});"); 48 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'no'});"); 49 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none', requestIdentity:'ifconfigured'});"); 50 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'yes'});"); 51 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'no'});"); 52 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay', requestIdentity:'ifconfigured'});"); 53 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'yes'});"); 54 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'no'});"); 55 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'ifconfigured'});"); 52 56 53 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {});"); 54 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, {});"); 55 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}]}, {});"); 56 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, {});"); 57 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}]}, {});"); 58 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, {});"); 59 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, {});"); 57 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {});"); 58 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:bar.com']}]}, {});"); 59 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:foo.com', 'turn:bar.com']}]}, {});"); 60 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]}, {});"); 61 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}]}, {});"); 62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]}, {});"); 63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]}, {});"); 64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]}, {});"); 65 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:['stun:bar.com', 'turn:foo.com', 'turn:foo2.com'], username:'user2', credential:'x'}]}, {});"); 60 66 61 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url :'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url :'turn:foo.com', credential:'x'},{url:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url :'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url :'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");65 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url :'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");67 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});"); 68 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});"); 69 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});"); 70 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});"); 71 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});"); 66 72 67 73 shouldThrow("new webkitRTCPeerConnection({fooServers:[]}, {});"); … … 69 75 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, {});"); 70 76 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]}, {});"); 71 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url :'foo'}]}, {});");72 shouldThrow("new webkitRTCPeerConnection({iceServers:[ ]}, {mandatory:true});");73 shouldThrow("new webkitRTCPeerConnection({iceServers:[ ]}, {optional:false});");74 shouldThrow("new webkitRTCPeerConnection({iceServers:[ ]}, {optional:{}});");77 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'foo'}]}, {});"); 78 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:true});"); 79 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:false});"); 80 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:{}});"); 75 81 76 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:1}});"); 77 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}});"); 78 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0}]});"); 79 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]});"); 80 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]});"); 82 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:{valid_and_supported_1:1}});"); 83 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}});"); 84 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_and_supported_1:0}]});"); 85 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]});"); 86 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]});"); 87 88 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {mandatory:{valid_and_supported_1:1}});"); 89 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}});"); 90 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_and_supported_1:0}]});"); 91 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]});"); 92 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:bar.com', 'turn:foo.com']}]}, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]});"); 81 93 82 94 shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:66}});"); -
trunk/Source/WebCore/ChangeLog
r164600 r164602 1 2014-02-24 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 3 [WebRTC] Validating RTCConfiguration according to the spec 4 https://bugs.webkit.org/show_bug.cgi?id=129182 5 6 Reviewed by Eric Carlson. 7 8 Spec states that: 9 - iceServers should not be an empty list 10 - the entry in the configuration dictionary is "urls", instead of "url" 11 - urls can be either a list or a string 12 Fixing all that in RTCConfiguration validation when creating a RTCPeerConnection 13 14 Existing tests were updated. 15 16 * Modules/mediastream/RTCPeerConnection.cpp: 17 (WebCore::appendIceServer): Added. 18 (WebCore::processIceServer): Added. 19 (WebCore::RTCPeerConnection::parseConfiguration): 20 1 21 2014-02-24 Radu Stavila <stavila@adobe.com> 2 22 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r164372 r164602 67 67 namespace WebCore { 68 68 69 static bool appendIceServer(const String& iceURL, const String& credential, const String& username, RTCConfiguration* rtcConfiguration) 70 { 71 URL url(URL(), iceURL); 72 if (url.isEmpty() || !url.isValid() || !(url.protocolIs("turn") || url.protocolIs("stun"))) 73 return false; 74 75 rtcConfiguration->appendServer(RTCIceServer::create(url, credential, username)); 76 return true; 77 } 78 79 static ExceptionCode processIceServer(const Dictionary& iceServer, RTCConfiguration* rtcConfiguration) 80 { 81 String credential, username; 82 iceServer.get("credential", credential); 83 iceServer.get("username", username); 84 85 // Spec says that "urls" can be either a string or a sequence, so we must check for both. 86 Vector<String> urlsList; 87 String urlString; 88 iceServer.get("urls", urlString); 89 // This is the only way to check if "urls" is a sequence or a string. If we try to convert 90 // to a sequence and it fails (in case it is a string), an exception will be set and the 91 // RTCPeerConnection will fail. 92 // So we convert to a string always, which converts a sequence to a string in the format: "foo, bar, ..", 93 // then checking for a comma in the string assures that a string was a sequence and then we convert 94 // it to a sequence safely. 95 if (urlString.find(',') != notFound && iceServer.get("urls", urlsList) && urlsList.size()) { 96 for (auto iter = urlsList.begin(); iter != urlsList.end(); ++iter) { 97 if (!appendIceServer((*iter), credential, username, rtcConfiguration)) 98 return INVALID_ACCESS_ERR; 99 } 100 101 return 0; 102 } 103 104 if (!urlString.isEmpty() && appendIceServer(urlString, credential, username, rtcConfiguration)) 105 return 0; 106 107 return INVALID_ACCESS_ERR; 108 } 109 69 110 PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Dictionary& configuration, ExceptionCode& ec) 70 111 { … … 81 122 size_t numberOfServers; 82 123 ok = iceServers.length(numberOfServers); 83 if (!ok ) {84 ec = TYPE_MISMATCH_ERR;124 if (!ok || !numberOfServers) { 125 ec = !ok ? TYPE_MISMATCH_ERR : INVALID_ACCESS_ERR; 85 126 return nullptr; 86 127 } … … 104 145 } 105 146 106 String urlString, credential, username; 107 ok = iceServer.get("url", urlString); 108 if (!ok) { 109 ec = TYPE_MISMATCH_ERR; 147 ec = processIceServer(iceServer, rtcConfiguration.get()); 148 if (ec) 110 149 return nullptr; 111 }112 URL url(URL(), urlString);113 if (!url.isValid() || !(url.protocolIs("turn") || url.protocolIs("stun"))) {114 ec = TYPE_MISMATCH_ERR;115 return nullptr;116 }117 118 iceServer.get("credential", credential);119 iceServer.get("username", username);120 121 rtcConfiguration->appendServer(RTCIceServer::create(url, credential, username));122 150 } 123 151
Note: See TracChangeset
for help on using the changeset viewer.