OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/quic/core/crypto/crypto_secret_boxer.h" | 5 #include "net/quic/core/crypto/crypto_secret_boxer.h" |
6 | 6 |
7 #include <memory> | |
8 | |
9 #include "net/quic/core/crypto/quic_random.h" | 7 #include "net/quic/core/crypto/quic_random.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
11 | 9 |
12 using base::StringPiece; | 10 using base::StringPiece; |
13 using std::string; | 11 using std::string; |
14 | 12 |
15 namespace net { | 13 namespace net { |
16 namespace test { | 14 namespace test { |
17 | 15 |
18 TEST(CryptoSecretBoxerTest, BoxAndUnbox) { | 16 TEST(CryptoSecretBoxerTest, BoxAndUnbox) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 EXPECT_TRUE(CanDecode(boxer, boxer_12)); | 70 EXPECT_TRUE(CanDecode(boxer, boxer_12)); |
73 | 71 |
74 // After we flush key_11 from |boxer|, it can no longer decode tokens from | 72 // After we flush key_11 from |boxer|, it can no longer decode tokens from |
75 // |boxer_11|. | 73 // |boxer_11|. |
76 boxer.SetKeys({key_12}); | 74 boxer.SetKeys({key_12}); |
77 EXPECT_FALSE(CanDecode(boxer, boxer_11)); | 75 EXPECT_FALSE(CanDecode(boxer, boxer_11)); |
78 } | 76 } |
79 | 77 |
80 } // namespace test | 78 } // namespace test |
81 } // namespace net | 79 } // namespace net |
OLD | NEW |