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

Side by Side Diff: content/renderer/webcrypto_impl_unittest.cc

Issue 23621050: Added WebCypto digest OpenSSL implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for openssl, #ifdef disable all tests except digest Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webcrypto_impl.h" 5 #include "webcrypto_impl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // Ignore case, it's checking the hex value. 118 // Ignore case, it's checking the hex value.
119 EXPECT_STRCASEEQ( 119 EXPECT_STRCASEEQ(
120 input_set[set_index].hex_result[id_index], 120 input_set[set_index].hex_result[id_index],
121 base::HexEncode( 121 base::HexEncode(
122 array_buffer.data(), array_buffer.byteLength()).c_str()); 122 array_buffer.data(), array_buffer.byteLength()).c_str());
123 } 123 }
124 } 124 }
125 } 125 }
126 126
127 // TODO(padolph) Enable these tests for OpenSSL once matching impl is available
128 #if !defined(USE_OPENSSL)
129
127 TEST_F(WebCryptoImplTest, HMACSampleSets) { 130 TEST_F(WebCryptoImplTest, HMACSampleSets) {
128 struct { 131 struct {
129 WebKit::WebCryptoAlgorithmId algorithm; 132 WebKit::WebCryptoAlgorithmId algorithm;
130 const char* key; 133 const char* key;
131 const char* message; 134 const char* message;
132 const char* mac; 135 const char* mac;
133 } input_set[] = { 136 } input_set[] = {
134 // Empty sets. Result generated via OpenSSL commandline tool. These 137 // Empty sets. Result generated via OpenSSL commandline tool. These
135 // particular results are also posted on the Wikipedia page examples: 138 // particular results are also posted on the Wikipedia page examples:
136 // http://en.wikipedia.org/wiki/Hash-based_message_authentication_code 139 // http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 &array_buffer)); 270 &array_buffer));
268 271
269 // Ignore case, it's checking the hex value. 272 // Ignore case, it's checking the hex value.
270 EXPECT_STRCASEEQ( 273 EXPECT_STRCASEEQ(
271 input_set[index].mac, 274 input_set[index].mac,
272 base::HexEncode( 275 base::HexEncode(
273 array_buffer.data(), array_buffer.byteLength()).c_str()); 276 array_buffer.data(), array_buffer.byteLength()).c_str());
274 } 277 }
275 } 278 }
276 279
280 #endif // #if !defined(USE_OPENSSL)
281
277 } // namespace content 282 } // namespace content
OLDNEW
« content/renderer/webcrypto_impl_openssl.cc ('K') | « content/renderer/webcrypto_impl_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698