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

Side by Side Diff: content/test/web_contents_observer_sanity_checker.cc

Issue 2345913002: Fix NetErrorTabHelper with PlzNavigate. (Closed)
Patch Set: fix NavigationHandle::IsErrorPage for reloads of error pages 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/test/web_contents_observer_sanity_checker.h" 5 #include "content/test/web_contents_observer_sanity_checker.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h" 9 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/common/frame_messages.h" 10 #include "content/common/frame_messages.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 CHECK(navigation_handle->GetRenderFrameHost() != nullptr); 194 CHECK(navigation_handle->GetRenderFrameHost() != nullptr);
195 } 195 }
196 196
197 void WebContentsObserverSanityChecker::DidFinishNavigation( 197 void WebContentsObserverSanityChecker::DidFinishNavigation(
198 NavigationHandle* navigation_handle) { 198 NavigationHandle* navigation_handle) {
199 CHECK(NavigationIsOngoing(navigation_handle)); 199 CHECK(NavigationIsOngoing(navigation_handle));
200 200
201 CHECK(!(navigation_handle->HasCommitted() && 201 CHECK(!(navigation_handle->HasCommitted() &&
202 !navigation_handle->IsErrorPage()) || 202 !navigation_handle->IsErrorPage()) ||
203 navigation_handle->GetNetErrorCode() == net::OK); 203 navigation_handle->GetNetErrorCode() == net::OK);
204 CHECK(!(navigation_handle->HasCommitted() &&
205 navigation_handle->IsErrorPage()) ||
206 navigation_handle->GetNetErrorCode() != net::OK);
clamy 2016/09/19 11:46:44 Rather than removing this check, can we expend it
jam 2016/09/19 14:19:40 if you mean navigation_handle->GetURL(), it'll be
clamy 2016/09/19 15:27:11 Acknowledged.
207 CHECK_EQ(navigation_handle->GetWebContents(), web_contents()); 204 CHECK_EQ(navigation_handle->GetWebContents(), web_contents());
208 205
209 CHECK(!navigation_handle->HasCommitted() || 206 CHECK(!navigation_handle->HasCommitted() ||
210 navigation_handle->GetRenderFrameHost() != nullptr); 207 navigation_handle->GetRenderFrameHost() != nullptr);
211 208
212 ongoing_navigations_.erase(navigation_handle); 209 ongoing_navigations_.erase(navigation_handle);
213 } 210 }
214 211
215 void WebContentsObserverSanityChecker::DidStartProvisionalLoadForFrame( 212 void WebContentsObserverSanityChecker::DidStartProvisionalLoadForFrame(
216 RenderFrameHost* render_frame_host, 213 RenderFrameHost* render_frame_host,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 if (live_routes_.count(entry.first)) 405 if (live_routes_.count(entry.first))
409 return true; 406 return true;
410 if (current_hosts_.count(entry.first)) 407 if (current_hosts_.count(entry.first))
411 return true; 408 return true;
412 } 409 }
413 } 410 }
414 return false; 411 return false;
415 } 412 }
416 413
417 } // namespace content 414 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698