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

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

Issue 2186853002: WebRTCStats added, retaining type info when surfacing WebRTC stats into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed tommi's comments Created 4 years, 5 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 639e0f41a8ff34624bc5be8ea6fed1aeb640b757..927e7f48a9e7f1100d6f436abf61d7fb684dd48c 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')
+ 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 */
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.cc ('k') | components/test_runner/mock_webrtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698