| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(), 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 false, // is_srcdoc | |
| 75 base::TimeTicks::Now(), 0, NavigationGestureAuto, | 74 base::TimeTicks::Now(), 0, NavigationGestureAuto, |
| 76 false); // started_from_context_menu | 75 false); // started_from_context_menu |
| 77 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, | 76 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, |
| 78 test_handle_->request_context_type_); | 77 test_handle_->request_context_type_); |
| 79 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); | 78 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); |
| 80 } | 79 } |
| 81 | 80 |
| 82 void TearDown() override { | 81 void TearDown() override { |
| 83 // Release the |test_handle_| before destroying the WebContents, to match | 82 // Release the |test_handle_| before destroying the WebContents, to match |
| 84 // the WebContentsObserverSanityChecker expectations. | 83 // the WebContentsObserverSanityChecker expectations. |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); | 688 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); |
| 690 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 689 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
| 691 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); | 690 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); |
| 692 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); | 691 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); |
| 693 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 692 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
| 694 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 693 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
| 695 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); | 694 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); |
| 696 } | 695 } |
| 697 | 696 |
| 698 } // namespace content | 697 } // namespace content |
| OLD | NEW |