| 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/core/quic_client_promised_info.h" | 5 #include "net/quic/core/quic_client_promised_info.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "net/quic/core/spdy_utils.h" | 10 #include "net/quic/core/spdy_utils.h" |
| 11 #include "net/quic/platform/api/quic_logging.h" | 11 #include "net/quic/platform/api/quic_logging.h" |
| 12 #include "net/quic/platform/api/quic_socket_address.h" | 12 #include "net/quic/platform/api/quic_socket_address.h" |
| 13 #include "net/quic/platform/api/quic_test.h" |
| 13 #include "net/quic/test_tools/crypto_test_utils.h" | 14 #include "net/quic/test_tools/crypto_test_utils.h" |
| 14 #include "net/quic/test_tools/quic_client_promised_info_peer.h" | 15 #include "net/quic/test_tools/quic_client_promised_info_peer.h" |
| 15 #include "net/test/gtest_util.h" | 16 #include "net/test/gtest_util.h" |
| 16 #include "net/tools/quic/quic_client_session.h" | 17 #include "net/tools/quic/quic_client_session.h" |
| 17 | 18 |
| 18 using std::string; | 19 using std::string; |
| 19 using testing::StrictMock; | 20 using testing::StrictMock; |
| 20 | 21 |
| 21 namespace net { | 22 namespace net { |
| 22 namespace test { | 23 namespace test { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 MOCK_METHOD1(CloseStream, void(QuicStreamId stream_id)); | 44 MOCK_METHOD1(CloseStream, void(QuicStreamId stream_id)); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 QuicCryptoClientConfig crypto_config_; | 47 QuicCryptoClientConfig crypto_config_; |
| 47 | 48 |
| 48 bool authorized_; | 49 bool authorized_; |
| 49 | 50 |
| 50 DISALLOW_COPY_AND_ASSIGN(MockQuicClientSession); | 51 DISALLOW_COPY_AND_ASSIGN(MockQuicClientSession); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 class QuicClientPromisedInfoTest : public ::testing::Test { | 54 class QuicClientPromisedInfoTest : public QuicTest { |
| 54 public: | 55 public: |
| 55 class StreamVisitor; | 56 class StreamVisitor; |
| 56 | 57 |
| 57 QuicClientPromisedInfoTest() | 58 QuicClientPromisedInfoTest() |
| 58 : connection_(new StrictMock<MockQuicConnection>(&helper_, | 59 : connection_(new StrictMock<MockQuicConnection>(&helper_, |
| 59 &alarm_factory_, | 60 &alarm_factory_, |
| 60 Perspective::IS_CLIENT)), | 61 Perspective::IS_CLIENT)), |
| 61 session_(connection_, &push_promise_index_), | 62 session_(connection_, &push_promise_index_), |
| 62 body_("hello world"), | 63 body_("hello world"), |
| 63 promise_id_(kServerDataStreamId1) { | 64 promise_id_(kServerDataStreamId1) { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 EXPECT_FALSE(delegate.rendezvous_fired()); | 305 EXPECT_FALSE(delegate.rendezvous_fired()); |
| 305 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); | 306 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); |
| 306 | 307 |
| 307 // Promise is gone | 308 // Promise is gone |
| 308 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); | 309 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); |
| 309 } | 310 } |
| 310 | 311 |
| 311 } // namespace | 312 } // namespace |
| 312 } // namespace test | 313 } // namespace test |
| 313 } // namespace net | 314 } // namespace net |
| OLD | NEW |