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

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: Rebased. 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
« no previous file with comments | « chrome/chrome_browser_chromeos.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b095e9eecf2be211bf1c5ba8053b0952aa78312c..e4f8995832145c08fb40f37dad4ea431bc7cb9ce 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
@@ -337,10 +337,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
« no previous file with comments | « chrome/chrome_browser_chromeos.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698