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

Unified Diff: chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js

Issue 323093003: Add the Sign-At-Most-Once restriction the enterprise.platformKeys API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 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
Index: chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
diff --git a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
index 557ae680c4cf2d22d441f75f4426449e1c7d161d..c05e002a480ffc34c656817ec277cdbeb29e735e 100644
--- a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
+++ b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
@@ -327,10 +327,22 @@ function runTests(userToken) {
})
.then(callbackPass(function(success) {
assertEq(true, success, "Signature invalid.");
+ // Try to sign data with the same key a second time, which
+ // must fail.
+ return userToken.subtleCrypto.sign(
+ {}, cachedKeyPair.privateKey, data);
}),
function(error) {
assertTrue(false, "Verification failed: " + error);
- });
+ })
+ .then(function(signature) {
+ assertTrue(false, "Second sign call was expected to fail.");
+ }, callbackPass(function(error) {
+ assertTrue(error instanceof Error);
+ assertEq(
+ 'The operation failed for an operation-specific reason',
+ error.message);
+ }));
},
// Imports and removes certificates for privateKeyPkcs8, which was imported

Powered by Google App Engine
This is Rietveld 408576698