Chromium Code Reviews| Index: chrome/test/data/webrtc/peerconnection.js |
| diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js |
| index 639e0f41a8ff34624bc5be8ea6fed1aeb640b757..354409365365b5a5a35bb20f6b2d9913b466be40 100644 |
| --- a/chrome/test/data/webrtc/peerconnection.js |
| +++ b/chrome/test/data/webrtc/peerconnection.js |
| @@ -289,6 +289,31 @@ function hasSeenCryptoInSdp() { |
| returnToTest(gHasSeenCryptoInSdp); |
| } |
| +/** |
| + * Verifies that |RTCPeerConnection.getStats| returns stats. |
| + * |
| + * Returns ok-got-stats on success. |
| + */ |
| +function verifyStatsGenerated() { |
| + peerConnection_().getStats( |
| + function(response) { |
| + var reports = response.result(); |
| + var numStats = 0; |
| + for (var i = 0; i < reports.length; i++) { |
| + var statNames = reports[i].names(); |
| + numStats += statNames.length; |
| + for (var j = 0; j < statNames.length; j++) { |
| + var statValue = reports[i].stat(statNames[j]); |
| + if (typeof statValue !== 'string') |
|
tommi (sloooow) - chröme
2016/07/27 18:38:40
!= should be enough. !== is used to do equality+t
hbos_chromium
2016/07/28 08:27:45
Done.
|
| + throw failTest('A stat was returned that is not a string.'); |
| + } |
| + } |
| + if (numStats === 0) |
| + throw failTest('No stats was returned by getStats.'); |
| + returnToTest('ok-got-stats'); |
| + }); |
| +} |
| + |
| // Internals. |
| /** @private */ |