| 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/http/http_cache.h" | 5 #include "net/http/http_cache.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2929 MockHttpCache cache; | 2929 MockHttpCache cache; |
| 2930 | 2930 |
| 2931 // Test that we hit the cache for POST requests. | 2931 // Test that we hit the cache for POST requests. |
| 2932 | 2932 |
| 2933 MockTransaction transaction(kSimplePOST_Transaction); | 2933 MockTransaction transaction(kSimplePOST_Transaction); |
| 2934 | 2934 |
| 2935 const int64_t kUploadId = 1; // Just a dummy value. | 2935 const int64_t kUploadId = 1; // Just a dummy value. |
| 2936 | 2936 |
| 2937 std::vector<std::unique_ptr<UploadElementReader>> element_readers; | 2937 std::vector<std::unique_ptr<UploadElementReader>> element_readers; |
| 2938 element_readers.push_back( | 2938 element_readers.push_back( |
| 2939 base::WrapUnique(new UploadBytesElementReader("hello", 5))); | 2939 base::MakeUnique<UploadBytesElementReader>("hello", 5)); |
| 2940 ElementsUploadDataStream upload_data_stream(std::move(element_readers), | 2940 ElementsUploadDataStream upload_data_stream(std::move(element_readers), |
| 2941 kUploadId); | 2941 kUploadId); |
| 2942 MockHttpRequest request(transaction); | 2942 MockHttpRequest request(transaction); |
| 2943 request.upload_data_stream = &upload_data_stream; | 2943 request.upload_data_stream = &upload_data_stream; |
| 2944 | 2944 |
| 2945 // Populate the cache. | 2945 // Populate the cache. |
| 2946 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL); | 2946 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL); |
| 2947 | 2947 |
| 2948 EXPECT_EQ(1, cache.network_layer()->transaction_count()); | 2948 EXPECT_EQ(1, cache.network_layer()->transaction_count()); |
| 2949 EXPECT_EQ(0, cache.disk_cache()->open_count()); | 2949 EXPECT_EQ(0, cache.disk_cache()->open_count()); |
| (...skipping 5147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8097 RunTransactionTestWithResponseInfo(cache.http_cache(), | 8097 RunTransactionTestWithResponseInfo(cache.http_cache(), |
| 8098 kTypicalGET_Transaction, &response_info); | 8098 kTypicalGET_Transaction, &response_info); |
| 8099 | 8099 |
| 8100 EXPECT_FALSE(response_info.was_cached); | 8100 EXPECT_FALSE(response_info.was_cached); |
| 8101 EXPECT_TRUE(response_info.network_accessed); | 8101 EXPECT_TRUE(response_info.network_accessed); |
| 8102 EXPECT_EQ(CacheEntryStatus::ENTRY_CANT_CONDITIONALIZE, | 8102 EXPECT_EQ(CacheEntryStatus::ENTRY_CANT_CONDITIONALIZE, |
| 8103 response_info.cache_entry_status); | 8103 response_info.cache_entry_status); |
| 8104 } | 8104 } |
| 8105 | 8105 |
| 8106 } // namespace net | 8106 } // namespace net |
| OLD | NEW |