| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 class NavigationHandleImplTest : public RenderViewHostImplTestHarness { | 62 class NavigationHandleImplTest : public RenderViewHostImplTestHarness { |
| 63 public: | 63 public: |
| 64 NavigationHandleImplTest() | 64 NavigationHandleImplTest() |
| 65 : was_callback_called_(false), | 65 : was_callback_called_(false), |
| 66 callback_result_(NavigationThrottle::DEFER) {} | 66 callback_result_(NavigationThrottle::DEFER) {} |
| 67 | 67 |
| 68 void SetUp() override { | 68 void SetUp() override { |
| 69 RenderViewHostImplTestHarness::SetUp(); | 69 RenderViewHostImplTestHarness::SetUp(); |
| 70 test_handle_ = NavigationHandleImpl::Create( | 70 test_handle_ = NavigationHandleImpl::Create( |
| 71 GURL(), main_test_rfh()->frame_tree_node(), | 71 GURL(), std::vector<GURL>(), main_test_rfh()->frame_tree_node(), |
| 72 true, // is_renderer_initiated | 72 true, // is_renderer_initiated |
| 73 false, // is_same_page | 73 false, // is_same_page |
| 74 base::TimeTicks::Now(), 0, | 74 base::TimeTicks::Now(), 0, |
| 75 false); // started_from_context_menu | 75 false); // started_from_context_menu |
| 76 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, | 76 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, |
| 77 test_handle_->request_context_type_); | 77 test_handle_->request_context_type_); |
| 78 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); | 78 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void TearDown() override { | 81 void TearDown() override { |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); | 726 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); |
| 727 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 727 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
| 728 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); | 728 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); |
| 729 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); | 729 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); |
| 730 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 730 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
| 731 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 731 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
| 732 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); | 732 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace content | 735 } // namespace content |
| OLD | NEW |