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

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

Issue 2828563002: RTCCertificate.getFingerprints added (exposed to the web) (Closed)
Patch Set: Created 3 years, 8 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 d236dc51303ae40b6170ca66954d0e2ebea9c268..70c0a2f45e85403d303ec04926dddd0bcae68f0d 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -246,6 +246,30 @@ function verifyDefaultCodecs(sessionDescJson) {
}
/**
+ * Verifies that the peer connection's local description contains one of
+ * |certificate|'s fingerprints.
+ *
+ * Returns 'ok-verified' on success.
+ */
+function verifyLocalDescriptionContainsCertificate(certificate) {
+ let localDescription = peerConnection_().localDescription;
+ if (localDescription == null)
+ throw failTest('localDescription is null.');
+ for (let i = 0; i < certificate.fingerprints.length; ++i) {
+ let fingerprintSdp = 'a=fingerprint:' +
+ certificate.fingerprints[i].algorithm + ' ' +
+ certificate.fingerprints[i].value;
+ if (localDescription.sdp.includes(fingerprintSdp)) {
+ returnToTest('ok-verified');
+ return;
+ }
+ }
+ if (!localDescription.sdp.includes('a=fingerprint'))
+ throw failTest('localDescription does not contain any fingerprints.');
+ throw failTest('Certificate fingerprint not found in localDescription.');
+}
+
+/**
* Asks this page to accept an answer generated by the peer in response to a
* previous offer by this page
*

Powered by Google App Engine
This is Rietveld 408576698