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

Unified Diff: chrome/test/data/webrtc/indexeddb.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/browser/media/webrtc/webrtc_browsertest_base.cc ('k') | chrome/test/data/webrtc/peerconnection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/indexeddb.js
diff --git a/chrome/test/data/webrtc/indexeddb.js b/chrome/test/data/webrtc/indexeddb.js
index 96950c4287d18e24a765ddcc2f50b599e401f7bc..f688c3c68d2ee5acdbeb37d54e9c6a2f128f7769 100644
--- a/chrome/test/data/webrtc/indexeddb.js
+++ b/chrome/test/data/webrtc/indexeddb.js
@@ -77,11 +77,35 @@ function generateAndCloneCertificate(keygenAlgorithm) {
RTCPeerConnection.generateCertificate(keygenAlgorithm).then(
function(certificate) {
gCertificate = certificate;
+ if (gCertificate.getFingerprints().length == 0)
+ throw failTest('getFingerprints() is empty.');
+ for (let i = 0; i < gCertificate.getFingerprints().length; ++i) {
+ if (gCertificate.getFingerprints()[i].algorithm != 'sha-256')
+ throw failTest('Unexpected fingerprint algorithm.');
+ if (gCertificate.getFingerprints()[i].value.length == 0)
+ throw failTest('Unexpected fingerprint value.');
+ }
cloneCertificate_(gCertificate).then(
function(clone) {
+ let cloneIsEqual = (clone.getFingerprints().length ==
+ gCertificate.getFingerprints().length);
+ if (cloneIsEqual) {
+ for (let i = 0; i < clone.getFingerprints().length; ++i) {
+ if (clone.getFingerprints()[i].algorithm !=
+ gCertificate.getFingerprints()[i].algorithm ||
+ clone.getFingerprints()[i].value !=
+ gCertificate.getFingerprints()[i].value) {
+ cloneIsEqual = false;
+ break;
+ }
+ }
+ }
+ if (!cloneIsEqual) {
+ throw failTest('The cloned certificate\'s fingerprints does ' +
+ 'not match the original certificate.');
+ }
+
gCertificateClone = clone;
- // TODO(hbos): Verify that |gCertificate| is value-equal to
- // |gCertificateClone|. crbug.com/609108
returnToTest('ok-generated-and-cloned');
},
function() {
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_browsertest_base.cc ('k') | chrome/test/data/webrtc/peerconnection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698