| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" | 5 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ios/web/public/web_state/navigation_context.h" | 8 #include "ios/web/public/web_state/navigation_context.h" |
| 9 #include "ios/web/web_state/navigation_context_impl.h" | 9 #include "ios/web/web_state/navigation_context_impl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); | 125 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); |
| 126 _commitNavigationInfo->web_state = webState; | 126 _commitNavigationInfo->web_state = webState; |
| 127 _commitNavigationInfo->load_details = load_details; | 127 _commitNavigationInfo->load_details = load_details; |
| 128 } | 128 } |
| 129 | 129 |
| 130 - (void)webState:(web::WebState*)webState | 130 - (void)webState:(web::WebState*)webState |
| 131 didFinishNavigation:(web::NavigationContext*)navigation { | 131 didFinishNavigation:(web::NavigationContext*)navigation { |
| 132 _didFinishNavigationInfo = | 132 _didFinishNavigationInfo = |
| 133 base::MakeUnique<web::TestDidFinishNavigationInfo>(); | 133 base::MakeUnique<web::TestDidFinishNavigationInfo>(); |
| 134 _didFinishNavigationInfo->web_state = webState; | 134 _didFinishNavigationInfo->web_state = webState; |
| 135 if (navigation->IsSamePage()) { | 135 if (navigation->IsSameDocument()) { |
| 136 ASSERT_FALSE(navigation->IsErrorPage()); | 136 ASSERT_FALSE(navigation->IsErrorPage()); |
| 137 _didFinishNavigationInfo->context = | 137 _didFinishNavigationInfo->context = |
| 138 web::NavigationContextImpl::CreateSamePageNavigationContext( | 138 web::NavigationContextImpl::CreateSamePageNavigationContext( |
| 139 navigation->GetWebState(), navigation->GetUrl()); | 139 navigation->GetWebState(), navigation->GetUrl()); |
| 140 } else if (navigation->IsErrorPage()) { | 140 } else if (navigation->IsErrorPage()) { |
| 141 ASSERT_FALSE(navigation->IsSamePage()); | 141 ASSERT_FALSE(navigation->IsSameDocument()); |
| 142 _didFinishNavigationInfo->context = | 142 _didFinishNavigationInfo->context = |
| 143 web::NavigationContextImpl::CreateErrorPageNavigationContext( | 143 web::NavigationContextImpl::CreateErrorPageNavigationContext( |
| 144 navigation->GetWebState(), navigation->GetUrl()); | 144 navigation->GetWebState(), navigation->GetUrl()); |
| 145 } else { | 145 } else { |
| 146 _didFinishNavigationInfo->context = | 146 _didFinishNavigationInfo->context = |
| 147 web::NavigationContextImpl::CreateNavigationContext( | 147 web::NavigationContextImpl::CreateNavigationContext( |
| 148 navigation->GetWebState(), navigation->GetUrl()); | 148 navigation->GetWebState(), navigation->GetUrl()); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); | 221 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 222 _stopLoadingInfo->web_state = webState; | 222 _stopLoadingInfo->web_state = webState; |
| 223 } | 223 } |
| 224 | 224 |
| 225 - (void)webStateDidStartLoading:(web::WebState*)webState { | 225 - (void)webStateDidStartLoading:(web::WebState*)webState { |
| 226 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); | 226 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 227 _startLoadingInfo->web_state = webState; | 227 _startLoadingInfo->web_state = webState; |
| 228 } | 228 } |
| 229 | 229 |
| 230 @end | 230 @end |
| OLD | NEW |