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

Unified Diff: content/child/webcrypto/test/ecdh_unittest.cc

Issue 816403002: [WebCrypto] Cleanup in LoadTestKeys() in ecdh unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | content/test/data/webcrypto/ecdh.json » ('j') | content/test/data/webcrypto/ecdh.json » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | content/test/data/webcrypto/ecdh.json » ('j') | content/test/data/webcrypto/ecdh.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698