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

Unified Diff: content/browser/frame_host/navigation_handle_impl_unittest.cc

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase after a month... 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_handle_impl_unittest.cc b/content/browser/frame_host/navigation_handle_impl_unittest.cc
index 4ab1f177e77bfe12c1dd80773927d55dd5c88104..99d2fd6dcb42a0283b40c1f16ec0f35a864d4954 100644
--- a/content/browser/frame_host/navigation_handle_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_handle_impl_unittest.cc
@@ -92,8 +92,12 @@ class NavigationHandleImplTest : public RenderViewHostImplTestHarness {
return test_handle_->state() == NavigationHandleImpl::DEFERRING_RESPONSE;
}
- bool IsCanceling() {
- return test_handle_->state() == NavigationHandleImpl::CANCELING;
+ bool IsCancelingRequest() {
+ return test_handle_->state() == NavigationHandleImpl::CANCELING_REQUEST;
+ }
+
+ bool IsCancelingResponse() {
+ return test_handle_->state() == NavigationHandleImpl::CANCELING_RESPONSE;
}
// Helper function to call WillStartRequest on |handle|. If this function
@@ -310,7 +314,7 @@ TEST_F(NavigationHandleImplTest, CancelDeferredWillStart) {
NavigationThrottle::CANCEL_AND_IGNORE);
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
- EXPECT_TRUE(IsCanceling());
+ EXPECT_TRUE(IsCancelingRequest());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
EXPECT_EQ(1, test_throttle->will_start_calls());
@@ -344,7 +348,7 @@ TEST_F(NavigationHandleImplTest, CancelDeferredWillRedirect) {
NavigationThrottle::CANCEL_AND_IGNORE);
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
- EXPECT_TRUE(IsCanceling());
+ EXPECT_TRUE(IsCancelingRequest());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
EXPECT_EQ(0, test_throttle->will_start_calls());
@@ -377,7 +381,7 @@ TEST_F(NavigationHandleImplTest, CancelDeferredNoIgnore) {
test_handle()->CancelDeferredNavigation(NavigationThrottle::CANCEL);
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
- EXPECT_TRUE(IsCanceling());
+ EXPECT_TRUE(IsCancelingRequest());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL, callback_result());
EXPECT_EQ(1, test_throttle->will_start_calls());
@@ -487,7 +491,7 @@ TEST_F(NavigationHandleImplTest, DeferThenCancelWillStartRequest) {
test_handle()->Resume();
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
- EXPECT_TRUE(IsCanceling());
+ EXPECT_TRUE(IsCancelingRequest());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
EXPECT_EQ(1, defer_throttle->will_start_calls());
@@ -530,7 +534,7 @@ TEST_F(NavigationHandleImplTest, DeferThenCancelWillRedirectRequest) {
test_handle()->Resume();
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
- EXPECT_TRUE(IsCanceling());
+ EXPECT_TRUE(IsCancelingRequest());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
EXPECT_EQ(0, defer_throttle->will_start_calls());
@@ -626,6 +630,7 @@ TEST_F(NavigationHandleImplTest, ProceedThenCancelWillProcessResponse) {
SimulateWillProcessResponse();
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
+ EXPECT_TRUE(IsCancelingResponse());
EXPECT_TRUE(was_callback_called());
EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result());
EXPECT_EQ(0, cancel_throttle->will_start_calls());
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/loader/navigation_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698