| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright 2017 The Chromium Authors. All rights reserved. | 2 * Copyright 2017 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 // Public interface to tests. These are expected to be called with | 7 // Public interface to tests. These are expected to be called with |
| 8 // ExecuteJavascript invocations from the browser tests and will return answers | 8 // ExecuteJavascript invocations from the browser tests and will return answers |
| 9 // through the DOM automation controller. | 9 // through the DOM automation controller. |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (peerConnection_().getReceivers().length != remoteTracks.size) | 57 if (peerConnection_().getReceivers().length != remoteTracks.size) |
| 58 throw failTest('The number of receivers and tracks are not the same.'); | 58 throw failTest('The number of receivers and tracks are not the same.'); |
| 59 | 59 |
| 60 let receivers = new Set(); | 60 let receivers = new Set(); |
| 61 let receiverTracks = new Set(); | 61 let receiverTracks = new Set(); |
| 62 peerConnection_().getReceivers().forEach(function(receiver) { | 62 peerConnection_().getReceivers().forEach(function(receiver) { |
| 63 if (receiver == null) | 63 if (receiver == null) |
| 64 throw failTest('receiver is null or undefined.'); | 64 throw failTest('receiver is null or undefined.'); |
| 65 if (receiver.track == null) | 65 if (receiver.track == null) |
| 66 throw failTest('receiver.track is null or undefined.'); | 66 throw failTest('receiver.track is null or undefined.'); |
| 67 if (receiver.getContributingSources().length != 0) |
| 68 throw failTest('receiver.getContributingSources() is not empty.'); |
| 67 receivers.add(receiver); | 69 receivers.add(receiver); |
| 68 receiverTracks.add(receiver.track); | 70 receiverTracks.add(receiver.track); |
| 69 }); | 71 }); |
| 70 if (receiverTracks.size != receivers.size) | 72 if (receiverTracks.size != receivers.size) |
| 71 throw failTest('receiverTracks.size != receivers.size'); | 73 throw failTest('receiverTracks.size != receivers.size'); |
| 72 | 74 |
| 73 if (!setEquals_(receiverTracks, remoteTracks)) { | 75 if (!setEquals_(receiverTracks, remoteTracks)) { |
| 74 throw failTest('The set of receiver tracks is not equal to the set of ' + | 76 throw failTest('The set of receiver tracks is not equal to the set of ' + |
| 75 'stream tracks.'); | 77 'stream tracks.'); |
| 76 } | 78 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 if (a == null) | 99 if (a == null) |
| 98 return b == null; | 100 return b == null; |
| 99 if (a.size != b.size) | 101 if (a.size != b.size) |
| 100 return false; | 102 return false; |
| 101 a.forEach(function(value) { | 103 a.forEach(function(value) { |
| 102 if (!b.has(value)) | 104 if (!b.has(value)) |
| 103 return false; | 105 return false; |
| 104 }); | 106 }); |
| 105 return true; | 107 return true; |
| 106 } | 108 } |
| OLD | NEW |