Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: net/tools/quic/quic_reliable_server_stream_test.cc

Issue 24596008: Cleanup of QuicInMemoryCache to sync with internal version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing files Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/tools/quic/quic_in_memory_cache_test.cc ('k') | net/tools/quic/test_tools/quic_in_memory_cache_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698