OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_client_push_promise_index.h" | 5 #include "net/quic/quic_client_push_promise_index.h" |
6 | 6 |
7 #include "net/quic/spdy_utils.h" | 7 #include "net/quic/spdy_utils.h" |
8 #include "net/quic/test_tools/crypto_test_utils.h" | 8 #include "net/quic/test_tools/crypto_test_utils.h" |
9 #include "net/quic/test_tools/mock_quic_client_promised_info.h" | 9 #include "net/quic/test_tools/mock_quic_client_promised_info.h" |
10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
11 #include "net/tools/quic/quic_client_session.h" | 11 #include "net/tools/quic/quic_client_session.h" |
12 | 12 |
13 using testing::_; | 13 using testing::_; |
14 using testing::Return; | 14 using testing::Return; |
15 using testing::StrictMock; | 15 using testing::StrictMock; |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 namespace test { | 18 namespace test { |
19 namespace { | 19 namespace { |
20 | 20 |
21 class MockQuicClientSession : public QuicClientSession { | 21 class MockQuicClientSession : public QuicClientSession { |
22 public: | 22 public: |
23 explicit MockQuicClientSession(QuicConnection* connection, | 23 explicit MockQuicClientSession(QuicConnection* connection, |
24 QuicClientPushPromiseIndex* push_promise_index) | 24 QuicClientPushPromiseIndex* push_promise_index) |
25 : QuicClientSession( | 25 : QuicClientSession( |
26 DefaultQuicConfig(), | 26 DefaultQuicConfig(), |
27 connection, | 27 connection, |
28 QuicServerId("example.com", 80, PRIVACY_MODE_DISABLED), | 28 QuicServerId("example.com", 443, PRIVACY_MODE_DISABLED), |
29 &crypto_config_, | 29 &crypto_config_, |
30 push_promise_index), | 30 push_promise_index), |
31 crypto_config_(CryptoTestUtils::ProofVerifierForTesting()) {} | 31 crypto_config_(CryptoTestUtils::ProofVerifierForTesting()) {} |
32 ~MockQuicClientSession() override {} | 32 ~MockQuicClientSession() override {} |
33 | 33 |
34 MOCK_METHOD1(CloseStream, void(QuicStreamId stream_id)); | 34 MOCK_METHOD1(CloseStream, void(QuicStreamId stream_id)); |
35 | 35 |
36 private: | 36 private: |
37 QuicCryptoClientConfig crypto_config_; | 37 QuicCryptoClientConfig crypto_config_; |
38 | 38 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 TEST_F(QuicClientPushPromiseIndexTest, GetPromise) { | 97 TEST_F(QuicClientPushPromiseIndexTest, GetPromise) { |
98 (*index_.promised_by_url())[url_] = &promised_; | 98 (*index_.promised_by_url())[url_] = &promised_; |
99 EXPECT_EQ(index_.GetPromised(url_), &promised_); | 99 EXPECT_EQ(index_.GetPromised(url_), &promised_); |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 } // namespace test | 103 } // namespace test |
104 } // namespace net | 104 } // namespace net |
OLD | NEW |