| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/public/test/navigation_simulator.h" | 5 #include "content/public/test/navigation_simulator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override { | 42 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override { |
| 43 on_will_redirect_request_.Run(); | 43 on_will_redirect_request_.Run(); |
| 44 return NavigationThrottle::PROCEED; | 44 return NavigationThrottle::PROCEED; |
| 45 } | 45 } |
| 46 | 46 |
| 47 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override { | 47 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override { |
| 48 on_will_process_response_.Run(); | 48 on_will_process_response_.Run(); |
| 49 return NavigationThrottle::PROCEED; | 49 return NavigationThrottle::PROCEED; |
| 50 } | 50 } |
| 51 | 51 |
| 52 const char* GetNameForLogging() override { |
| 53 return "NavigationThrottleCallbackRunner"; |
| 54 } |
| 55 |
| 52 private: | 56 private: |
| 53 base::Closure on_will_start_request_; | 57 base::Closure on_will_start_request_; |
| 54 base::Closure on_will_redirect_request_; | 58 base::Closure on_will_redirect_request_; |
| 55 base::Closure on_will_process_response_; | 59 base::Closure on_will_process_response_; |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 } // namespace | 62 } // namespace |
| 59 | 63 |
| 60 // static | 64 // static |
| 61 void NavigationSimulator::NavigateAndCommitFromDocument( | 65 void NavigationSimulator::NavigateAndCommitFromDocument( |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 base::Bind(&NavigationSimulator::OnThrottleChecksComplete, | 563 base::Bind(&NavigationSimulator::OnThrottleChecksComplete, |
| 560 weak_factory_.GetWeakPtr())); | 564 weak_factory_.GetWeakPtr())); |
| 561 } | 565 } |
| 562 | 566 |
| 563 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() { | 567 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() { |
| 564 CHECK_EQ(state_, FINISHED); | 568 CHECK_EQ(state_, FINISHED); |
| 565 return render_frame_host_; | 569 return render_frame_host_; |
| 566 } | 570 } |
| 567 | 571 |
| 568 } // namespace content | 572 } // namespace content |
| OLD | NEW |