Chromium Code Reviews| Index: content/child/webcrypto/test/ecdh_unittest.cc |
| diff --git a/content/child/webcrypto/test/ecdh_unittest.cc b/content/child/webcrypto/test/ecdh_unittest.cc |
| index 822013f6cc5058755f5d1c7e73bfbadfa6c3f8d6..dc0f08c557fb97880aeaa38a75a5af9b0923e847 100644 |
| --- a/content/child/webcrypto/test/ecdh_unittest.cc |
| +++ b/content/child/webcrypto/test/ecdh_unittest.cc |
| @@ -128,12 +128,18 @@ TEST(WebCryptoEcdhTest, DeriveBitsKnownAnswer) { |
| // 528 bits. |
| void LoadTestKeys(blink::WebCryptoKey* public_key, |
| blink::WebCryptoKey* private_key) { |
| - // Assume that the 7th key in the test data is for P-521. |
| scoped_ptr<base::ListValue> tests; |
| ASSERT_TRUE(ReadJsonTestFileToList("ecdh.json", &tests)); |
| const base::DictionaryValue* test; |
|
eroman
2014/12/22 17:56:07
This does not handle the case where the property i
Habib Virji
2014/12/23 10:59:05
I have added now, assert failure if it fails to fi
|
| - ASSERT_TRUE(tests->GetDictionary(6, &test)); |
| + for (size_t test_index = 0; test_index < tests->GetSize(); ++test_index) { |
| + SCOPED_TRACE(test_index); |
| + ASSERT_TRUE(tests->GetDictionary(test_index, &test)); |
| + int result = 0; |
| + test->GetInteger("load_p521_test_keys", &result); |
| + if (result) |
| + break; |
| + } |
| ImportKeysFromTest(test, public_key, private_key); |