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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |