| Index: components/webcrypto/algorithms/hmac_unittest.cc
|
| diff --git a/components/webcrypto/algorithms/hmac_unittest.cc b/components/webcrypto/algorithms/hmac_unittest.cc
|
| index fe5b331323e2d0484e5b942c4923491a7eee7b50..a57cdd825be9103af27456fc97fdcc53dae7a3c3 100644
|
| --- a/components/webcrypto/algorithms/hmac_unittest.cc
|
| +++ b/components/webcrypto/algorithms/hmac_unittest.cc
|
| @@ -6,7 +6,10 @@
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| +#include <utility>
|
| +
|
| #include "base/logging.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/values.h"
|
| #include "components/webcrypto/algorithm_dispatch.h"
|
| #include "components/webcrypto/algorithms/test_helpers.h"
|
| @@ -228,8 +231,8 @@ TEST_F(WebCryptoHmacTest, ImportKeyJwkKeyOpsSignVerify) {
|
| base::DictionaryValue dict;
|
| dict.SetString("kty", "oct");
|
| dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
|
| - base::ListValue* key_ops = new base::ListValue;
|
| - dict.Set("key_ops", key_ops); // Takes ownership.
|
| + base::ListValue* key_ops =
|
| + dict.SetList("key_ops", base::MakeUnique<base::ListValue>());
|
|
|
| key_ops->AppendString("sign");
|
|
|
| @@ -258,14 +261,14 @@ TEST_F(WebCryptoHmacTest, ImportKeyJwkUseInconsisteWithKeyOps) {
|
| base::DictionaryValue dict;
|
| dict.SetString("kty", "oct");
|
| dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
|
| - base::ListValue* key_ops = new base::ListValue;
|
| - dict.Set("key_ops", key_ops); // Takes ownership.
|
| -
|
| dict.SetString("alg", "HS256");
|
| dict.SetString("use", "sig");
|
| +
|
| + auto key_ops = base::MakeUnique<base::ListValue>();
|
| key_ops->AppendString("sign");
|
| key_ops->AppendString("verify");
|
| key_ops->AppendString("encrypt");
|
| + dict.Set("key_ops", std::move(key_ops));
|
| EXPECT_EQ(
|
| Status::ErrorJwkUseAndKeyopsInconsistent(),
|
| ImportKeyJwkFromDict(
|
|
|