Chromium Code Reviews

Side by Side Diff: chrome/test/data/webrtc/peerconnection_getstats.js

Issue 2621733004: RTCPeerConnection.getStats whitelist updated due to recent spec changes. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright 2016 The Chromium Authors. All rights reserved. 2 * Copyright 2016 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 /** 7 /**
8 * Maps "RTCStats.type" values to descriptions of whitelisted (allowed to be 8 * Maps "RTCStats.type" values to descriptions of whitelisted (allowed to be
9 * exposed to the web) RTCStats-derived dictionaries described below. 9 * exposed to the web) RTCStats-derived dictionaries described below.
10 * @private 10 * @private
11 */ 11 */
12 var gStatsWhitelist = new Map(); 12 var gStatsWhitelist = new Map();
13 13
14 /** 14 /**
15 * RTCRTPStreamStats 15 * RTCRTPStreamStats
16 * https://w3c.github.io/webrtc-stats/#streamstats-dict* 16 * https://w3c.github.io/webrtc-stats/#streamstats-dict*
17 * @private 17 * @private
18 */ 18 */
19 var kRTCRTPStreamStats = new RTCStats_(null, { 19 var kRTCRTPStreamStats = new RTCStats_(null, {
20 ssrc: 'string', 20 ssrc: 'string',
21 associateStatsId: 'string', 21 associateStatsId: 'string',
22 isRemote: 'boolean', 22 isRemote: 'boolean',
23 mediaType: 'string', 23 mediaType: 'string',
24 trackId: 'string',
25 // TODO(hbos): As soon as |mediaTrackId| has been renamed to |trackId|, remove
26 // this line. crbug.com/657854
24 mediaTrackId: 'string', 27 mediaTrackId: 'string',
25 transportId: 'string', 28 transportId: 'string',
26 codecId: 'string', 29 codecId: 'string',
27 firCount: 'number', 30 firCount: 'number',
28 pliCount: 'number', 31 pliCount: 'number',
29 nackCount: 'number', 32 nackCount: 'number',
30 sliCount: 'number', 33 sliCount: 'number',
31 qpSum: 'number', 34 qpSum: 'number',
32 }); 35 });
33 36
(...skipping 50 matching lines...)
84 framesEncoded: 'number', 87 framesEncoded: 'number',
85 }); 88 });
86 gStatsWhitelist.set('outbound-rtp', kRTCOutboundRTPStreamStats); 89 gStatsWhitelist.set('outbound-rtp', kRTCOutboundRTPStreamStats);
87 90
88 /* 91 /*
89 * RTCPeerConnectionStats 92 * RTCPeerConnectionStats
90 * https://w3c.github.io/webrtc-stats/#pcstats-dict* 93 * https://w3c.github.io/webrtc-stats/#pcstats-dict*
91 * @private 94 * @private
92 */ 95 */
93 var kRTCPeerConnectionStats = new RTCStats_(null, { 96 var kRTCPeerConnectionStats = new RTCStats_(null, {
97 dataChannelsCreated: 'number',
94 dataChannelsOpened: 'number', 98 dataChannelsOpened: 'number',
99 dataChannelsAccepted: 'number',
95 dataChannelsClosed: 'number', 100 dataChannelsClosed: 'number',
101 dataChannelsSignaledClosed: 'number',
hbos_chromium 2017/01/10 14:56:58 Note spelling of "signaled". Are the discussions o
hbos_chromium 2017/01/11 11:10:15 Nevermind, spec changed and I updated this accordi
96 }); 102 });
97 gStatsWhitelist.set('peer-connection', kRTCPeerConnectionStats); 103 gStatsWhitelist.set('peer-connection', kRTCPeerConnectionStats);
98 104
99 /* 105 /*
100 * RTCMediaStreamStats 106 * RTCMediaStreamStats
101 * https://w3c.github.io/webrtc-stats/#msstats-dict* 107 * https://w3c.github.io/webrtc-stats/#msstats-dict*
102 * @private 108 * @private
103 */ 109 */
104 var kRTCMediaStreamStats = new RTCStats_(null, { 110 var kRTCMediaStreamStats = new RTCStats_(null, {
105 streamIdentifier: 'string', 111 streamIdentifier: 'string',
106 trackIds: 'sequence_string', 112 trackIds: 'sequence_string',
107 }); 113 });
108 gStatsWhitelist.set('stream', kRTCMediaStreamStats); 114 gStatsWhitelist.set('stream', kRTCMediaStreamStats);
109 115
110 /* 116 /*
111 * RTCMediaStreamTrackStats 117 * RTCMediaStreamTrackStats
112 * https://w3c.github.io/webrtc-stats/#mststats-dict* 118 * https://w3c.github.io/webrtc-stats/#mststats-dict*
113 * @private 119 * @private
114 */ 120 */
115 var kRTCMediaStreamTrackStats = new RTCStats_(null, { 121 var kRTCMediaStreamTrackStats = new RTCStats_(null, {
116 trackIdentifier: 'string', 122 trackIdentifier: 'string',
117 remoteSource: 'boolean', 123 remoteSource: 'boolean',
118 ended: 'boolean', 124 ended: 'boolean',
119 detached: 'boolean', 125 detached: 'boolean',
126 kind: 'string',
127 // TODO(hbos): As soon as |ssrcIds| has been removed, remove this line.
128 // crbug.com/659137
120 ssrcIds: 'sequence_string', 129 ssrcIds: 'sequence_string',
121 frameWidth: 'number', 130 frameWidth: 'number',
122 frameHeight: 'number', 131 frameHeight: 'number',
123 framesPerSecond: 'number', 132 framesPerSecond: 'number',
124 framesSent: 'number', 133 framesSent: 'number',
125 framesReceived: 'number', 134 framesReceived: 'number',
126 framesDecoded: 'number', 135 framesDecoded: 'number',
127 framesDropped: 'number', 136 framesDropped: 'number',
128 framesCorrupted: 'number', 137 framesCorrupted: 'number',
129 partialFramesLost: 'number', 138 partialFramesLost: 'number',
(...skipping 23 matching lines...)
153 162
154 /* 163 /*
155 * RTCTransportStats 164 * RTCTransportStats
156 * https://w3c.github.io/webrtc-stats/#transportstats-dict* 165 * https://w3c.github.io/webrtc-stats/#transportstats-dict*
157 * @private 166 * @private
158 */ 167 */
159 var kRTCTransportStats = new RTCStats_(null, { 168 var kRTCTransportStats = new RTCStats_(null, {
160 bytesSent: 'number', 169 bytesSent: 'number',
161 bytesReceived: 'number', 170 bytesReceived: 'number',
162 rtcpTransportStatsId: 'string', 171 rtcpTransportStatsId: 'string',
172 dtlsState: 'string',
173 // TODO(hbos): As soon as |activeConnection| has been replaced by |dtlsState|,
174 // remove this line. crbug.com/653873
163 activeConnection: 'boolean', 175 activeConnection: 'boolean',
164 selectedCandidatePairId: 'string', 176 selectedCandidatePairId: 'string',
165 localCertificateId: 'string', 177 localCertificateId: 'string',
166 remoteCertificateId: 'string', 178 remoteCertificateId: 'string',
167 }); 179 });
168 gStatsWhitelist.set('transport', kRTCTransportStats); 180 gStatsWhitelist.set('transport', kRTCTransportStats);
169 181
170 /* 182 /*
171 * RTCIceCandidateStats 183 * RTCIceCandidateStats
172 * https://w3c.github.io/webrtc-stats/#icecandidate-dict* 184 * https://w3c.github.io/webrtc-stats/#icecandidate-dict*
(...skipping 184 matching lines...)
357 if (typeof(element) !== elementType) { 369 if (typeof(element) !== elementType) {
358 throw failTest('stats.' + propertyName + ' should have a different ' + 370 throw failTest('stats.' + propertyName + ' should have a different ' +
359 'type according to the whitelist (an element of the array has ' + 371 'type according to the whitelist (an element of the array has ' +
360 'the incorrect type): ' + JSON.stringify(stats[propertyName]) + 372 'the incorrect type): ' + JSON.stringify(stats[propertyName]) +
361 ' vs ' + whitelistedStats[propertyName]); 373 ' vs ' + whitelistedStats[propertyName]);
362 } 374 }
363 } 375 }
364 } 376 }
365 } 377 }
366 } 378 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine