| 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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 bool resume_called() const { return resume_called_; } | 118 bool resume_called() const { return resume_called_; } |
| 119 | 119 |
| 120 // net::URLRequest::Delegate implementation: | 120 // net::URLRequest::Delegate implementation: |
| 121 void OnReceivedRedirect(net::URLRequest* request, | 121 void OnReceivedRedirect(net::URLRequest* request, |
| 122 const net::RedirectInfo& redirect_info, | 122 const net::RedirectInfo& redirect_info, |
| 123 bool* defer_redirect) override { | 123 bool* defer_redirect) override { |
| 124 // Defer the redirect either way. | 124 // Defer the redirect either way. |
| 125 *defer_redirect = true; | 125 *defer_redirect = true; |
| 126 | 126 |
| 127 // Find out what the throttle would have done. | 127 // Find out what the throttle would have done. |
| 128 throttle_->WillRedirectRequest(redirect_info.new_url, &was_deferred_); | 128 throttle_->WillRedirectRequest(redirect_info, &was_deferred_); |
| 129 run_loop_->Quit(); | 129 run_loop_->Quit(); |
| 130 } | 130 } |
| 131 void OnResponseStarted(net::URLRequest* request) override {} | 131 void OnResponseStarted(net::URLRequest* request) override {} |
| 132 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} | 132 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} |
| 133 | 133 |
| 134 // content::ResourceController implementation: | 134 // content::ResourceController implementation: |
| 135 void Cancel() override { | 135 void Cancel() override { |
| 136 EXPECT_FALSE(cancel_called_); | 136 EXPECT_FALSE(cancel_called_); |
| 137 EXPECT_FALSE(resume_called_); | 137 EXPECT_FALSE(resume_called_); |
| 138 | 138 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // We should have cancelled the prerender. | 343 // We should have cancelled the prerender. |
| 344 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, | 344 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, |
| 345 test_contents()->final_status()); | 345 test_contents()->final_status()); |
| 346 | 346 |
| 347 // Cleanup work so the prerender is gone. | 347 // Cleanup work so the prerender is gone. |
| 348 test_contents()->Cancel(); | 348 test_contents()->Cancel(); |
| 349 RunEvents(); | 349 RunEvents(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace prerender | 352 } // namespace prerender |
| OLD | NEW |