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_spdy2.h" | 13 #include "net/spdy/spdy_test_util_spdy2.h" |
14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
15 | 15 |
16 using namespace net::test_spdy2; | 16 using namespace net::test_spdy2; |
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 SpdySessionSpdy2Test : public PlatformTest { | 22 class SpdySessionSpdy2Test : 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::kProtoSPDY2); | 25 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); |
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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 net::NetLog::PHASE_NONE); | 1064 net::NetLog::PHASE_NONE); |
1071 | 1065 |
1072 CapturingNetLog::Entry entry = entries[pos]; | 1066 CapturingNetLog::Entry entry = entries[pos]; |
1073 NetLogSpdySessionCloseParameter* request_params = | 1067 NetLogSpdySessionCloseParameter* request_params = |
1074 static_cast<NetLogSpdySessionCloseParameter*>( | 1068 static_cast<NetLogSpdySessionCloseParameter*>( |
1075 entry.extra_parameters.get()); | 1069 entry.extra_parameters.get()); |
1076 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); | 1070 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); |
1077 } | 1071 } |
1078 | 1072 |
1079 } // namespace net | 1073 } // namespace net |
OLD | NEW |