| 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" | |
| 12 #include "net/quic/platform/api/quic_socket_address.h" | 11 #include "net/quic/platform/api/quic_socket_address.h" |
| 13 #include "net/quic/test_tools/crypto_test_utils.h" | 12 #include "net/quic/test_tools/crypto_test_utils.h" |
| 14 #include "net/quic/test_tools/quic_client_promised_info_peer.h" | 13 #include "net/quic/test_tools/quic_client_promised_info_peer.h" |
| 15 #include "net/test/gtest_util.h" | 14 #include "net/test/gtest_util.h" |
| 16 #include "net/tools/quic/quic_client_session.h" | 15 #include "net/tools/quic/quic_client_session.h" |
| 17 | 16 |
| 18 using std::string; | 17 using std::string; |
| 19 using testing::StrictMock; | 18 using testing::StrictMock; |
| 20 | 19 |
| 21 namespace net { | 20 namespace net { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 push_promise_[":method"] = "GET"; | 75 push_promise_[":method"] = "GET"; |
| 77 push_promise_[":scheme"] = "https"; | 76 push_promise_[":scheme"] = "https"; |
| 78 | 77 |
| 79 promise_url_ = SpdyUtils::GetUrlFromHeaderBlock(push_promise_); | 78 promise_url_ = SpdyUtils::GetUrlFromHeaderBlock(push_promise_); |
| 80 | 79 |
| 81 client_request_ = push_promise_.Clone(); | 80 client_request_ = push_promise_.Clone(); |
| 82 } | 81 } |
| 83 | 82 |
| 84 class StreamVisitor : public QuicSpdyClientStream::Visitor { | 83 class StreamVisitor : public QuicSpdyClientStream::Visitor { |
| 85 void OnClose(QuicSpdyStream* stream) override { | 84 void OnClose(QuicSpdyStream* stream) override { |
| 86 QUIC_DVLOG(1) << "stream " << stream->id(); | 85 DVLOG(1) << "stream " << stream->id(); |
| 87 } | 86 } |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 void ReceivePromise(QuicStreamId id) { | 89 void ReceivePromise(QuicStreamId id) { |
| 91 auto headers = AsHeaderList(push_promise_); | 90 auto headers = AsHeaderList(push_promise_); |
| 92 stream_->OnPromiseHeaderList(id, headers.uncompressed_header_bytes(), | 91 stream_->OnPromiseHeaderList(id, headers.uncompressed_header_bytes(), |
| 93 headers); | 92 headers); |
| 94 } | 93 } |
| 95 | 94 |
| 96 MockQuicConnectionHelper helper_; | 95 MockQuicConnectionHelper helper_; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 EXPECT_FALSE(delegate.rendezvous_fired()); | 303 EXPECT_FALSE(delegate.rendezvous_fired()); |
| 305 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); | 304 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); |
| 306 | 305 |
| 307 // Promise is gone | 306 // Promise is gone |
| 308 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); | 307 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); |
| 309 } | 308 } |
| 310 | 309 |
| 311 } // namespace | 310 } // namespace |
| 312 } // namespace test | 311 } // namespace test |
| 313 } // namespace net | 312 } // namespace net |
| OLD | NEW |