OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "net/quic/crypto/aes_128_gcm_encrypter.h" | 8 #include "net/quic/crypto/aes_128_gcm_encrypter.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
11 #include "net/quic/test_tools/crypto_test_utils.h" | 11 #include "net/quic/test_tools/crypto_test_utils.h" |
12 #include "net/quic/test_tools/quic_test_utils.h" | 12 #include "net/quic/test_tools/quic_test_utils.h" |
13 #include "net/quic/test_tools/simple_quic_framer.h" | 13 #include "net/quic/test_tools/simple_quic_framer.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 namespace test { | 18 namespace test { |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char kServerHostname[] = "localhost"; | 21 const char kServerHostname[] = "localhost"; |
22 | 22 |
23 class TestQuicVisitor : public NoOpFramerVisitor { | 23 class TestQuicVisitor : public NoOpFramerVisitor { |
24 public: | 24 public: |
25 TestQuicVisitor() | 25 TestQuicVisitor() |
26 : frame_valid_(false) { | 26 : frame_valid_(false) { |
27 } | 27 } |
28 | 28 |
29 // NoOpFramerVisitor | 29 // NoOpFramerVisitor |
30 virtual void OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { | 30 virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { |
31 frame_ = frame; | 31 frame_ = frame; |
32 frame_valid_ = true; | 32 frame_valid_ = true; |
| 33 return true; |
33 } | 34 } |
34 | 35 |
35 bool frame_valid() const { | 36 bool frame_valid() const { |
36 return frame_valid_; | 37 return frame_valid_; |
37 } | 38 } |
38 QuicStreamFrame* frame() { return &frame_; } | 39 QuicStreamFrame* frame() { return &frame_; } |
39 | 40 |
40 private: | 41 private: |
41 QuicStreamFrame frame_; | 42 QuicStreamFrame frame_; |
42 bool frame_valid_; | 43 bool frame_valid_; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 157 |
157 const QuicCryptoNegotiatedParameters& crypto_params( | 158 const QuicCryptoNegotiatedParameters& crypto_params( |
158 stream_.crypto_negotiated_params()); | 159 stream_.crypto_negotiated_params()); |
159 EXPECT_EQ(kAESG, crypto_params.aead); | 160 EXPECT_EQ(kAESG, crypto_params.aead); |
160 EXPECT_EQ(kC255, crypto_params.key_exchange); | 161 EXPECT_EQ(kC255, crypto_params.key_exchange); |
161 } | 162 } |
162 | 163 |
163 } // namespace | 164 } // namespace |
164 } // namespace test | 165 } // namespace test |
165 } // namespace net | 166 } // namespace net |
OLD | NEW |