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

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

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_reliable_client_stream.h" 5 #include "net/quic/quic_reliable_client_stream.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/base/test_completion_callback.h" 8 #include "net/base/test_completion_callback.h"
9 #include "net/quic/quic_client_session.h" 9 #include "net/quic/quic_client_session.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 24 matching lines...) Expand all
35 MOCK_METHOD0(HasSendHeadersComplete, bool()); 35 MOCK_METHOD0(HasSendHeadersComplete, bool());
36 36
37 private: 37 private:
38 DISALLOW_COPY_AND_ASSIGN(MockDelegate); 38 DISALLOW_COPY_AND_ASSIGN(MockDelegate);
39 }; 39 };
40 40
41 class QuicReliableClientStreamTest 41 class QuicReliableClientStreamTest
42 : public ::testing::TestWithParam<QuicVersion> { 42 : public ::testing::TestWithParam<QuicVersion> {
43 public: 43 public:
44 QuicReliableClientStreamTest() 44 QuicReliableClientStreamTest()
45 : session_(new MockConnection(false, SupportedVersions(GetParam()))) { 45 : session_(new MockConnection(Perspective::IS_CLIENT,
46 SupportedVersions(GetParam()))) {
46 stream_ = new QuicReliableClientStream(kStreamId, &session_, BoundNetLog()); 47 stream_ = new QuicReliableClientStream(kStreamId, &session_, BoundNetLog());
47 session_.ActivateStream(stream_); 48 session_.ActivateStream(stream_);
48 stream_->SetDelegate(&delegate_); 49 stream_->SetDelegate(&delegate_);
49 } 50 }
50 51
51 void InitializeHeaders() { 52 void InitializeHeaders() {
52 headers_[":host"] = "www.google.com"; 53 headers_[":host"] = "www.google.com";
53 headers_[":path"] = "/index.hml"; 54 headers_[":path"] = "/index.hml";
54 headers_[":scheme"] = "https"; 55 headers_[":scheme"] = "https";
55 headers_["cookie"] = 56 headers_["cookie"] =
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _, _)).WillOnce( 165 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _, _)).WillOnce(
165 Return(QuicConsumedData(kDataLen, true))); 166 Return(QuicConsumedData(kDataLen, true)));
166 stream_->OnCanWrite(); 167 stream_->OnCanWrite();
167 ASSERT_TRUE(callback.have_result()); 168 ASSERT_TRUE(callback.have_result());
168 EXPECT_EQ(OK, callback.WaitForResult()); 169 EXPECT_EQ(OK, callback.WaitForResult());
169 } 170 }
170 171
171 } // namespace 172 } // namespace
172 } // namespace test 173 } // namespace test
173 } // namespace net 174 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698