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 | 4 |
5 #include "components/proximity_auth/cryptauth/fake_secure_message_delegate.h" | 5 #include "components/proximity_auth/cryptauth/fake_secure_message_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 | 10 |
10 namespace proximity_auth { | 11 namespace proximity_auth { |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 const char kTestPublicKey[] = "the private key is in another castle"; | 15 const char kTestPublicKey[] = "the private key is in another castle"; |
15 const char kPayload[] = "500 tons of uranium"; | 16 const char kPayload[] = "500 tons of uranium"; |
16 const char kSymmetricKey[] = "hunter2"; | 17 const char kSymmetricKey[] = "hunter2"; |
17 const char kPublicMetadata[] = "brought to you by our sponsors"; | 18 const char kPublicMetadata[] = "brought to you by our sponsors"; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 TEST_F(ProximityAuthFakeSecureMessageDelegateTest, GetPrivateKeyForPublicKey) { | 197 TEST_F(ProximityAuthFakeSecureMessageDelegateTest, GetPrivateKeyForPublicKey) { |
197 delegate_.set_next_public_key(kTestPublicKey); | 198 delegate_.set_next_public_key(kTestPublicKey); |
198 std::string public_key, private_key; | 199 std::string public_key, private_key; |
199 delegate_.GenerateKeyPair( | 200 delegate_.GenerateKeyPair( |
200 base::Bind(&SaveKeyPair, &public_key, &private_key)); | 201 base::Bind(&SaveKeyPair, &public_key, &private_key)); |
201 EXPECT_EQ(kTestPublicKey, public_key); | 202 EXPECT_EQ(kTestPublicKey, public_key); |
202 EXPECT_EQ(private_key, delegate_.GetPrivateKeyForPublicKey(kTestPublicKey)); | 203 EXPECT_EQ(private_key, delegate_.GetPrivateKeyForPublicKey(kTestPublicKey)); |
203 } | 204 } |
204 | 205 |
205 } // proximity_auth | 206 } // proximity_auth |
OLD | NEW |