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

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

Issue 2266653002: Previews infobar tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newLoFiInfoBarAddUMA
Patch Set: rebase 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.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index bb59cb07a25bbb960e2cd5965a3b2cc73a0f9460..b95c691e3975168323163d65aa0197dbfcc15462 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -305,10 +305,13 @@ NavigationHandleImpl::CallWillRedirectRequestForTesting(
NavigationThrottle::ThrottleCheckResult
NavigationHandleImpl::CallWillProcessResponseForTesting(
- content::RenderFrameHost* render_frame_host) {
+ content::RenderFrameHost* render_frame_host,
+ const std::string& raw_response_headers) {
+ scoped_refptr<net::HttpResponseHeaders> headers =
+ new net::HttpResponseHeaders(raw_response_headers);
NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host),
- scoped_refptr<net::HttpResponseHeaders>(), SSLStatus(),
+ headers, SSLStatus(),
base::Bind(&UpdateThrottleCheckResult, &result));
// Reset the callback to ensure it will not be called later.
@@ -316,6 +319,28 @@ NavigationHandleImpl::CallWillProcessResponseForTesting(
return result;
}
+void NavigationHandleImpl::CallDidCommitNavigationForTesting(const GURL& url) {
+ FrameHostMsg_DidCommitProvisionalLoad_Params params;
+
+ params.page_id = 1;
+ params.nav_entry_id = 1;
+ params.url = url;
+ params.referrer = content::Referrer();
+ params.transition = ui::PAGE_TRANSITION_TYPED;
+ params.redirects = std::vector<GURL>();
+ params.should_update_history = false;
+ params.searchable_form_url = GURL();
+ params.searchable_form_encoding = std::string();
+ params.did_create_new_entry = false;
+ params.gesture = NavigationGestureUser;
+ params.was_within_same_page = false;
+ params.method = "GET";
+ params.page_state = PageState::CreateFromURL(url);
+ params.contents_mime_type = std::string("text/html");
+
+ DidCommitNavigation(params, false, render_frame_host_);
+}
+
NavigationData* NavigationHandleImpl::GetNavigationData() {
return navigation_data_.get();
}

Powered by Google App Engine
This is Rietveld 408576698