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

Unified Diff: content/test/test_navigation_url_loader.cc

Issue 953503002: PlzNavigate: test updates post beforeUnload IPC refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move some methods around. Created 5 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/test/test_navigation_url_loader.cc
diff --git a/content/test/test_navigation_url_loader.cc b/content/test/test_navigation_url_loader.cc
index 2d1488787789f90d9125998b40cd2da367c4d954..6eea8b2d7c7478b7d336ae661c7b3fbbbf4ceabc 100644
--- a/content/test/test_navigation_url_loader.cc
+++ b/content/test/test_navigation_url_loader.cc
@@ -6,6 +6,8 @@
#include "content/browser/loader/navigation_url_loader_delegate.h"
#include "content/public/browser/stream_handle.h"
+#include "content/public/common/resource_response.h"
+#include "net/url_request/redirect_info.h"
namespace content {
@@ -21,6 +23,16 @@ void TestNavigationURLLoader::FollowRedirect() {
redirect_count_++;
}
+void TestNavigationURLLoader::SimulateServerRedirect(const GURL& redirect_url) {
+ net::RedirectInfo redirect_info;
+ redirect_info.status_code = 302;
+ redirect_info.new_method = "GET";
+ redirect_info.new_url = redirect_url;
+ redirect_info.new_first_party_for_cookies = redirect_url;
+ scoped_refptr<ResourceResponse> response(new ResourceResponse);
+ CallOnRequestRedirected(redirect_info, response);
+}
+
void TestNavigationURLLoader::CallOnRequestRedirected(
const net::RedirectInfo& redirect_info,
const scoped_refptr<ResourceResponse>& response) {

Powered by Google App Engine
This is Rietveld 408576698