| 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 "net/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 public ::testing::WithParamInterface<TestCase> { | 62 public ::testing::WithParamInterface<TestCase> { |
| 63 protected: | 63 protected: |
| 64 // A function that takes a SpdyStream and the number of bytes which | 64 // A function that takes a SpdyStream and the number of bytes which |
| 65 // will unstall the next frame completely. | 65 // will unstall the next frame completely. |
| 66 typedef base::Callback<void(const base::WeakPtr<SpdyStream>&, int32_t)> | 66 typedef base::Callback<void(const base::WeakPtr<SpdyStream>&, int32_t)> |
| 67 UnstallFunction; | 67 UnstallFunction; |
| 68 | 68 |
| 69 SpdyStreamTest() | 69 SpdyStreamTest() |
| 70 : spdy_util_(GetProtocol(), GetDependenciesFromPriority()), | 70 : spdy_util_(GetProtocol(), GetDependenciesFromPriority()), |
| 71 session_deps_(GetProtocol()), | 71 session_deps_(GetProtocol()), |
| 72 session_(SpdySessionDependencies::SpdyCreateSession(&session_deps_)), | |
| 73 offset_(0) { | 72 offset_(0) { |
| 74 SpdySession::SetPriorityDependencyDefaultForTesting( | 73 session_deps_.enable_priority_dependencies = GetDependenciesFromPriority(); |
| 75 GetDependenciesFromPriority()); | 74 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
| 76 } | 75 } |
| 77 | 76 |
| 78 ~SpdyStreamTest() { | 77 ~SpdyStreamTest() { |
| 79 SpdySession::SetPriorityDependencyDefaultForTesting(false); | |
| 80 } | 78 } |
| 81 | 79 |
| 82 base::WeakPtr<SpdySession> CreateDefaultSpdySession() { | 80 base::WeakPtr<SpdySession> CreateDefaultSpdySession() { |
| 83 SpdySessionKey key(HostPortPair("www.example.org", 80), | 81 SpdySessionKey key(HostPortPair("www.example.org", 80), |
| 84 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 82 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
| 85 return CreateInsecureSpdySession(session_.get(), key, BoundNetLog()); | 83 return CreateInsecureSpdySession(session_.get(), key, BoundNetLog()); |
| 86 } | 84 } |
| 87 | 85 |
| 88 void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); } | 86 void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); } |
| 89 | 87 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 EXPECT_EQ(response_len, stream->raw_received_bytes()); | 1129 EXPECT_EQ(response_len, stream->raw_received_bytes()); |
| 1132 | 1130 |
| 1133 // FIN | 1131 // FIN |
| 1134 data.Resume(); | 1132 data.Resume(); |
| 1135 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); | 1133 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); |
| 1136 } | 1134 } |
| 1137 | 1135 |
| 1138 } // namespace test | 1136 } // namespace test |
| 1139 | 1137 |
| 1140 } // namespace net | 1138 } // namespace net |
| OLD | NEW |