OLD | NEW |
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 <cstddef> | 5 #include <cstddef> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 UnstallFunction; | 48 UnstallFunction; |
49 | 49 |
50 SpdyStreamTest() | 50 SpdyStreamTest() |
51 : spdy_util_(GetParam()), | 51 : spdy_util_(GetParam()), |
52 session_deps_(GetParam()), | 52 session_deps_(GetParam()), |
53 offset_(0) {} | 53 offset_(0) {} |
54 | 54 |
55 base::WeakPtr<SpdySession> CreateDefaultSpdySession() { | 55 base::WeakPtr<SpdySession> CreateDefaultSpdySession() { |
56 SpdySessionKey key(HostPortPair("www.example.org", 80), | 56 SpdySessionKey key(HostPortPair("www.example.org", 80), |
57 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 57 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
58 return CreateInsecureSpdySession(session_, key, BoundNetLog()); | 58 return CreateInsecureSpdySession(session_.get(), key, BoundNetLog()); |
59 } | 59 } |
60 | 60 |
61 void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); } | 61 void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); } |
62 | 62 |
63 void RunResumeAfterUnstallRequestResponseTest( | 63 void RunResumeAfterUnstallRequestResponseTest( |
64 const UnstallFunction& unstall_function); | 64 const UnstallFunction& unstall_function); |
65 | 65 |
66 void RunResumeAfterUnstallBidirectionalTest( | 66 void RunResumeAfterUnstallBidirectionalTest( |
67 const UnstallFunction& unstall_function); | 67 const UnstallFunction& unstall_function); |
68 | 68 |
(...skipping 23 matching lines...) Expand all Loading... |
92 MockWrite* GetWrites() { | 92 MockWrite* GetWrites() { |
93 return vector_as_array(&writes_); | 93 return vector_as_array(&writes_); |
94 } | 94 } |
95 | 95 |
96 int GetNumWrites() const { | 96 int GetNumWrites() const { |
97 return writes_.size(); | 97 return writes_.size(); |
98 } | 98 } |
99 | 99 |
100 SpdyTestUtil spdy_util_; | 100 SpdyTestUtil spdy_util_; |
101 SpdySessionDependencies session_deps_; | 101 SpdySessionDependencies session_deps_; |
102 scoped_refptr<HttpNetworkSession> session_; | 102 scoped_ptr<HttpNetworkSession> session_; |
103 | 103 |
104 private: | 104 private: |
105 // Used by Add{Read,Write}() above. | 105 // Used by Add{Read,Write}() above. |
106 std::vector<MockWrite> writes_; | 106 std::vector<MockWrite> writes_; |
107 std::vector<MockRead> reads_; | 107 std::vector<MockRead> reads_; |
108 int offset_; | 108 int offset_; |
109 }; | 109 }; |
110 | 110 |
111 INSTANTIATE_TEST_CASE_P(NextProto, | 111 INSTANTIATE_TEST_CASE_P(NextProto, |
112 SpdyStreamTest, | 112 SpdyStreamTest, |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 data.RunFor(1); // FIN | 1125 data.RunFor(1); // FIN |
1126 | 1126 |
1127 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); | 1127 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace | 1130 } // namespace |
1131 | 1131 |
1132 } // namespace test | 1132 } // namespace test |
1133 | 1133 |
1134 } // namespace net | 1134 } // namespace net |
OLD | NEW |