OLD | NEW |
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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include "net/base/host_cache.h" | 7 #include "net/base/host_cache.h" |
8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
10 #include "net/spdy/spdy_io_buffer.h" | 10 #include "net/spdy/spdy_io_buffer.h" |
11 #include "net/spdy/spdy_session_pool.h" | 11 #include "net/spdy/spdy_session_pool.h" |
12 #include "net/spdy/spdy_stream.h" | 12 #include "net/spdy/spdy_stream.h" |
13 #include "net/spdy/spdy_test_util_spdy3.h" | 13 #include "net/spdy/spdy_test_util_spdy3.h" |
14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
15 | 15 |
16 using namespace net::test_spdy3; | 16 using namespace net::test_spdy3; |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 // TODO(cbentzel): Expose compression setter/getter in public SpdySession | 20 // TODO(cbentzel): Expose compression setter/getter in public SpdySession |
21 // interface rather than going through all these contortions. | 21 // interface rather than going through all these contortions. |
22 class SpdySessionSpdy3Test : public PlatformTest { | 22 class SpdySessionSpdy3Test : public PlatformTest { |
23 public: | |
24 static void TurnOffCompression() { | |
25 spdy::SpdyFramer::set_enable_compression_default(false); | |
26 } | |
27 protected: | 23 protected: |
28 virtual void SetUp() { | 24 virtual void SetUp() { |
29 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY3); | 25 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY3); |
30 } | 26 } |
31 | 27 |
32 virtual void TearDown() { | 28 private: |
33 // Wanted to be 100% sure PING is disabled. | 29 SpdyTestStateHelper spdy_state_; |
34 SpdySession::set_enable_ping_based_connection_checking(false); | |
35 } | |
36 }; | 30 }; |
37 | 31 |
38 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { | 32 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { |
39 public: | 33 public: |
40 explicit TestSpdyStreamDelegate(const CompletionCallback& callback) | 34 explicit TestSpdyStreamDelegate(const CompletionCallback& callback) |
41 : callback_(callback) {} | 35 : callback_(callback) {} |
42 virtual ~TestSpdyStreamDelegate() {} | 36 virtual ~TestSpdyStreamDelegate() {} |
43 | 37 |
44 virtual bool OnSendHeadersComplete(int status) { return true; } | 38 virtual bool OnSendHeadersComplete(int status) { return true; } |
45 | 39 |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 net::NetLog::PHASE_NONE); | 1140 net::NetLog::PHASE_NONE); |
1147 | 1141 |
1148 CapturingNetLog::Entry entry = entries[pos]; | 1142 CapturingNetLog::Entry entry = entries[pos]; |
1149 NetLogSpdySessionCloseParameter* request_params = | 1143 NetLogSpdySessionCloseParameter* request_params = |
1150 static_cast<NetLogSpdySessionCloseParameter*>( | 1144 static_cast<NetLogSpdySessionCloseParameter*>( |
1151 entry.extra_parameters.get()); | 1145 entry.extra_parameters.get()); |
1152 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); | 1146 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); |
1153 } | 1147 } |
1154 | 1148 |
1155 } // namespace net | 1149 } // namespace net |
OLD | NEW |