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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 base::Bind(&NavigationSimulator::OnThrottleChecksComplete, | 569 base::Bind(&NavigationSimulator::OnThrottleChecksComplete, |
566 weak_factory_.GetWeakPtr())); | 570 weak_factory_.GetWeakPtr())); |
567 } | 571 } |
568 | 572 |
569 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() { | 573 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() { |
570 CHECK_EQ(state_, FINISHED); | 574 CHECK_EQ(state_, FINISHED); |
571 return render_frame_host_; | 575 return render_frame_host_; |
572 } | 576 } |
573 | 577 |
574 } // namespace content | 578 } // namespace content |
OLD | NEW |