| 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/tools/quic/quic_reliable_server_stream.h" | 5 #include "net/tools/quic/quic_reliable_server_stream.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "net/quic/quic_spdy_compressor.h" | 8 #include "net/quic/quic_spdy_compressor.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
| 11 #include "net/tools/flip_server/epoll_server.h" | 11 #include "net/tools/flip_server/epoll_server.h" |
| 12 #include "net/tools/quic/quic_in_memory_cache.h" | 12 #include "net/tools/quic/quic_in_memory_cache.h" |
| 13 #include "net/tools/quic/quic_spdy_server_stream.h" | 13 #include "net/tools/quic/quic_spdy_server_stream.h" |
| 14 #include "net/tools/quic/spdy_utils.h" | 14 #include "net/tools/quic/spdy_utils.h" |
| 15 #include "net/tools/quic/test_tools/quic_in_memory_cache_peer.h" |
| 15 #include "net/tools/quic/test_tools/quic_test_utils.h" | 16 #include "net/tools/quic/test_tools/quic_test_utils.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 19 |
| 19 using base::StringPiece; | 20 using base::StringPiece; |
| 20 using net::tools::test::MockConnection; | 21 using net::tools::test::MockConnection; |
| 21 using net::test::MockSession; | 22 using net::test::MockSession; |
| 22 using std::string; | 23 using std::string; |
| 23 using testing::_; | 24 using testing::_; |
| 24 using testing::AnyNumber; | 25 using testing::AnyNumber; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 EXPECT_EQ(0, headers[3]); | 74 EXPECT_EQ(0, headers[3]); |
| 74 EXPECT_EQ(static_cast<size_t>(headers.length() - 4), | 75 EXPECT_EQ(static_cast<size_t>(headers.length() - 4), |
| 75 decompressor.DecompressData(headers.substr(4), &visitor)); | 76 decompressor.DecompressData(headers.substr(4), &visitor)); |
| 76 | 77 |
| 77 EXPECT_EQ(headers_string_, visitor.data()); | 78 EXPECT_EQ(headers_string_, visitor.data()); |
| 78 | 79 |
| 79 return QuicConsumedData(headers.size(), false); | 80 return QuicConsumedData(headers.size(), false); |
| 80 } | 81 } |
| 81 | 82 |
| 82 static void SetUpTestCase() { | 83 static void SetUpTestCase() { |
| 83 QuicInMemoryCache::GetInstance()->ResetForTests(); | 84 QuicInMemoryCachePeer::ResetForTests(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 virtual void SetUp() { | 87 virtual void SetUp() { |
| 87 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); | 88 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); |
| 88 | 89 |
| 89 BalsaHeaders request_headers, response_headers; | 90 BalsaHeaders request_headers, response_headers; |
| 90 StringPiece body("Yum"); | 91 StringPiece body("Yum"); |
| 91 request_headers.SetRequestFirstlineFromStringPieces( | 92 request_headers.SetRequestFirstlineFromStringPieces( |
| 92 "GET", | 93 "GET", |
| 93 "https://www.google.com/foo", | 94 "https://www.google.com/foo", |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 220 |
| 220 stream_->SendErrorResponse(); | 221 stream_->SendErrorResponse(); |
| 221 EXPECT_TRUE(stream_->read_side_closed()); | 222 EXPECT_TRUE(stream_->read_side_closed()); |
| 222 EXPECT_TRUE(stream_->write_side_closed()); | 223 EXPECT_TRUE(stream_->write_side_closed()); |
| 223 } | 224 } |
| 224 | 225 |
| 225 } // namespace | 226 } // namespace |
| 226 } // namespace test | 227 } // namespace test |
| 227 } // namespace tools | 228 } // namespace tools |
| 228 } // namespace net | 229 } // namespace net |
| OLD | NEW |