Index: content/child/webcrypto/test/hmac_unittest.cc |
diff --git a/content/child/webcrypto/test/hmac_unittest.cc b/content/child/webcrypto/test/hmac_unittest.cc |
index 61fc5dc2fad0c45cecedb15d49b7b4537f226536..6bcba414642e91c35d1952118068c68e0b72942e 100644 |
--- a/content/child/webcrypto/test/hmac_unittest.cc |
+++ b/content/child/webcrypto/test/hmac_unittest.cc |
@@ -425,11 +425,6 @@ TEST(WebCryptoHmacTest, ImportExportJwk) { |
ImportExportJwkSymmetricKey( |
512, CreateHmacImportAlgorithm(blink::WebCryptoAlgorithmIdSha512), |
blink::WebCryptoKeyUsageVerify, "HS512"); |
- |
- // Zero usage value |
- ImportExportJwkSymmetricKey( |
- 512, CreateHmacImportAlgorithm(blink::WebCryptoAlgorithmIdSha512), 0, |
- "HS512"); |
} |
TEST(WebCryptoHmacTest, ExportJwkEmptyKey) { |
@@ -480,6 +475,17 @@ TEST(WebCryptoHmacTest, ImportRawKeyTooLarge) { |
true, blink::WebCryptoKeyUsageSign, &key)); |
} |
+TEST(WebCryptoHmacTest, ImportKeyEmptyUsage) { |
+ blink::WebCryptoKey key; |
+ std::string key_raw_hex_in = "025a8cf3f08b4f6c5f33bbc76a471939"; |
+ EXPECT_EQ( |
+ Status::ErrorImportKeyEmptyUsages(), |
+ ImportKey(blink::WebCryptoKeyFormatRaw, |
+ CryptoData(HexStringToBytes(key_raw_hex_in)), |
+ CreateHmacImportAlgorithm(blink::WebCryptoAlgorithmIdSha1), |
+ true, 0, &key)); |
+} |
+ |
} // namespace |
} // namespace webcrypto |