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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2669013002: Convert ClientSideDetectionHost to use the new navigation callbacks. (Closed)
Patch Set: nit Created 3 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
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame_host.cc
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 928e237ab677872d00ae180b27354868f1e2cf68..ff25114a8d9eedd504dcedbedb014f2c7078b416 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -24,6 +24,7 @@
#include "content/test/test_render_view_host.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "net/base/load_flags.h"
+#include "net/http/http_response_headers.h"
#include "third_party/WebKit/public/platform/WebMixedContentContextType.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
#include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom.h"
@@ -399,6 +400,13 @@ void TestRenderFrameHost::SendNavigateWithParameters(
void TestRenderFrameHost::SendNavigateWithParams(
FrameHostMsg_DidCommitProvisionalLoad_Params* params) {
+ if (navigation_handle()) {
+ scoped_refptr<net::HttpResponseHeaders> response_headers =
+ new net::HttpResponseHeaders(std::string());
+ response_headers->AddHeader(
+ std::string("Content-Type: ") + contents_mime_type_);
+ navigation_handle()->set_response_headers_for_testing(response_headers);
+ }
FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), *params);
OnDidCommitProvisionalLoad(msg);
last_commit_was_error_page_ = params->url_is_unreachable;
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698