| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "net/http/http_transaction.h" | 26 #include "net/http/http_transaction.h" |
| 27 #include "net/http/http_transaction_unittest.h" | 27 #include "net/http/http_transaction_unittest.h" |
| 28 #include "net/http/http_util.h" | 28 #include "net/http/http_util.h" |
| 29 #include "net/http/mock_http_cache.h" | 29 #include "net/http/mock_http_cache.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 | 31 |
| 32 using base::Time; | 32 using base::Time; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 class DeleteCacheCompletionCallback : public TestCompletionCallbackBase { | 36 class DeleteCacheCompletionCallback : public net::TestCompletionCallbackBase { |
| 37 public: | 37 public: |
| 38 explicit DeleteCacheCompletionCallback(MockHttpCache* cache) | 38 explicit DeleteCacheCompletionCallback(MockHttpCache* cache) |
| 39 : cache_(cache), | 39 : cache_(cache), |
| 40 ALLOW_THIS_IN_INITIALIZER_LIST(callback_( | 40 ALLOW_THIS_IN_INITIALIZER_LIST(callback_( |
| 41 base::Bind(&DeleteCacheCompletionCallback::OnComplete, | 41 base::Bind(&DeleteCacheCompletionCallback::OnComplete, |
| 42 base::Unretained(this)))) { | 42 base::Unretained(this)))) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 const net::CompletionCallback& callback() const { return callback_; } | 45 const net::CompletionCallback& callback() const { return callback_; } |
| 46 | 46 |
| (...skipping 4768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4815 | 4815 |
| 4816 // Verify that the entry is marked as incomplete. | 4816 // Verify that the entry is marked as incomplete. |
| 4817 disk_cache::Entry* entry; | 4817 disk_cache::Entry* entry; |
| 4818 ASSERT_TRUE(cache.OpenBackendEntry(kSimpleGET_Transaction.url, &entry)); | 4818 ASSERT_TRUE(cache.OpenBackendEntry(kSimpleGET_Transaction.url, &entry)); |
| 4819 net::HttpResponseInfo response; | 4819 net::HttpResponseInfo response; |
| 4820 bool truncated = false; | 4820 bool truncated = false; |
| 4821 EXPECT_TRUE(MockHttpCache::ReadResponseInfo(entry, &response, &truncated)); | 4821 EXPECT_TRUE(MockHttpCache::ReadResponseInfo(entry, &response, &truncated)); |
| 4822 EXPECT_TRUE(truncated); | 4822 EXPECT_TRUE(truncated); |
| 4823 entry->Close(); | 4823 entry->Close(); |
| 4824 } | 4824 } |
| OLD | NEW |