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

Unified Diff: chrome/test/data/webrtc/indexeddb.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/indexeddb.js
diff --git a/chrome/test/data/webrtc/indexeddb.js b/chrome/test/data/webrtc/indexeddb.js
index 96950c4287d18e24a765ddcc2f50b599e401f7bc..1d7320f4322432a8a91be10bf4d2d70c47eca111 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.fingerprints.length == 0)
+ throw failTest('fingerprints is empty.');
+ for (let i = 0; i < gCertificate.fingerprints.length; ++i) {
+ if (gCertificate.fingerprints[i].algorithm != 'sha-256')
+ throw failTest('Unexpected fingerprint algorithm.');
+ if (gCertificate.fingerprints[i].value.length == 0)
+ throw failTest('Unexpected fingerprint value.');
+ }
cloneCertificate_(gCertificate).then(
function(clone) {
+ let cloneIsEqual = (clone.fingerprints.length ==
+ gCertificate.fingerprints.length);
+ if (cloneIsEqual) {
+ for (let i = 0; i < clone.fingerprints.length; ++i) {
+ if (clone.fingerprints[i].algorithm !=
+ gCertificate.fingerprints[i].algorithm ||
+ clone.fingerprints[i].value !=
+ gCertificate.fingerprints[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() {

Powered by Google App Engine
This is Rietveld 408576698