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

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

Issue 2488743003: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase Created 4 years 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 0cd750d883ec7c5f12a9521f9a78cdbbb29d5ab4..ebd4295d522908ed4681511768781be486971df4 100644
--- a/content/browser/frame_host/navigation_handle_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_handle_impl_unittest.cc
@@ -98,8 +98,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() {
clamy 2016/12/06 17:09:44 I don't see this function being used in the tests.
arthursonzogni 2016/12/07 16:25:02 Good idea. Instead, I merged the two state, this f
+ return test_handle_->state() == NavigationHandleImpl::CANCELING_RESPONSE;
}
// Helper function to call WillStartRequest on |handle|. If this function
@@ -336,7 +340,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());
@@ -370,7 +374,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());
@@ -403,7 +407,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());
@@ -513,7 +517,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());
@@ -556,7 +560,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());
@@ -652,6 +656,7 @@ TEST_F(NavigationHandleImplTest, ProceedThenCancelWillProcessResponse) {
SimulateWillProcessResponse();
EXPECT_FALSE(IsDeferringStart());
EXPECT_FALSE(IsDeferringRedirect());
+ EXPECT_TRUE(IsCancelingRequest());
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