| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/url_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
| 18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 19 #include "net/base/load_flags.h" | 19 #include "net/base/load_flags.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "net/base/net_module.h" | 21 #include "net/base/net_module.h" |
| 22 #include "net/base/net_util.h" | 22 #include "net/base/net_util.h" |
| 23 #include "net/disk_cache/disk_cache.h" | 23 #include "net/disk_cache/disk_cache.h" |
| 24 #include "net/http/http_cache.h" | 24 #include "net/http/http_cache.h" |
| 25 #include "net/http/http_network_layer.h" | 25 #include "net/http/http_network_layer.h" |
| 26 #include "net/url_request/url_request.h" | 26 #include "net/url_request/url_request.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 28 |
| 29 using base::Time; |
| 30 |
| 29 namespace { | 31 namespace { |
| 30 | 32 |
| 31 class URLRequestTest : public testing::Test { | 33 class URLRequestTest : public testing::Test { |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 class URLRequestHttpCacheContext : public URLRequestContext { | 36 class URLRequestHttpCacheContext : public URLRequestContext { |
| 35 public: | 37 public: |
| 36 URLRequestHttpCacheContext() { | 38 URLRequestHttpCacheContext() { |
| 37 http_transaction_factory_ = | 39 http_transaction_factory_ = |
| 38 new net::HttpCache(net::HttpNetworkLayer::CreateFactory(NULL), | 40 new net::HttpCache(net::HttpNetworkLayer::CreateFactory(NULL), |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 MessageLoop::current()->Run(); | 766 MessageLoop::current()->Run(); |
| 765 | 767 |
| 766 EXPECT_TRUE(d.data_received().find("user/secret") != std::string::npos); | 768 EXPECT_TRUE(d.data_received().find("user/secret") != std::string::npos); |
| 767 | 769 |
| 768 // Should be the same cached document, which means that the response time | 770 // Should be the same cached document, which means that the response time |
| 769 // should not have changed. | 771 // should not have changed. |
| 770 EXPECT_TRUE(response_time == r.response_time()); | 772 EXPECT_TRUE(response_time == r.response_time()); |
| 771 } | 773 } |
| 772 } | 774 } |
| 773 | 775 |
| OLD | NEW |