| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 FLAGS_quic_in_memory_cache_dir = path.MaybeAsASCII(); | 32 FLAGS_quic_in_memory_cache_dir = path.MaybeAsASCII(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void CreateRequest(std::string host, | 35 void CreateRequest(std::string host, |
| 36 std::string path, | 36 std::string path, |
| 37 net::BalsaHeaders* headers) { | 37 net::BalsaHeaders* headers) { |
| 38 headers->SetRequestFirstlineFromStringPieces("GET", path, "HTTP/1.1"); | 38 headers->SetRequestFirstlineFromStringPieces("GET", path, "HTTP/1.1"); |
| 39 headers->ReplaceOrAppendHeader("host", host); | 39 headers->ReplaceOrAppendHeader("host", host); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void SetUp() OVERRIDE { | 42 virtual void SetUp() override { |
| 43 QuicInMemoryCachePeer::ResetForTests(); | 43 QuicInMemoryCachePeer::ResetForTests(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // This method was copied from end_to_end_test.cc in this directory. | 46 // This method was copied from end_to_end_test.cc in this directory. |
| 47 void AddToCache(const StringPiece& method, | 47 void AddToCache(const StringPiece& method, |
| 48 const StringPiece& path, | 48 const StringPiece& path, |
| 49 const StringPiece& version, | 49 const StringPiece& version, |
| 50 const StringPiece& response_code, | 50 const StringPiece& response_code, |
| 51 const StringPiece& response_detail, | 51 const StringPiece& response_detail, |
| 52 const StringPiece& body) { | 52 const StringPiece& body) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 CreateRequest("www.google.com", "/index.html", &request_headers); | 129 CreateRequest("www.google.com", "/index.html", &request_headers); |
| 130 | 130 |
| 131 const QuicInMemoryCache::Response* response = | 131 const QuicInMemoryCache::Response* response = |
| 132 QuicInMemoryCache::GetInstance()->GetResponse(request_headers); | 132 QuicInMemoryCache::GetInstance()->GetResponse(request_headers); |
| 133 ASSERT_FALSE(response); | 133 ASSERT_FALSE(response); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace test | 136 } // namespace test |
| 137 } // namespace tools | 137 } // namespace tools |
| 138 } // namespace net | 138 } // namespace net |
| OLD | NEW |