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

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

Issue 2411693003: Move blocking of top-level navigations to nested URLs with extension origins from non-extension pro… (Closed)
Patch Set: Created 4 years, 2 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 class NavigationHandleImplTest : public RenderViewHostImplTestHarness { 61 class NavigationHandleImplTest : public RenderViewHostImplTestHarness {
62 public: 62 public:
63 NavigationHandleImplTest() 63 NavigationHandleImplTest()
64 : was_callback_called_(false), 64 : was_callback_called_(false),
65 callback_result_(NavigationThrottle::DEFER) {} 65 callback_result_(NavigationThrottle::DEFER) {}
66 66
67 void SetUp() override { 67 void SetUp() override {
68 RenderViewHostImplTestHarness::SetUp(); 68 RenderViewHostImplTestHarness::SetUp();
69 test_handle_ = NavigationHandleImpl::Create( 69 test_handle_ = NavigationHandleImpl::Create(
70 GURL(), main_test_rfh()->frame_tree_node(), true, false, false, 70 GURL(), GURL(), main_test_rfh()->frame_tree_node(), true, false, false,
71 base::TimeTicks::Now(), 0, false); 71 base::TimeTicks::Now(), 0, false);
72 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, 72 EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED,
73 test_handle_->request_context_type_); 73 test_handle_->request_context_type_);
74 } 74 }
75 75
76 void TearDown() override { 76 void TearDown() override {
77 // Release the |test_handle_| before destroying the WebContents, to match 77 // Release the |test_handle_| before destroying the WebContents, to match
78 // the WebContentsObserverSanityChecker expectations. 78 // the WebContentsObserverSanityChecker expectations.
79 test_handle_.reset(); 79 test_handle_.reset();
80 RenderViewHostImplTestHarness::TearDown(); 80 RenderViewHostImplTestHarness::TearDown();
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); 663 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
664 EXPECT_EQ(0, cancel_throttle->will_start_calls()); 664 EXPECT_EQ(0, cancel_throttle->will_start_calls());
665 EXPECT_EQ(0, cancel_throttle->will_redirect_calls()); 665 EXPECT_EQ(0, cancel_throttle->will_redirect_calls());
666 EXPECT_EQ(1, cancel_throttle->will_process_response_calls()); 666 EXPECT_EQ(1, cancel_throttle->will_process_response_calls());
667 EXPECT_EQ(0, proceed_throttle->will_start_calls()); 667 EXPECT_EQ(0, proceed_throttle->will_start_calls());
668 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); 668 EXPECT_EQ(0, proceed_throttle->will_redirect_calls());
669 EXPECT_EQ(0, proceed_throttle->will_process_response_calls()); 669 EXPECT_EQ(0, proceed_throttle->will_process_response_calls());
670 } 670 }
671 671
672 } // namespace content 672 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698