| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "content/browser/frame_host/navigation_handle_impl.h" | 6 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 7 #include "content/public/browser/navigation_throttle.h" | 7 #include "content/public/browser/navigation_throttle.h" |
| 8 #include "content/public/browser/ssl_status.h" | 8 #include "content/public/browser/ssl_status.h" |
| 9 #include "content/public/common/request_context_type.h" | 9 #include "content/public/common/request_context_type.h" |
| 10 #include "content/test/test_render_frame_host.h" | 10 #include "content/test/test_render_frame_host.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override { | 36 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override { |
| 37 ++will_redirect_calls_; | 37 ++will_redirect_calls_; |
| 38 return result_; | 38 return result_; |
| 39 } | 39 } |
| 40 | 40 |
| 41 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override { | 41 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override { |
| 42 ++will_process_response_calls_; | 42 ++will_process_response_calls_; |
| 43 return result_; | 43 return result_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 const char* GetNameForLogging() override { return "TestNavigationThrottle"; } |
| 47 |
| 46 int will_start_calls() const { return will_start_calls_; } | 48 int will_start_calls() const { return will_start_calls_; } |
| 47 int will_redirect_calls() const { return will_redirect_calls_; } | 49 int will_redirect_calls() const { return will_redirect_calls_; } |
| 48 int will_process_response_calls() const { | 50 int will_process_response_calls() const { |
| 49 return will_process_response_calls_; | 51 return will_process_response_calls_; |
| 50 } | 52 } |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 // The result returned by the TestNavigationThrottle. | 55 // The result returned by the TestNavigationThrottle. |
| 54 NavigationThrottle::ThrottleCheckResult result_; | 56 NavigationThrottle::ThrottleCheckResult result_; |
| 55 | 57 |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); | 730 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); |
| 729 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 731 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
| 730 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); | 732 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); |
| 731 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); | 733 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); |
| 732 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 734 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
| 733 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 735 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
| 734 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); | 736 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); |
| 735 } | 737 } |
| 736 | 738 |
| 737 } // namespace content | 739 } // namespace content |
| OLD | NEW |