Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: net/quic/quic_client_promised_info_test.cc

Issue 1977153002: Rename various MockConnectionFoo classes to MockQuicConnectionFoo. No behavior change. This is cons… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121576119
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_promised_info.h" 5 #include "net/quic/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 "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 bool authorized_; 65 bool authorized_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(MockQuicClientSession); 67 DISALLOW_COPY_AND_ASSIGN(MockQuicClientSession);
68 }; 68 };
69 69
70 class QuicClientPromisedInfoTest : public ::testing::Test { 70 class QuicClientPromisedInfoTest : public ::testing::Test {
71 public: 71 public:
72 class StreamVisitor; 72 class StreamVisitor;
73 73
74 QuicClientPromisedInfoTest() 74 QuicClientPromisedInfoTest()
75 : connection_(new StrictMock<MockConnection>(&helper_, 75 : connection_(new StrictMock<MockQuicConnection>(&helper_,
76 &alarm_factory_, 76 &alarm_factory_,
77 Perspective::IS_CLIENT)), 77 Perspective::IS_CLIENT)),
78 session_(connection_, &push_promise_index_), 78 session_(connection_, &push_promise_index_),
79 body_("hello world"), 79 body_("hello world"),
80 promise_id_(gfe_quic::test::kServerDataStreamId1) { 80 promise_id_(gfe_quic::test::kServerDataStreamId1) {
81 FLAGS_quic_supports_push_promise = true; 81 FLAGS_quic_supports_push_promise = true;
82 82
83 session_.Initialize(); 83 session_.Initialize();
84 84
85 headers_.SetResponseFirstline("HTTP/1.1", 200, "Ok"); 85 headers_.SetResponseFirstline("HTTP/1.1", 200, "Ok");
86 headers_.ReplaceOrAppendHeader("content-length", "11"); 86 headers_.ReplaceOrAppendHeader("content-length", "11");
87 headers_string_ = SpdyBalsaUtils::SerializeResponseHeaders(headers_); 87 headers_string_ = SpdyBalsaUtils::SerializeResponseHeaders(headers_);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 bool rendezvous_fired_; 137 bool rendezvous_fired_;
138 QuicSpdyClientStream* rendezvous_stream_; 138 QuicSpdyClientStream* rendezvous_stream_;
139 }; 139 };
140 140
141 void ReceivePromise(QuicStreamId id) { 141 void ReceivePromise(QuicStreamId id) {
142 stream_->OnStreamHeaders(serialized_push_promise_); 142 stream_->OnStreamHeaders(serialized_push_promise_);
143 143
144 stream_->OnPromiseHeadersComplete(id, serialized_push_promise_.size()); 144 stream_->OnPromiseHeadersComplete(id, serialized_push_promise_.size());
145 } 145 }
146 146
147 MockConnectionHelper helper_; 147 MockQuicConnectionHelper helper_;
148 MockAlarmFactory alarm_factory_; 148 MockAlarmFactory alarm_factory_;
149 StrictMock<MockConnection>* connection_; 149 StrictMock<MockQuicConnection>* connection_;
150 QuicClientPushPromiseIndex push_promise_index_; 150 QuicClientPushPromiseIndex push_promise_index_;
151 151
152 MockQuicClientSession session_; 152 MockQuicClientSession session_;
153 std::unique_ptr<QuicSpdyClientStream> stream_; 153 std::unique_ptr<QuicSpdyClientStream> stream_;
154 std::unique_ptr<StreamVisitor> stream_visitor_; 154 std::unique_ptr<StreamVisitor> stream_visitor_;
155 std::unique_ptr<QuicSpdyClientStream> promised_stream_; 155 std::unique_ptr<QuicSpdyClientStream> promised_stream_;
156 BalsaHeaders headers_; 156 BalsaHeaders headers_;
157 string headers_string_; 157 string headers_string_;
158 string body_; 158 string body_;
159 SpdyHeaderBlock push_promise_; 159 SpdyHeaderBlock push_promise_;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 EXPECT_FALSE(delegate.rendezvous_fired()); 371 EXPECT_FALSE(delegate.rendezvous_fired());
372 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); 372 EXPECT_EQ(delegate.rendezvous_stream(), nullptr);
373 373
374 // Promise is gone 374 // Promise is gone
375 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); 375 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr);
376 } 376 }
377 377
378 } // namespace 378 } // namespace
379 } // namespace test 379 } // namespace test
380 } // namespace net 380 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_chromium_client_stream_test.cc ('k') | net/quic/quic_client_push_promise_index_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698