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