| 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/url_request/view_cache_helper.h" | 5 #include "net/url_request/view_cache_helper.h" |
| 6 | 6 |
| 7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
| 10 #include "net/disk_cache/disk_cache.h" | 10 #include "net/disk_cache/disk_cache.h" |
| 11 #include "net/http/http_cache.h" | 11 #include "net/http/http_cache.h" |
| 12 #include "net/http/http_transaction_test_util.h" | 12 #include "net/http/http_transaction_test_util.h" |
| 13 #include "net/url_request/url_request_context.h" | 13 #include "net/url_request/url_request_context.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class TestURLRequestContext : public URLRequestContext { | 20 class TestURLRequestContext : public URLRequestContext { |
| 21 public: | 21 public: |
| 22 TestURLRequestContext(); | 22 TestURLRequestContext(); |
| 23 virtual ~TestURLRequestContext() {} | 23 |
| 24 virtual ~TestURLRequestContext() { |
| 25 AssertNoURLRequests(); |
| 26 } |
| 24 | 27 |
| 25 // Gets a pointer to the cache backend. | 28 // Gets a pointer to the cache backend. |
| 26 disk_cache::Backend* GetBackend(); | 29 disk_cache::Backend* GetBackend(); |
| 27 | 30 |
| 28 private: | 31 private: |
| 29 HttpCache cache_; | 32 HttpCache cache_; |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 TestURLRequestContext::TestURLRequestContext() | 35 TestURLRequestContext::TestURLRequestContext() |
| 33 : cache_(new MockNetworkLayer(), NULL, | 36 : cache_(new MockNetworkLayer(), NULL, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 206 |
| 204 std::string data; | 207 std::string data; |
| 205 TestCompletionCallback cb1; | 208 TestCompletionCallback cb1; |
| 206 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); | 209 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); |
| 207 EXPECT_EQ(OK, cb1.GetResult(rv)); | 210 EXPECT_EQ(OK, cb1.GetResult(rv)); |
| 208 | 211 |
| 209 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); | 212 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); |
| 210 } | 213 } |
| 211 | 214 |
| 212 } // namespace net | 215 } // namespace net |
| OLD | NEW |