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

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

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Ugh. Created 4 years, 3 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 d341c118e1e159ced536f1dbc9765158b3886957..caa50ce284eeba4373a3ec45f310f098043c1947 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
@@ -309,7 +313,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());
@@ -343,7 +347,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());
@@ -376,7 +380,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());
@@ -486,7 +490,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());
@@ -529,7 +533,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());
@@ -625,6 +629,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());

Powered by Google App Engine
This is Rietveld 408576698