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

Side by Side Diff: content/child/webcrypto/shared_crypto_unittest.cc

Issue 343473004: [webcrypto] Give more descriptive error messages on Linux for unsupported functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test expectation for new error message Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/platform_crypto_nss.cc ('k') | content/child/webcrypto/status.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/webcrypto/shared_crypto.h" 5 #include "content/child/webcrypto/shared_crypto.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 blink::WebCryptoKey key = blink::WebCryptoKey::createNull(); 108 blink::WebCryptoKey key = blink::WebCryptoKey::createNull();
109 Status status = ImportKey(blink::WebCryptoKeyFormatRaw, 109 Status status = ImportKey(blink::WebCryptoKeyFormatRaw,
110 CryptoData(key_raw), 110 CryptoData(key_raw),
111 CreateAlgorithm(blink::WebCryptoAlgorithmIdAesGcm), 111 CreateAlgorithm(blink::WebCryptoAlgorithmIdAesGcm),
112 true, 112 true,
113 blink::WebCryptoKeyUsageEncrypt, 113 blink::WebCryptoKeyUsageEncrypt,
114 &key); 114 &key);
115 115
116 if (status.IsError()) 116 if (status.IsError())
117 EXPECT_EQ(Status::ErrorUnsupported(), status); 117 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type());
118 return status.IsSuccess(); 118 return status.IsSuccess();
119 } 119 }
120 120
121 bool SupportsRsaOaep() { 121 bool SupportsRsaOaep() {
122 #if defined(USE_OPENSSL) 122 #if defined(USE_OPENSSL)
123 return false; 123 return false;
124 #else 124 #else
125 #if defined(USE_NSS) 125 #if defined(USE_NSS)
126 if (!NSS_VersionCheck("3.16.2")) 126 if (!NSS_VersionCheck("3.16.2"))
127 return false; 127 return false;
(...skipping 4189 matching lines...) Expand 10 before | Expand all | Expand 10 after
4317 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); 4317 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki);
4318 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); 4318 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8);
4319 4319
4320 EXPECT_NE(public_key_spki, wrapped_public_key); 4320 EXPECT_NE(public_key_spki, wrapped_public_key);
4321 EXPECT_NE(private_key_pkcs8, wrapped_private_key); 4321 EXPECT_NE(private_key_pkcs8, wrapped_private_key);
4322 } 4322 }
4323 4323
4324 } // namespace webcrypto 4324 } // namespace webcrypto
4325 4325
4326 } // namespace content 4326 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/platform_crypto_nss.cc ('k') | content/child/webcrypto/status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698