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

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

Issue 1340163002: PlzNavigate: fix timing issue in app window creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-throttle
Patch Set: Addressed nits Created 5 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 "content/browser/frame_host/render_frame_host_impl.h" 8 #include "content/browser/frame_host/render_frame_host_impl.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/public/browser/navigation_handle.h" 10 #include "content/public/browser/navigation_handle.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 void WebContentsObserverSanityChecker::DidRedirectNavigation( 136 void WebContentsObserverSanityChecker::DidRedirectNavigation(
137 NavigationHandle* navigation_handle) { 137 NavigationHandle* navigation_handle) {
138 CHECK(NavigationIsOngoing(navigation_handle)); 138 CHECK(NavigationIsOngoing(navigation_handle));
139 CHECK(!NavigationIsOngoingAndCommitted(navigation_handle)); 139 CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
140 140
141 CHECK(navigation_handle->GetNetErrorCode() == net::OK); 141 CHECK(navigation_handle->GetNetErrorCode() == net::OK);
142 CHECK(!navigation_handle->HasCommittedDocument()); 142 CHECK(!navigation_handle->HasCommittedDocument());
143 CHECK(!navigation_handle->HasCommittedErrorPage()); 143 CHECK(!navigation_handle->HasCommittedErrorPage());
144 } 144 }
145 145
146 void WebContentsObserverSanityChecker::ReadyToCommitNavigation(
147 NavigationHandle* navigation_handle) {
148 CHECK(NavigationIsOngoing(navigation_handle));
149 CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
150
151 CHECK(!navigation_handle->HasCommittedDocument());
152 CHECK(!navigation_handle->HasCommittedErrorPage());
153 }
154
146 void WebContentsObserverSanityChecker::DidCommitNavigation( 155 void WebContentsObserverSanityChecker::DidCommitNavigation(
147 NavigationHandle* navigation_handle) { 156 NavigationHandle* navigation_handle) {
148 CHECK(NavigationIsOngoing(navigation_handle)); 157 CHECK(NavigationIsOngoing(navigation_handle));
149 CHECK(!NavigationIsOngoingAndCommitted(navigation_handle)); 158 CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
150 159
151 CHECK_NE(navigation_handle->HasCommittedDocument(), 160 CHECK_NE(navigation_handle->HasCommittedDocument(),
152 navigation_handle->HasCommittedErrorPage()); 161 navigation_handle->HasCommittedErrorPage());
153 CHECK_IMPLIES(navigation_handle->HasCommittedDocument(), 162 CHECK_IMPLIES(navigation_handle->HasCommittedDocument(),
154 navigation_handle->GetNetErrorCode() == net::OK); 163 navigation_handle->GetNetErrorCode() == net::OK);
155 CHECK_IMPLIES(navigation_handle->HasCommittedErrorPage(), 164 CHECK_IMPLIES(navigation_handle->HasCommittedErrorPage(),
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 return it != ongoing_navigations_.end(); 340 return it != ongoing_navigations_.end();
332 } 341 }
333 342
334 bool WebContentsObserverSanityChecker::NavigationIsOngoingAndCommitted( 343 bool WebContentsObserverSanityChecker::NavigationIsOngoingAndCommitted(
335 NavigationHandle* navigation_handle) { 344 NavigationHandle* navigation_handle) {
336 auto it = ongoing_committed_navigations_.find(navigation_handle); 345 auto it = ongoing_committed_navigations_.find(navigation_handle);
337 return it != ongoing_committed_navigations_.end(); 346 return it != ongoing_committed_navigations_.end();
338 } 347 }
339 348
340 } // namespace content 349 } // namespace content
OLDNEW
« no previous file with comments | « content/test/web_contents_observer_sanity_checker.h ('k') | extensions/browser/api/app_window/app_window_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698