Changeset 164839 in webkit


Ignore:
Timestamp:
Feb 27, 2014 3:58:28 PM (10 years ago)
Author:
thiago.lacerda@openbossa.org
Message:

[WebRTC] Removing MediaConstraints argument from RTCPeerConnection addStream, updateIce methods and constructor
https://bugs.webkit.org/show_bug.cgi?id=129449

Reviewed by Eric Carlson.

According to WebRTC editor's draft, MediaConstraints will no longer be an argument of those methods and
constructor.

Source/WebCore:

Existing tests were updated.

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::updateIce):
(WebCore::RTCPeerConnection::addStream):

  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/RTCPeerConnection.idl:
  • bindings/js/JSRTCPeerConnectionCustom.cpp:

(WebCore::JSRTCPeerConnectionConstructor::constructJSRTCPeerConnection):

  • platform/mediastream/RTCPeerConnectionHandler.h:
  • platform/mock/RTCPeerConnectionHandlerMock.cpp:

(WebCore::RTCPeerConnectionHandlerMock::initialize):
(WebCore::RTCPeerConnectionHandlerMock::updateIce):
(WebCore::RTCPeerConnectionHandlerMock::addStream):

  • platform/mock/RTCPeerConnectionHandlerMock.h:

LayoutTests:

  • fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt:
  • fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
  • fast/mediastream/RTCPeerConnection-expected.txt:
  • fast/mediastream/RTCPeerConnection.html:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164830 r164839  
     12014-02-27  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Removing MediaConstraints argument from RTCPeerConnection addStream, updateIce methods and constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=129449
     5
     6        Reviewed by Eric Carlson.
     7
     8        According to WebRTC editor's draft, MediaConstraints will no longer be an argument of those methods and
     9        constructor.
     10
     11        * fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt:
     12        * fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
     13        * fast/mediastream/RTCPeerConnection-expected.txt:
     14        * fast/mediastream/RTCPeerConnection.html:
     15
    1162014-02-27  Brian Burg  <bburg@apple.com>
    217
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt

    r160181 r164839  
    55
    66PASS Got a stream.
    7 PASS pc.addStream(stream, {mandatory:{invalid:1}}) threw exception Error: SyntaxError: DOM Exception 12.
     7PASS pc.addStream(null) threw exception Error: TypeMismatchError: DOM Exception 17.
    88PASS pc.getLocalStreams().length is 0
    99PASS Got another stream.
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html

    r164602 r164839  
    7878                pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
    7979                pc.onnegotiationneeded = onErroneousNegotiationNeeded;
    80                 shouldThrow("pc.addStream(stream, {mandatory:{invalid:1}})");
     80                shouldThrow("pc.addStream(null)");
    8181
    8282                shouldBe('pc.getLocalStreams().length', '0');
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt

    r164602 r164839  
    44
    55
    6 PASS new webkitRTCPeerConnection(null); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    7 PASS new webkitRTCPeerConnection(null, null); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    8 PASS new webkitRTCPeerConnection(undefined); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    9 PASS new webkitRTCPeerConnection(undefined, undefined); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
     6PASS new webkitRTCPeerConnection(null); threw exception TypeError: RTCPeerConnection argument must be a valid Dictionary.
     7PASS new webkitRTCPeerConnection(undefined); threw exception TypeError: RTCPeerConnection argument must be a valid Dictionary.
    108PASS new webkitRTCPeerConnection(); threw exception TypeError: Not enough arguments.
    11 PASS new webkitRTCPeerConnection(''); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    12 PASS new webkitRTCPeerConnection(null, ''); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
     9PASS new webkitRTCPeerConnection(''); threw exception TypeError: RTCPeerConnection argument must be a valid Dictionary.
    1310PASS new webkitRTCPeerConnection({}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    14 PASS new webkitRTCPeerConnection({}, ''); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary.
    15 PASS new webkitRTCPeerConnection({}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary.
    16 PASS new webkitRTCPeerConnection({}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    17 PASS new webkitRTCPeerConnection('', {}); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    18 PASS new webkitRTCPeerConnection(null, {}); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    19 PASS new webkitRTCPeerConnection(undefined, {}); threw exception TypeError: First argument of RTCPeerConnection must be a valid Dictionary.
    20 PASS new webkitRTCPeerConnection({iceServers:[]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary.
    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.
     11PASS new webkitRTCPeerConnection({iceServers:[]}); threw exception TypeError: Error creating RTCPeerConnection.
    2712PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}); threw exception TypeError: Error creating RTCPeerConnection.
    2813PASS new webkitRTCPeerConnection({iceServers:[{urls:'http:foo.com'}]}); threw exception TypeError: Error creating RTCPeerConnection.
    29 PASS new webkitRTCPeerConnection({iceServers:[]}); threw exception TypeError: Error creating RTCPeerConnection.
    3014PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception.
    3115PASS new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:foo.com']}]}); did not throw exception.
     16PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:foo.com', 'turn:bar.com']}]}); did not throw exception.
    3217PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none'}); did not throw exception.
    3318PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'relay'}); did not throw exception.
     
    4833PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'no'}); did not throw exception.
    4934PASS 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.
    64 PASS new webkitRTCPeerConnection({fooServers:[]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    65 PASS new webkitRTCPeerConnection({iceServers:true}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    66 PASS new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    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.
    82 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:66}}); threw exception TypeError: Error creating RTCPeerConnection.
    83 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{invalid:1}}); threw exception TypeError: Error creating RTCPeerConnection.
    84 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1}}); threw exception TypeError: Error creating RTCPeerConnection.
    85 PASS new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1, valid_and_supported_1:1}}); threw exception TypeError: Error creating RTCPeerConnection.
    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.
    88 PASS new webkitRTCPeerConnection({iceServers:[]}, {optional:[{invalid:0}]}); threw exception TypeError: Error creating RTCPeerConnection.
    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.
     35PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]}); did not throw exception.
     36PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}]}); did not throw exception.
     37PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]}); did not throw exception.
     38PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]}); did not throw exception.
     39PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]}); did not throw exception.
     40PASS 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.
     41PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception.
     42PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception.
     43PASS new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception.
     44PASS new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception.
     45PASS 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.
     46PASS new webkitRTCPeerConnection({fooServers:[]}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
     47PASS new webkitRTCPeerConnection({iceServers:true}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
     48PASS new webkitRTCPeerConnection({iceServers:[1, 2, 3]}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
     49PASS new webkitRTCPeerConnection({iceServers:[{}]}); threw exception TypeError: Error creating RTCPeerConnection.
     50PASS new webkitRTCPeerConnection({iceServers:[{urls:'foo'}]}); threw exception TypeError: Error creating RTCPeerConnection.
    9251PASS successfullyParsed is true
    9352
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html

    r164602 r164839  
    99
    1010            shouldThrow("new webkitRTCPeerConnection(null);");
    11             shouldThrow("new webkitRTCPeerConnection(null, null);");
    1211            shouldThrow("new webkitRTCPeerConnection(undefined);");
    13             shouldThrow("new webkitRTCPeerConnection(undefined, undefined);");
    1412            shouldThrow("new webkitRTCPeerConnection();");
    1513            shouldThrow("new webkitRTCPeerConnection('');");
    16             shouldThrow("new webkitRTCPeerConnection(null, '');");
    1714            shouldThrow("new webkitRTCPeerConnection({});");
    18             shouldThrow("new webkitRTCPeerConnection({}, '');");
    19             shouldThrow("new webkitRTCPeerConnection({}, null);");
    20             shouldThrow("new webkitRTCPeerConnection({}, {});");
    21             shouldThrow("new webkitRTCPeerConnection('', {});");
    22             shouldThrow("new webkitRTCPeerConnection(null, {});");
    23             shouldThrow("new webkitRTCPeerConnection(undefined, {});");
    24             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, 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);")
     15            shouldThrow("new webkitRTCPeerConnection({iceServers:[]});");
    3116            shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]});");
    3217            shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'http:foo.com'}]});");
    33             shouldThrow("new webkitRTCPeerConnection({iceServers:[]});");
    3418
    3519            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});");
    3620            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:foo.com']}]});");
     21            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}, {urls:['stun:foo.com', 'turn:bar.com']}]});");
    3722
    3823            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'none'});");
     
    5540            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
    5641
    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'}]}, {});");
     42            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}]});");
     43            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}]});");
     44            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}]});");
     45            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}]});");
     46            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}]});");
     47            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'}]});");
    6648
    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'}, {});");
     49            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
     50            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', credential:'x'},{urls:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
     51            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
     52            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
     53            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'turn:foo.com', username:'user', credential:'x'},{urls:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'});");
    7254
    73             shouldThrow("new webkitRTCPeerConnection({fooServers:[]}, {});");
    74             shouldThrow("new webkitRTCPeerConnection({iceServers:true}, {});");
    75             shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, {});");
    76             shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]}, {});");
    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:{}});");
    81 
    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}]});");
    93 
    94             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_and_supported_1:66}});");
    95             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{invalid:1}});");
    96             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1}});");
    97             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {mandatory:{valid_but_unsupported_1:1, valid_and_supported_1:1}});");
    98             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:{valid_and_supported_1:0}});");
    99             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:[{valid_and_supported_1:0,valid_and_supported_2:0}]});");
    100             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {optional:[{invalid:0}]});");
    101             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_1:1});");
    102             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {valid_but_unsupported_1:1});");
    103             shouldThrow("new webkitRTCPeerConnection({iceServers:[]}, {valid_and_supported_2:1, mandatory:{valid_and_supported_1:1}});");
     55            shouldThrow("new webkitRTCPeerConnection({fooServers:[]});");
     56            shouldThrow("new webkitRTCPeerConnection({iceServers:true});");
     57            shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]});");
     58            shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]});");
     59            shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:'foo'}]});");
    10460        </script>
    10561        <script src="../../resources/js-test-post.js"></script>
  • trunk/Source/WebCore/ChangeLog

    r164837 r164839  
     12014-02-27  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Removing MediaConstraints argument from RTCPeerConnection addStream, updateIce methods and constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=129449
     5
     6        Reviewed by Eric Carlson.
     7
     8        According to WebRTC editor's draft, MediaConstraints will no longer be an argument of those methods and
     9        constructor.
     10
     11        Existing tests were updated.
     12
     13        * Modules/mediastream/RTCPeerConnection.cpp:
     14        (WebCore::RTCPeerConnection::create):
     15        (WebCore::RTCPeerConnection::RTCPeerConnection):
     16        (WebCore::RTCPeerConnection::updateIce):
     17        (WebCore::RTCPeerConnection::addStream):
     18        * Modules/mediastream/RTCPeerConnection.h:
     19        * Modules/mediastream/RTCPeerConnection.idl:
     20        * bindings/js/JSRTCPeerConnectionCustom.cpp:
     21        (WebCore::JSRTCPeerConnectionConstructor::constructJSRTCPeerConnection):
     22        * platform/mediastream/RTCPeerConnectionHandler.h:
     23        * platform/mock/RTCPeerConnectionHandlerMock.cpp:
     24        (WebCore::RTCPeerConnectionHandlerMock::initialize):
     25        (WebCore::RTCPeerConnectionHandlerMock::updateIce):
     26        (WebCore::RTCPeerConnectionHandlerMock::addStream):
     27        * platform/mock/RTCPeerConnectionHandlerMock.h:
     28
    1292014-02-27  Radu Stavila  <stavila@adobe.com>
    230
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r164602 r164839  
    153153}
    154154
    155 PassRefPtr<RTCPeerConnection> RTCPeerConnection::create(ScriptExecutionContext& context, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode& ec)
     155PassRefPtr<RTCPeerConnection> RTCPeerConnection::create(ScriptExecutionContext& context, const Dictionary& rtcConfiguration, ExceptionCode& ec)
    156156{
    157157    RefPtr<RTCConfiguration> configuration = parseConfiguration(rtcConfiguration, ec);
     
    159159        return nullptr;
    160160
    161     RefPtr<MediaConstraints> constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
    162     if (ec)
    163         return nullptr;
    164 
    165     RefPtr<RTCPeerConnection> peerConnection = adoptRef(new RTCPeerConnection(context, configuration.release(), constraints.release(), ec));
     161    RefPtr<RTCPeerConnection> peerConnection = adoptRef(new RTCPeerConnection(context, configuration.release(), ec));
    166162    peerConnection->suspendIfNeeded();
    167163    if (ec)
     
    171167}
    172168
    173 RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext& context, PassRefPtr<RTCConfiguration> configuration, PassRefPtr<MediaConstraints> constraints, ExceptionCode& ec)
     169RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext& context, PassRefPtr<RTCConfiguration> configuration, ExceptionCode& ec)
    174170    : ActiveDOMObject(&context)
    175171    , m_signalingState(SignalingStateStable)
     
    194190    document.frame()->loader().client().dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
    195191
    196     if (!m_peerHandler->initialize(configuration, constraints)) {
     192    if (!m_peerHandler->initialize(configuration)) {
    197193        ec = NOT_SUPPORTED_ERR;
    198194        return;
     
    346342}
    347343
    348 void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode& ec)
     344void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, ExceptionCode& ec)
    349345{
    350346    if (m_signalingState == SignalingStateClosed) {
     
    357353        return;
    358354
    359     RefPtr<MediaConstraints> constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
    360     if (ec)
    361         return;
    362 
    363     bool valid = m_peerHandler->updateIce(configuration, constraints);
     355    bool valid = m_peerHandler->updateIce(configuration);
    364356    if (!valid)
    365357        ec = SYNTAX_ERR;
     
    444436}
    445437
    446 void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, const Dictionary& mediaConstraints, ExceptionCode& ec)
     438void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, ExceptionCode& ec)
    447439{
    448440    if (m_signalingState == SignalingStateClosed) {
     
    460452        return;
    461453
    462     RefPtr<MediaConstraints> constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
    463     if (ec)
    464         return;
    465 
    466     bool valid = m_peerHandler->addStream(stream->privateStream(), constraints);
     454    bool valid = m_peerHandler->addStream(stream->privateStream());
    467455    if (!valid)
    468456        ec = SYNTAX_ERR;
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r162158 r164839  
    6262class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public ScriptWrappable, public RTCPeerConnectionHandlerClient, public EventTargetWithInlineData, public ActiveDOMObject, public MediaStream::Observer {
    6363public:
    64     static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode&);
     64    static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&);
    6565    ~RTCPeerConnection();
    6666
     
    7777    String signalingState() const;
    7878
    79     void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode&);
     79    void updateIce(const Dictionary& rtcConfiguration, ExceptionCode&);
    8080
    8181    void addIceCandidate(RTCIceCandidate*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, ExceptionCode&);
     
    9191    MediaStream* getStreamById(const String& streamId);
    9292
    93     void addStream(PassRefPtr<MediaStream>, const Dictionary& mediaConstraints, ExceptionCode&);
     93    void addStream(PassRefPtr<MediaStream>, ExceptionCode&);
    9494
    9595    void removeStream(PassRefPtr<MediaStream>, ExceptionCode&);
     
    135135
    136136private:
    137     RTCPeerConnection(ScriptExecutionContext&, PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>, ExceptionCode&);
     137    RTCPeerConnection(ScriptExecutionContext&, PassRefPtr<RTCConfiguration>, ExceptionCode&);
    138138
    139139    static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& configuration, ExceptionCode&);
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r160553 r164839  
    3333    Conditional=MEDIA_STREAM,
    3434    ActiveDOMObject,
    35     CustomConstructor(Dictionary rtcIceServers, optional Dictionary mediaConstraints),
     35    CustomConstructor(Dictionary rtcConfiguration),
    3636    ConstructorCallWith=ScriptExecutionContext,
    3737    ConstructorRaisesException,
     
    5252    readonly attribute DOMString signalingState;
    5353
    54     [RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints);
     54    [RaisesException] void updateIce(optional Dictionary configuration);
    5555
    5656    [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
     
    6363    MediaStream getStreamById(DOMString streamId);
    6464
    65     [StrictTypeChecking, RaisesException] void addStream(MediaStream stream, optional Dictionary mediaConstraints);
     65    [StrictTypeChecking, RaisesException] void addStream(MediaStream stream);
    6666    [StrictTypeChecking, RaisesException] void removeStream(MediaStream stream);
    6767
  • trunk/Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp

    r158964 r164839  
    4848
    4949    if (!rtcConfiguration.isObject())
    50         return throwVMError(exec, createTypeError(exec, "First argument of RTCPeerConnection must be a valid Dictionary"));
    51 
    52     Dictionary mediaConstraints;
    53     if (exec->argumentCount() > 1) {
    54         mediaConstraints = Dictionary(exec, exec->argument(1));
    55         if (!mediaConstraints.isObject())
    56             return throwVMError(exec, createTypeError(exec, "Optional constraints argument of RTCPeerConnection must be a valid Dictionary"));
    57 
    58         if (exec->hadException())
    59             return JSValue::encode(jsUndefined());
    60     }
     50        return throwVMError(exec, createTypeError(exec, "RTCPeerConnection argument must be a valid Dictionary"));
    6151
    6252    JSRTCPeerConnectionConstructor* jsConstructor = jsCast<JSRTCPeerConnectionConstructor*>(exec->callee());
     
    6555        return throwVMError(exec, createReferenceError(exec, "RTCPeerConnection constructor associated document is unavailable"));
    6656
    67     RefPtr<RTCPeerConnection> peerConnection = RTCPeerConnection::create(*scriptExecutionContext, rtcConfiguration, mediaConstraints, ec);
     57    RefPtr<RTCPeerConnection> peerConnection = RTCPeerConnection::create(*scriptExecutionContext, rtcConfiguration, ec);
    6858    if (ec == TYPE_MISMATCH_ERR) {
    6959        setDOMException(exec, ec);
  • trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h

    r160553 r164839  
    8181    static const AtomicString& internalErrorName();
    8282
    83     virtual bool initialize(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>) = 0;
     83    virtual bool initialize(PassRefPtr<RTCConfiguration>) = 0;
    8484
    8585    virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) = 0;
     
    8989    virtual PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() = 0;
    9090    virtual PassRefPtr<RTCSessionDescriptionDescriptor> remoteDescription() = 0;
    91     virtual bool updateIce(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>) = 0;
     91    virtual bool updateIce(PassRefPtr<RTCConfiguration>) = 0;
    9292    virtual bool addIceCandidate(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCIceCandidateDescriptor>) = 0;
    93     virtual bool addStream(PassRefPtr<MediaStreamPrivate>, PassRefPtr<MediaConstraints>) = 0;
     93    virtual bool addStream(PassRefPtr<MediaStreamPrivate>) = 0;
    9494    virtual void removeStream(PassRefPtr<MediaStreamPrivate>) = 0;
    9595    virtual void getStats(PassRefPtr<RTCStatsRequest>) = 0;
  • trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp

    r160693 r164839  
    5252}
    5353
    54 bool RTCPeerConnectionHandlerMock::initialize(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints> constraints)
     54bool RTCPeerConnectionHandlerMock::initialize(PassRefPtr<RTCConfiguration>)
    5555{
    56     String invalidQuery = MediaConstraintsMock::verifyConstraints(constraints);
    57     if (!invalidQuery.isEmpty())
    58         return false;
    59 
    6056    RefPtr<IceConnectionNotifier> notifier = adoptRef(new IceConnectionNotifier(m_client, RTCPeerConnectionHandlerClient::IceConnectionStateCompleted, RTCPeerConnectionHandlerClient::IceGatheringStateComplete));
    6157    m_timerEvents.append(adoptRef(new TimerEvent(this, notifier)));
     
    144140}
    145141
    146 bool RTCPeerConnectionHandlerMock::updateIce(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>)
     142bool RTCPeerConnectionHandlerMock::updateIce(PassRefPtr<RTCConfiguration>)
    147143{
    148144    return true;
     
    156152}
    157153
    158 bool RTCPeerConnectionHandlerMock::addStream(PassRefPtr<MediaStreamPrivate>, PassRefPtr<MediaConstraints> constraints)
     154bool RTCPeerConnectionHandlerMock::addStream(PassRefPtr<MediaStreamPrivate>)
    159155{
    160     String invalidQuery = MediaConstraintsMock::verifyConstraints(constraints);
    161     if (!invalidQuery.isEmpty())
    162         return false;
    163 
    164156    // Spec states that every time a stream is added, a negotiationneeded event must be fired.
    165157    m_client->negotiationNeeded();
  • trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h

    r162158 r164839  
    4242    virtual ~RTCPeerConnectionHandlerMock() { }
    4343
    44     virtual bool initialize(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>) override;
     44    virtual bool initialize(PassRefPtr<RTCConfiguration>) override;
    4545
    4646    virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) override;
     
    5050    virtual PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() override;
    5151    virtual PassRefPtr<RTCSessionDescriptionDescriptor> remoteDescription() override;
    52     virtual bool updateIce(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>) override;
     52    virtual bool updateIce(PassRefPtr<RTCConfiguration>) override;
    5353    virtual bool addIceCandidate(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCIceCandidateDescriptor>) override;
    54     virtual bool addStream(PassRefPtr<MediaStreamPrivate>, PassRefPtr<MediaConstraints>) override;
     54    virtual bool addStream(PassRefPtr<MediaStreamPrivate>) override;
    5555    virtual void removeStream(PassRefPtr<MediaStreamPrivate>) override;
    5656    virtual void getStats(PassRefPtr<RTCStatsRequest>) override;
Note: See TracChangeset for help on using the changeset viewer.