@@ -1460,10 +1460,11 @@ test('Basic connection establishment with promise', function(t) {
1460
1460
}
1461
1461
} ;
1462
1462
1463
+ var dictionary = obj => JSON . parse ( JSON . stringify ( obj ) ) ;
1464
+
1463
1465
var addCandidate = function ( pc , event ) {
1464
1466
if ( event . candidate ) {
1465
- var cand = new RTCIceCandidate ( event . candidate ) ;
1466
- pc . addIceCandidate ( cand ) . then ( function ( ) {
1467
+ pc . addIceCandidate ( dictionary ( event . candidate ) ) . then ( function ( ) {
1467
1468
// TODO: Decide if we are interested in adding all candidates
1468
1469
// as passed tests.
1469
1470
tc . pass ( 'addIceCandidate ' + counter ++ ) ;
@@ -1486,19 +1487,19 @@ test('Basic connection establishment with promise', function(t) {
1486
1487
pc1 . addStream ( stream ) ;
1487
1488
pc1 . createOffer ( ) . then ( function ( offer ) {
1488
1489
tc . pass ( 'pc1.createOffer' ) ;
1489
- return pc1 . setLocalDescription ( offer ) ;
1490
+ return pc1 . setLocalDescription ( dictionary ( offer ) ) ;
1490
1491
} ) . then ( function ( ) {
1491
1492
tc . pass ( 'pc1.setLocalDescription' ) ;
1492
- return pc2 . setRemoteDescription ( pc1 . localDescription ) ;
1493
+ return pc2 . setRemoteDescription ( dictionary ( pc1 . localDescription ) ) ;
1493
1494
} ) . then ( function ( ) {
1494
1495
tc . pass ( 'pc2.setRemoteDescription' ) ;
1495
1496
return pc2 . createAnswer ( ) ;
1496
1497
} ) . then ( function ( answer ) {
1497
1498
tc . pass ( 'pc2.createAnswer' ) ;
1498
- return pc2 . setLocalDescription ( answer ) ;
1499
+ return pc2 . setLocalDescription ( dictionary ( answer ) ) ;
1499
1500
} ) . then ( function ( ) {
1500
1501
tc . pass ( 'pc2.setLocalDescription' ) ;
1501
- return pc1 . setRemoteDescription ( pc2 . localDescription ) ;
1502
+ return pc1 . setRemoteDescription ( dictionary ( pc2 . localDescription ) ) ;
1502
1503
} ) . then ( function ( ) {
1503
1504
tc . pass ( 'pc1.setRemoteDescription' ) ;
1504
1505
} ) . catch ( function ( err ) {
0 commit comments