OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 #include "base/ref_counted.h" | 6 #include "base/ref_counted.h" |
7 #include "net/spdy/spdy_session.h" | 7 #include "net/spdy/spdy_session.h" |
8 #include "net/spdy/spdy_test_util.h" | 8 #include "net/spdy/spdy_test_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } // anonymous namespace | 112 } // anonymous namespace |
113 | 113 |
114 class SpdyStreamTest : public testing::Test { | 114 class SpdyStreamTest : public testing::Test { |
115 protected: | 115 protected: |
116 SpdyStreamTest() { | 116 SpdyStreamTest() { |
117 } | 117 } |
118 | 118 |
119 scoped_refptr<SpdySession> CreateSpdySession() { | 119 scoped_refptr<SpdySession> CreateSpdySession() { |
120 spdy::SpdyFramer::set_enable_compression_default(false); | 120 spdy::SpdyFramer::set_enable_compression_default(false); |
121 HostPortPair host_port_pair("www.google.com", 80); | 121 HostPortPair host_port_pair("www.google.com", 80); |
122 HostPortProxyPair pair(host_port_pair, ""); | 122 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); |
123 scoped_refptr<SpdySession> session( | 123 scoped_refptr<SpdySession> session( |
124 session_->spdy_session_pool()->Get(pair, session_, BoundNetLog())); | 124 session_->spdy_session_pool()->Get(pair, session_, BoundNetLog())); |
125 return session; | 125 return session; |
126 } | 126 } |
127 | 127 |
128 virtual void TearDown() { | 128 virtual void TearDown() { |
129 MessageLoop::current()->RunAllPending(); | 129 MessageLoop::current()->RunAllPending(); |
130 } | 130 } |
131 | 131 |
132 scoped_refptr<HttpNetworkSession> session_; | 132 scoped_refptr<HttpNetworkSession> session_; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 EXPECT_TRUE(delegate->send_headers_completed()); | 225 EXPECT_TRUE(delegate->send_headers_completed()); |
226 EXPECT_EQ("200", (*delegate->response())["status"]); | 226 EXPECT_EQ("200", (*delegate->response())["status"]); |
227 EXPECT_EQ("HTTP/1.1", (*delegate->response())["version"]); | 227 EXPECT_EQ("HTTP/1.1", (*delegate->response())["version"]); |
228 EXPECT_EQ(std::string("\0hello!\xff", 8), delegate->received_data()); | 228 EXPECT_EQ(std::string("\0hello!\xff", 8), delegate->received_data()); |
229 EXPECT_EQ(8, delegate->data_sent()); | 229 EXPECT_EQ(8, delegate->data_sent()); |
230 EXPECT_TRUE(delegate->closed()); | 230 EXPECT_TRUE(delegate->closed()); |
231 } | 231 } |
232 | 232 |
233 } // namespace net | 233 } // namespace net |
OLD | NEW |