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

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

Issue 2828563002: RTCCertificate.getFingerprints added (exposed to the web) (Closed)
Patch Set: Rebase Created 3 years, 6 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
« no previous file with comments | « chrome/test/data/webrtc/indexeddb.js ('k') | content/renderer/media/rtc_certificate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..22963b43f09fcf0a8b429b9be8a976bd40c1152b 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -245,6 +245,30 @@ function verifyDefaultCodecs(sessionDescJson) {
returnToTest('ok-verified');
}
+/**
+ * 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.getFingerprints().length; ++i) {
+ let fingerprintSdp = 'a=fingerprint:' +
+ certificate.getFingerprints()[i].algorithm + ' ' +
+ certificate.getFingerprints()[i].value.toUpperCase();
+ 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
« no previous file with comments | « chrome/test/data/webrtc/indexeddb.js ('k') | content/renderer/media/rtc_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698