Index: chrome/test/data/webrtc/peerconnection.js |
diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js |
index 8d0f976963353ddf0b254d52c905ad6451325664..32a7587cc9890dd83b1b5735c3a99c8eefde905f 100644 |
--- a/chrome/test/data/webrtc/peerconnection.js |
+++ b/chrome/test/data/webrtc/peerconnection.js |
@@ -376,7 +376,8 @@ function hasSeenCryptoInSdp() { |
} |
/** |
- * Verifies that |RTCPeerConnection.getStats| returns stats. |
+ * Verifies that the legacy |RTCPeerConnection.getStats| returns stats and |
+ * verifies that each stats member is a string. |
* |
* Returns ok-got-stats on success. |
*/ |
@@ -400,6 +401,22 @@ function verifyStatsGenerated() { |
}); |
} |
+/** |
+ * Measures the performance of the legacy (callback-based) |
+ * |RTCPeerConnection.getStats| and returns the time it took in milliseconds as |
+ * a double (DOMHighResTimeStamp, accurate to one thousandth of a millisecond). |
+ * |
+ * Returns "ok-" followed by a double. |
+ */ |
+function measureGetStatsCallbackPerformance() { |
+ let t0 = performance.now(); |
+ peerConnection_().getStats( |
+ function(response) { |
+ let t1 = performance.now(); |
+ returnToTest('ok-' + (t1 - t0)); |
+ }); |
+} |
+ |
// Internals. |
/** @private */ |