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

Unified Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 143183009: When cross-site navigations are cancelled, delete the request being transferred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: reupload, undo unneeded change Created 6 years, 10 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/loader/resource_dispatcher_host_unittest.cc
===================================================================
--- content/browser/loader/resource_dispatcher_host_unittest.cc (revision 250813)
+++ content/browser/loader/resource_dispatcher_host_unittest.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/strings/string_split.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/child_process_security_policy_impl.h"
+#include "content/browser/loader/cross_site_resource_handler.h"
#include "content/browser/loader/detachable_resource_handler.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/loader/resource_loader.h"
@@ -2171,6 +2172,10 @@
// Test transferred navigations with text/html, which doesn't trigger any
// content sniffing.
TEST_F(ResourceDispatcherHostTest, TransferNavigationHtml) {
+ // This test expects the cross site request to be leaked, so it can transfer
+ // the request directly.
+ CrossSiteResourceHandler::SetLeakRequestsForTesting(true);
+
EXPECT_EQ(0, host_.pending_requests());
int render_view_id = 0;
@@ -2243,6 +2248,10 @@
// BufferedResourceHandler to buffer the response to sniff the content
// before the transfer occurs.
TEST_F(ResourceDispatcherHostTest, TransferNavigationText) {
+ // This test expects the cross site request to be leaked, so it can transfer
+ // the request directly.
+ CrossSiteResourceHandler::SetLeakRequestsForTesting(true);
+
EXPECT_EQ(0, host_.pending_requests());
int render_view_id = 0;
@@ -2314,6 +2323,10 @@
}
TEST_F(ResourceDispatcherHostTest, TransferNavigationWithProcessCrash) {
+ // This test expects the cross site request to be leaked, so it can transfer
+ // the request directly.
+ CrossSiteResourceHandler::SetLeakRequestsForTesting(true);
+
EXPECT_EQ(0, host_.pending_requests());
int render_view_id = 0;
@@ -2404,6 +2417,10 @@
}
TEST_F(ResourceDispatcherHostTest, TransferNavigationWithTwoRedirects) {
+ // This test expects the cross site request to be leaked, so it can transfer
+ // the request directly.
+ CrossSiteResourceHandler::SetLeakRequestsForTesting(true);
+
EXPECT_EQ(0, host_.pending_requests());
int render_view_id = 0;

Powered by Google App Engine
This is Rietveld 408576698