Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor_unittest.cc

Issue 2264903003: Adjust callers and networking delegates in chrome/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: fix while loop Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/predictors/resource_prefetch_predictor.h" 5 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 29 matching lines...) Expand all
40 typedef ResourcePrefetchPredictorTables::PrefetchDataMap PrefetchDataMap; 40 typedef ResourcePrefetchPredictorTables::PrefetchDataMap PrefetchDataMap;
41 typedef ResourcePrefetchPredictorTables::RedirectDataMap RedirectDataMap; 41 typedef ResourcePrefetchPredictorTables::RedirectDataMap RedirectDataMap;
42 42
43 scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders( 43 scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders(
44 const char* headers) { 44 const char* headers) {
45 return make_scoped_refptr(new net::HttpResponseHeaders( 45 return make_scoped_refptr(new net::HttpResponseHeaders(
46 net::HttpUtil::AssembleRawHeaders(headers, strlen(headers)))); 46 net::HttpUtil::AssembleRawHeaders(headers, strlen(headers))));
47 } 47 }
48 48
49 class EmptyURLRequestDelegate : public net::URLRequest::Delegate { 49 class EmptyURLRequestDelegate : public net::URLRequest::Delegate {
50 void OnResponseStarted(net::URLRequest* request) override {} 50 void OnResponseStarted(net::URLRequest* request, int net_error) override {}
51 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} 51 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {}
52 }; 52 };
53 53
54 class MockURLRequestJob : public net::URLRequestJob { 54 class MockURLRequestJob : public net::URLRequestJob {
55 public: 55 public:
56 MockURLRequestJob(net::URLRequest* request, 56 MockURLRequestJob(net::URLRequest* request,
57 const net::HttpResponseInfo& response_info, 57 const net::HttpResponseInfo& response_info,
58 const std::string& mime_type) 58 const std::string& mime_type)
59 : net::URLRequestJob(request, nullptr), 59 : net::URLRequestJob(request, nullptr),
60 response_info_(response_info), 60 response_info_(response_info),
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 url_request_job_factory_.set_response_info(response_info); 1340 url_request_job_factory_.set_response_info(response_info);
1341 std::unique_ptr<net::URLRequest> request_etag = 1341 std::unique_ptr<net::URLRequest> request_etag =
1342 CreateURLRequest(GURL("http://www.google.com/cat.png"), net::MEDIUM, 1342 CreateURLRequest(GURL("http://www.google.com/cat.png"), net::MEDIUM,
1343 content::RESOURCE_TYPE_PREFETCH, 1, 1, true); 1343 content::RESOURCE_TYPE_PREFETCH, 1, 1, true);
1344 EXPECT_TRUE(URLRequestSummary::SummarizeResponse(*request_etag, &summary)); 1344 EXPECT_TRUE(URLRequestSummary::SummarizeResponse(*request_etag, &summary));
1345 EXPECT_TRUE(summary.has_validators); 1345 EXPECT_TRUE(summary.has_validators);
1346 EXPECT_TRUE(summary.always_revalidate); 1346 EXPECT_TRUE(summary.always_revalidate);
1347 } 1347 }
1348 1348
1349 } // namespace predictors 1349 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/predictors/resource_prefetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698