Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: chrome/test/data/webrtc/peerconnection.js

Issue 2641263003: Performance measures of old and new RTCPeerConnection.getStats added. (Closed)
Patch Set: Avoiding win uninitialized variable warning Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 */

Powered by Google App Engine
This is Rietveld 408576698