OLD | NEW |
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 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" | 4 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
ypto.h" |
5 | 5 |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 public_key, plain, &encrypted_output)); | 222 public_key, plain, &encrypted_output)); |
223 | 223 |
224 // Checking graceful fail for too much data to encrypt. | 224 // Checking graceful fail for too much data to encrypt. |
225 EXPECT_FALSE(networking_private_crypto::EncryptByteString( | 225 EXPECT_FALSE(networking_private_crypto::EncryptByteString( |
226 public_key, std::string(500, 'x'), &encrypted_output)); | 226 public_key, std::string(500, 'x'), &encrypted_output)); |
227 | 227 |
228 // Checking graceful fail for a bad key format. | 228 // Checking graceful fail for a bad key format. |
229 EXPECT_FALSE(networking_private_crypto::EncryptByteString( | 229 EXPECT_FALSE(networking_private_crypto::EncryptByteString( |
230 kBadKeyData, kTestData, &encrypted_output)); | 230 kBadKeyData, kTestData, &encrypted_output)); |
231 } | 231 } |
OLD | NEW |