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.'); | |
69 receivers.add(receiver); | 67 receivers.add(receiver); |
70 receiverTracks.add(receiver.track); | 68 receiverTracks.add(receiver.track); |
71 }); | 69 }); |
72 if (receiverTracks.size != receivers.size) | 70 if (receiverTracks.size != receivers.size) |
73 throw failTest('receiverTracks.size != receivers.size'); | 71 throw failTest('receiverTracks.size != receivers.size'); |
74 | 72 |
75 if (!setEquals_(receiverTracks, remoteTracks)) { | 73 if (!setEquals_(receiverTracks, remoteTracks)) { |
76 throw failTest('The set of receiver tracks is not equal to the set of ' + | 74 throw failTest('The set of receiver tracks is not equal to the set of ' + |
77 'stream tracks.'); | 75 'stream tracks.'); |
78 } | 76 } |
(...skipping 20 matching lines...) Expand all Loading... |
99 if (a == null) | 97 if (a == null) |
100 return b == null; | 98 return b == null; |
101 if (a.size != b.size) | 99 if (a.size != b.size) |
102 return false; | 100 return false; |
103 a.forEach(function(value) { | 101 a.forEach(function(value) { |
104 if (!b.has(value)) | 102 if (!b.has(value)) |
105 return false; | 103 return false; |
106 }); | 104 }); |
107 return true; | 105 return true; |
108 } | 106 } |
OLD | NEW |