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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(), std::vector<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 false); // should_bypass_main_world_csp |
76 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, | 77 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, |
77 test_handle_->request_context_type_); | 78 test_handle_->request_context_type_); |
78 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); | 79 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); |
79 } | 80 } |
80 | 81 |
81 void TearDown() override { | 82 void TearDown() override { |
82 // Release the |test_handle_| before destroying the WebContents, to match | 83 // Release the |test_handle_| before destroying the WebContents, to match |
83 // the WebContentsObserverSanityChecker expectations. | 84 // the WebContentsObserverSanityChecker expectations. |
84 test_handle_.reset(); | 85 test_handle_.reset(); |
85 RenderViewHostImplTestHarness::TearDown(); | 86 RenderViewHostImplTestHarness::TearDown(); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); | 727 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); |
727 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 728 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
728 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); | 729 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); |
729 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); | 730 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); |
730 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 731 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
731 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 732 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
732 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); | 733 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); |
733 } | 734 } |
734 | 735 |
735 } // namespace content | 736 } // namespace content |
OLD | NEW |