| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 host_.CancelRequestsForProcess(second_filter->child_id()); | 1830 host_.CancelRequestsForProcess(second_filter->child_id()); |
| 1831 | 1831 |
| 1832 // Flush all the pending requests. | 1832 // Flush all the pending requests. |
| 1833 while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} | 1833 while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} |
| 1834 } | 1834 } |
| 1835 | 1835 |
| 1836 // Test the private helper method "CalculateApproximateMemoryCost()". | 1836 // Test the private helper method "CalculateApproximateMemoryCost()". |
| 1837 TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { | 1837 TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { |
| 1838 net::URLRequestContext context; | 1838 net::URLRequestContext context; |
| 1839 scoped_ptr<net::URLRequest> req(context.CreateRequest( | 1839 scoped_ptr<net::URLRequest> req(context.CreateRequest( |
| 1840 GURL("http://www.google.com"), net::DEFAULT_PRIORITY, NULL, NULL)); | 1840 GURL("http://www.google.com"), net::DEFAULT_PRIORITY, NULL)); |
| 1841 EXPECT_EQ( | 1841 EXPECT_EQ( |
| 1842 4427, | 1842 4427, |
| 1843 ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get())); | 1843 ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get())); |
| 1844 | 1844 |
| 1845 // Add 9 bytes of referrer. | 1845 // Add 9 bytes of referrer. |
| 1846 req->SetReferrer("123456789"); | 1846 req->SetReferrer("123456789"); |
| 1847 EXPECT_EQ( | 1847 EXPECT_EQ( |
| 1848 4436, | 1848 4436, |
| 1849 ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get())); | 1849 ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get())); |
| 1850 | 1850 |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3242 return nullptr; | 3242 return nullptr; |
| 3243 } | 3243 } |
| 3244 | 3244 |
| 3245 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( | 3245 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( |
| 3246 net::URLRequest* request, | 3246 net::URLRequest* request, |
| 3247 net::NetworkDelegate* network_delegate) const { | 3247 net::NetworkDelegate* network_delegate) const { |
| 3248 return nullptr; | 3248 return nullptr; |
| 3249 } | 3249 } |
| 3250 | 3250 |
| 3251 } // namespace content | 3251 } // namespace content |
| OLD | NEW |