Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl_unittest.cc

Issue 2756913002: Revert of PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 CSPDisposition::CHECK); // should_check_main_world_csp
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.
85 test_handle_.reset(); 84 test_handle_.reset();
86 RenderViewHostImplTestHarness::TearDown(); 85 RenderViewHostImplTestHarness::TearDown();
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result()); 726 EXPECT_EQ(NavigationThrottle::BLOCK_RESPONSE, callback_result());
728 EXPECT_EQ(0, cancel_throttle->will_start_calls()); 727 EXPECT_EQ(0, cancel_throttle->will_start_calls());
729 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); 728 EXPECT_EQ(0, cancel_throttle->will_redirect_calls());
730 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); 729 EXPECT_EQ(1, cancel_throttle->will_process_response_calls());
731 EXPECT_EQ(0, proceed_throttle->will_start_calls()); 730 EXPECT_EQ(0, proceed_throttle->will_start_calls());
732 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); 731 EXPECT_EQ(0, proceed_throttle->will_redirect_calls());
733 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); 732 EXPECT_EQ(0, proceed_throttle->will_process_response_calls());
734 } 733 }
735 734
736 } // namespace content 735 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/frame_host/navigation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698