| Index: content/test/web_contents_observer_sanity_checker.cc
|
| diff --git a/content/test/web_contents_observer_sanity_checker.cc b/content/test/web_contents_observer_sanity_checker.cc
|
| index 82bcb60461840a005453f0d271ce50cd3de1e7bd..586ed47b105f7cecab8f1edc673ece28b2fba2d6 100644
|
| --- a/content/test/web_contents_observer_sanity_checker.cc
|
| +++ b/content/test/web_contents_observer_sanity_checker.cc
|
| @@ -124,7 +124,6 @@ void WebContentsObserverSanityChecker::FrameDeleted(
|
| void WebContentsObserverSanityChecker::DidStartNavigation(
|
| NavigationHandle* navigation_handle) {
|
| CHECK(!NavigationIsOngoing(navigation_handle));
|
| - CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
|
|
|
| CHECK(navigation_handle->GetNetErrorCode() == net::OK);
|
| CHECK(!navigation_handle->HasCommittedDocument());
|
| @@ -136,7 +135,6 @@ void WebContentsObserverSanityChecker::DidStartNavigation(
|
| void WebContentsObserverSanityChecker::DidRedirectNavigation(
|
| NavigationHandle* navigation_handle) {
|
| CHECK(NavigationIsOngoing(navigation_handle));
|
| - CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
|
|
|
| CHECK(navigation_handle->GetNetErrorCode() == net::OK);
|
| CHECK(!navigation_handle->HasCommittedDocument());
|
| @@ -146,41 +144,24 @@ void WebContentsObserverSanityChecker::DidRedirectNavigation(
|
| void WebContentsObserverSanityChecker::ReadyToCommitNavigation(
|
| NavigationHandle* navigation_handle) {
|
| CHECK(NavigationIsOngoing(navigation_handle));
|
| - CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
|
|
|
| CHECK(!navigation_handle->HasCommittedDocument());
|
| CHECK(!navigation_handle->HasCommittedErrorPage());
|
| -}
|
| -
|
| -void WebContentsObserverSanityChecker::DidCommitNavigation(
|
| - NavigationHandle* navigation_handle) {
|
| - CHECK(NavigationIsOngoing(navigation_handle));
|
| - CHECK(!NavigationIsOngoingAndCommitted(navigation_handle));
|
| -
|
| - CHECK_NE(navigation_handle->HasCommittedDocument(),
|
| - navigation_handle->HasCommittedErrorPage());
|
| - CHECK_IMPLIES(navigation_handle->HasCommittedDocument(),
|
| - navigation_handle->GetNetErrorCode() == net::OK);
|
| - CHECK_IMPLIES(navigation_handle->HasCommittedErrorPage(),
|
| - navigation_handle->GetNetErrorCode() != net::OK);
|
| -
|
| - ongoing_committed_navigations_.insert(navigation_handle);
|
| + CHECK(navigation_handle->GetRenderFrameHost());
|
| }
|
|
|
| void WebContentsObserverSanityChecker::DidFinishNavigation(
|
| NavigationHandle* navigation_handle) {
|
| CHECK(NavigationIsOngoing(navigation_handle));
|
|
|
| - CHECK_IMPLIES(NavigationIsOngoingAndCommitted(navigation_handle),
|
| - navigation_handle->HasCommittedDocument() !=
|
| - navigation_handle->HasCommittedErrorPage());
|
| CHECK_IMPLIES(navigation_handle->HasCommittedDocument(),
|
| navigation_handle->GetNetErrorCode() == net::OK);
|
| CHECK_IMPLIES(navigation_handle->HasCommittedErrorPage(),
|
| navigation_handle->GetNetErrorCode() != net::OK);
|
|
|
| - if (NavigationIsOngoingAndCommitted(navigation_handle))
|
| - ongoing_committed_navigations_.erase(navigation_handle);
|
| + CHECK_IMPLIES(navigation_handle->HasCommittedDocument() ||
|
| + navigation_handle->HasCommittedErrorPage(),
|
| + navigation_handle->GetRenderFrameHost() != nullptr);
|
|
|
| ongoing_navigations_.erase(navigation_handle);
|
| }
|
| @@ -287,7 +268,6 @@ void WebContentsObserverSanityChecker::WebContentsDestroyed() {
|
| CHECK(!web_contents_destroyed_);
|
| web_contents_destroyed_ = true;
|
| CHECK(ongoing_navigations_.empty());
|
| - CHECK(ongoing_committed_navigations_.empty());
|
| }
|
|
|
| WebContentsObserverSanityChecker::WebContentsObserverSanityChecker(
|
| @@ -340,10 +320,4 @@ bool WebContentsObserverSanityChecker::NavigationIsOngoing(
|
| return it != ongoing_navigations_.end();
|
| }
|
|
|
| -bool WebContentsObserverSanityChecker::NavigationIsOngoingAndCommitted(
|
| - NavigationHandle* navigation_handle) {
|
| - auto it = ongoing_committed_navigations_.find(navigation_handle);
|
| - return it != ongoing_committed_navigations_.end();
|
| -}
|
| -
|
| } // namespace content
|
|
|