| 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/tools/quic/quic_http_response_cache.h" | 5 #include "net/tools/quic/quic_http_response_cache.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "net/quic/platform/api/quic_map_util.h" | 9 #include "net/quic/platform/api/quic_map_util.h" |
| 10 #include "net/quic/platform/api/quic_str_cat.h" | 10 #include "net/quic/platform/api/quic_str_cat.h" |
| 11 #include "net/quic/platform/api/quic_test.h" |
| 11 #include "net/quic/platform/api/quic_text_utils.h" | 12 #include "net/quic/platform/api/quic_text_utils.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | |
| 13 | 13 |
| 14 using std::string; | 14 using std::string; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace test { | 17 namespace test { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 typedef QuicHttpResponseCache::Response Response; | 20 typedef QuicHttpResponseCache::Response Response; |
| 21 typedef QuicHttpResponseCache::ServerPushInfo ServerPushInfo; | 21 typedef QuicHttpResponseCache::ServerPushInfo ServerPushInfo; |
| 22 }; // namespace | 22 }; // namespace |
| 23 | 23 |
| 24 class QuicHttpResponseCacheTest : public ::testing::Test { | 24 class QuicHttpResponseCacheTest : public QuicTest { |
| 25 protected: | 25 protected: |
| 26 void CreateRequest(string host, string path, SpdyHeaderBlock* headers) { | 26 void CreateRequest(string host, string path, SpdyHeaderBlock* headers) { |
| 27 (*headers)[":method"] = "GET"; | 27 (*headers)[":method"] = "GET"; |
| 28 (*headers)[":path"] = path; | 28 (*headers)[":path"] = path; |
| 29 (*headers)[":authority"] = host; | 29 (*headers)[":authority"] = host; |
| 30 (*headers)[":scheme"] = "https"; | 30 (*headers)[":scheme"] = "https"; |
| 31 } | 31 } |
| 32 | 32 |
| 33 string CacheDirectory() { | 33 string CacheDirectory() { |
| 34 base::FilePath path; | 34 base::FilePath path; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ASSERT_TRUE(QuicContainsKey(response->headers(), ":status")); | 237 ASSERT_TRUE(QuicContainsKey(response->headers(), ":status")); |
| 238 EXPECT_EQ(push_response_status[i++], | 238 EXPECT_EQ(push_response_status[i++], |
| 239 response->headers().find(":status")->second); | 239 response->headers().find(":status")->second); |
| 240 EXPECT_EQ(push_resource.body, response->body()); | 240 EXPECT_EQ(push_resource.body, response->body()); |
| 241 resources.pop_front(); | 241 resources.pop_front(); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace test | 245 } // namespace test |
| 246 } // namespace net | 246 } // namespace net |
| OLD | NEW |