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

Side by Side Diff: net/tools/quic/quic_spdy_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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/quic/quic_utils.h" 8 #include "net/quic/quic_utils.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "net/tools/quic/quic_client_session.h" 10 #include "net/tools/quic/quic_client_session.h"
(...skipping 11 matching lines...) Expand all
22 using testing::TestWithParam; 22 using testing::TestWithParam;
23 23
24 namespace net { 24 namespace net {
25 namespace tools { 25 namespace tools {
26 namespace test { 26 namespace test {
27 namespace { 27 namespace {
28 28
29 class QuicSpdyClientStreamTest : public TestWithParam<QuicVersion> { 29 class QuicSpdyClientStreamTest : public TestWithParam<QuicVersion> {
30 public: 30 public:
31 QuicSpdyClientStreamTest() 31 QuicSpdyClientStreamTest()
32 : connection_(new StrictMock<MockConnection>( 32 : connection_(
33 false, SupportedVersions(GetParam()))), 33 new StrictMock<MockConnection>(Perspective::IS_CLIENT,
34 SupportedVersions(GetParam()))),
34 session_(DefaultQuicConfig(), connection_), 35 session_(DefaultQuicConfig(), connection_),
35 body_("hello world") { 36 body_("hello world") {
36 session_.InitializeSession( 37 session_.InitializeSession(
37 QuicServerId("example.com", 80, false, PRIVACY_MODE_DISABLED), 38 QuicServerId("example.com", 80, false, PRIVACY_MODE_DISABLED),
38 &crypto_config_); 39 &crypto_config_);
39 40
40 headers_.SetResponseFirstlineFromStringPieces("HTTP/1.1", "200", "Ok"); 41 headers_.SetResponseFirstlineFromStringPieces("HTTP/1.1", "200", "Ok");
41 headers_.ReplaceOrAppendHeader("content-length", "11"); 42 headers_.ReplaceOrAppendHeader("content-length", "11");
42 43
43 headers_string_ = SpdyUtils::SerializeResponseHeaders(headers_); 44 headers_string_ = SpdyUtils::SerializeResponseHeaders(headers_);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 EXPECT_FALSE(stream_->write_side_closed()); 104 EXPECT_FALSE(stream_->write_side_closed());
104 stream_->OnStreamFrame(frame); 105 stream_->OnStreamFrame(frame);
105 EXPECT_TRUE(stream_->write_side_closed()); 106 EXPECT_TRUE(stream_->write_side_closed());
106 } 107 }
107 108
108 } // namespace 109 } // namespace
109 } // namespace test 110 } // namespace test
110 } // namespace tools 111 } // namespace tools
111 } // namespace net 112 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_session_test.cc ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698