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 namespace { | 20 namespace { |
21 | 21 |
22 static int g_delta_seconds = 0; | 22 static int g_delta_seconds = 0; |
23 base::TimeTicks TheNearFuture() { | 23 base::TimeTicks TheNearFuture() { |
24 return base::TimeTicks::Now() + base::TimeDelta::FromSeconds(g_delta_seconds); | 24 return base::TimeTicks::Now() + base::TimeDelta::FromSeconds(g_delta_seconds); |
25 } | 25 } |
26 | 26 |
27 class ClosingDelegate : public SpdyStream::Delegate { | 27 class ClosingDelegate : public SpdyStream::Delegate { |
28 public: | 28 public: |
29 ClosingDelegate(SpdyStream* stream) : stream_(stream) {} | 29 explicit ClosingDelegate(SpdyStream* stream) : stream_(stream) {} |
30 | 30 |
31 // SpdyStream::Delegate implementation: | 31 // SpdyStream::Delegate implementation: |
32 virtual bool OnSendHeadersComplete(int status) OVERRIDE { | 32 virtual bool OnSendHeadersComplete(int status) OVERRIDE { |
33 return true; | 33 return true; |
34 } | 34 } |
35 virtual int OnSendBody() OVERRIDE { | 35 virtual int OnSendBody() OVERRIDE { |
36 return OK; | 36 return OK; |
37 } | 37 } |
38 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE { | 38 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE { |
39 return OK; | 39 return OK; |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 session->CloseSessionOnError(ERR_ABORTED, true, ""); | 1580 session->CloseSessionOnError(ERR_ABORTED, true, ""); |
1581 | 1581 |
1582 EXPECT_TRUE(spdy_stream1->closed()); | 1582 EXPECT_TRUE(spdy_stream1->closed()); |
1583 EXPECT_TRUE(spdy_stream2->closed()); | 1583 EXPECT_TRUE(spdy_stream2->closed()); |
1584 | 1584 |
1585 spdy_stream1 = NULL; | 1585 spdy_stream1 = NULL; |
1586 spdy_stream2 = NULL; | 1586 spdy_stream2 = NULL; |
1587 } | 1587 } |
1588 | 1588 |
1589 } // namespace net | 1589 } // namespace net |
OLD | NEW |