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

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: remove a file that has already been uploaded with another CL 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 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 28 matching lines...) Expand all
39 typedef ResourcePrefetchPredictorTables::PrefetchData PrefetchData; 39 typedef ResourcePrefetchPredictorTables::PrefetchData PrefetchData;
40 typedef ResourcePrefetchPredictorTables::PrefetchDataMap PrefetchDataMap; 40 typedef ResourcePrefetchPredictorTables::PrefetchDataMap PrefetchDataMap;
41 41
42 scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders( 42 scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders(
43 const char* headers) { 43 const char* headers) {
44 return make_scoped_refptr(new net::HttpResponseHeaders( 44 return make_scoped_refptr(new net::HttpResponseHeaders(
45 net::HttpUtil::AssembleRawHeaders(headers, strlen(headers)))); 45 net::HttpUtil::AssembleRawHeaders(headers, strlen(headers))));
46 } 46 }
47 47
48 class EmptyURLRequestDelegate : public net::URLRequest::Delegate { 48 class EmptyURLRequestDelegate : public net::URLRequest::Delegate {
49 void OnResponseStarted(net::URLRequest* request) override {} 49 void OnResponseStarted(net::URLRequest* request, int net_error) override {}
50 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} 50 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {}
51 }; 51 };
52 52
53 class MockURLRequestJob : public net::URLRequestJob { 53 class MockURLRequestJob : public net::URLRequestJob {
54 public: 54 public:
55 MockURLRequestJob(net::URLRequest* request, 55 MockURLRequestJob(net::URLRequest* request,
56 const net::HttpResponseInfo& response_info, 56 const net::HttpResponseInfo& response_info,
57 const std::string& mime_type) 57 const std::string& mime_type)
58 : net::URLRequestJob(request, nullptr), 58 : net::URLRequestJob(request, nullptr),
59 response_info_(response_info), 59 response_info_(response_info),
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 url_request_job_factory_.set_response_info(response_info); 1043 url_request_job_factory_.set_response_info(response_info);
1044 std::unique_ptr<net::URLRequest> request_etag = 1044 std::unique_ptr<net::URLRequest> request_etag =
1045 CreateURLRequest(GURL("http://www.google.com/cat.png"), net::MEDIUM, 1045 CreateURLRequest(GURL("http://www.google.com/cat.png"), net::MEDIUM,
1046 content::RESOURCE_TYPE_PREFETCH, 1, 1, true); 1046 content::RESOURCE_TYPE_PREFETCH, 1, 1, true);
1047 EXPECT_TRUE(URLRequestSummary::SummarizeResponse(*request_etag, &summary)); 1047 EXPECT_TRUE(URLRequestSummary::SummarizeResponse(*request_etag, &summary));
1048 EXPECT_TRUE(summary.has_validators); 1048 EXPECT_TRUE(summary.has_validators);
1049 EXPECT_TRUE(summary.always_revalidate); 1049 EXPECT_TRUE(summary.always_revalidate);
1050 } 1050 }
1051 1051
1052 } // namespace predictors 1052 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698