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

Side by Side Diff: chrome/browser/prerender/prerender_resource_throttle_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 (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 <set> 5 #include <set>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void OnReceivedRedirect(net::URLRequest* request, 119 void OnReceivedRedirect(net::URLRequest* request,
120 const net::RedirectInfo& redirect_info, 120 const net::RedirectInfo& redirect_info,
121 bool* defer_redirect) override { 121 bool* defer_redirect) override {
122 // Defer the redirect either way. 122 // Defer the redirect either way.
123 *defer_redirect = true; 123 *defer_redirect = true;
124 124
125 // Find out what the throttle would have done. 125 // Find out what the throttle would have done.
126 throttle_->WillRedirectRequest(redirect_info, &was_deferred_); 126 throttle_->WillRedirectRequest(redirect_info, &was_deferred_);
127 run_loop_->Quit(); 127 run_loop_->Quit();
128 } 128 }
129 void OnResponseStarted(net::URLRequest* request) override {} 129 void OnResponseStarted(net::URLRequest* request, int net_error) override {}
130 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} 130 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {}
131 131
132 // content::ResourceController implementation: 132 // content::ResourceController implementation:
133 void Cancel() override { 133 void Cancel() override {
134 EXPECT_FALSE(cancel_called_); 134 EXPECT_FALSE(cancel_called_);
135 EXPECT_FALSE(resume_called_); 135 EXPECT_FALSE(resume_called_);
136 136
137 cancel_called_ = true; 137 cancel_called_ = true;
138 run_loop_->Quit(); 138 run_loop_->Quit();
139 } 139 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // We should have cancelled the prerender. 322 // We should have cancelled the prerender.
323 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, 323 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT,
324 test_contents()->final_status()); 324 test_contents()->final_status());
325 325
326 // Cleanup work so the prerender is gone. 326 // Cleanup work so the prerender is gone.
327 test_contents()->Cancel(); 327 test_contents()->Cancel();
328 RunEvents(); 328 RunEvents();
329 } 329 }
330 330
331 } // namespace prerender 331 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698