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

Side by Side Diff: chrome/browser/predictors/resource_prefetcher_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_prefetcher.h" 5 #include "chrome/browser/predictors/resource_prefetcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL); 118 prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL);
119 } 119 }
120 void OnCertificateRequested(const std::string& url) { 120 void OnCertificateRequested(const std::string& url) {
121 prefetcher_->OnCertificateRequested(GetInFlightRequest(url), NULL); 121 prefetcher_->OnCertificateRequested(GetInFlightRequest(url), NULL);
122 } 122 }
123 void OnSSLCertificateError(const std::string& url) { 123 void OnSSLCertificateError(const std::string& url) {
124 prefetcher_->OnSSLCertificateError(GetInFlightRequest(url), 124 prefetcher_->OnSSLCertificateError(GetInFlightRequest(url),
125 net::SSLInfo(), false); 125 net::SSLInfo(), false);
126 } 126 }
127 void OnResponse(const std::string& url) { 127 void OnResponse(const std::string& url) {
128 prefetcher_->OnResponseStarted(GetInFlightRequest(url)); 128 prefetcher_->OnResponseStarted(GetInFlightRequest(url), net::OK);
129 } 129 }
130 130
131 base::MessageLoop loop_; 131 base::MessageLoop loop_;
132 content::TestBrowserThread io_thread_; 132 content::TestBrowserThread io_thread_;
133 ResourcePrefetchPredictorConfig config_; 133 ResourcePrefetchPredictorConfig config_;
134 TestResourcePrefetcherDelegate prefetcher_delegate_; 134 TestResourcePrefetcherDelegate prefetcher_delegate_;
135 std::unique_ptr<TestResourcePrefetcher> prefetcher_; 135 std::unique_ptr<TestResourcePrefetcher> prefetcher_;
136 136
137 private: 137 private:
138 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcherTest); 138 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcherTest);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 // Expect the final call. 268 // Expect the final call.
269 EXPECT_CALL(prefetcher_delegate_, 269 EXPECT_CALL(prefetcher_delegate_,
270 ResourcePrefetcherFinished(Eq(prefetcher_.get()))); 270 ResourcePrefetcherFinished(Eq(prefetcher_.get())));
271 271
272 OnResponse("http://m.google.com/resource1.jpg"); 272 OnResponse("http://m.google.com/resource1.jpg");
273 CheckPrefetcherState(0, 1, 0); 273 CheckPrefetcherState(0, 1, 0);
274 } 274 }
275 275
276 } // namespace predictors 276 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetcher.cc ('k') | chrome/browser/prerender/prerender_resource_throttle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698