| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 - (void)webState:(web::WebState*)webState | 144 - (void)webState:(web::WebState*)webState |
| 145 didFinishNavigation:(web::NavigationContext*)navigation { | 145 didFinishNavigation:(web::NavigationContext*)navigation { |
| 146 _didFinishNavigationInfo = | 146 _didFinishNavigationInfo = |
| 147 base::MakeUnique<web::TestDidFinishNavigationInfo>(); | 147 base::MakeUnique<web::TestDidFinishNavigationInfo>(); |
| 148 _didFinishNavigationInfo->web_state = webState; | 148 _didFinishNavigationInfo->web_state = webState; |
| 149 if (navigation->IsSameDocument()) { | 149 if (navigation->IsSameDocument()) { |
| 150 ASSERT_FALSE(navigation->IsErrorPage()); | 150 ASSERT_FALSE(navigation->IsErrorPage()); |
| 151 _didFinishNavigationInfo->context = | 151 _didFinishNavigationInfo->context = |
| 152 web::NavigationContextImpl::CreateSamePageNavigationContext( | 152 web::NavigationContextImpl::CreateSameDocumentNavigationContext( |
| 153 navigation->GetWebState(), navigation->GetUrl()); | 153 navigation->GetWebState(), navigation->GetUrl()); |
| 154 } else if (navigation->IsErrorPage()) { | 154 } else if (navigation->IsErrorPage()) { |
| 155 ASSERT_FALSE(navigation->IsSameDocument()); | 155 ASSERT_FALSE(navigation->IsSameDocument()); |
| 156 _didFinishNavigationInfo->context = | 156 _didFinishNavigationInfo->context = |
| 157 web::NavigationContextImpl::CreateErrorPageNavigationContext( | 157 web::NavigationContextImpl::CreateErrorPageNavigationContext( |
| 158 navigation->GetWebState(), navigation->GetUrl()); | 158 navigation->GetWebState(), navigation->GetUrl()); |
| 159 } else { | 159 } else { |
| 160 _didFinishNavigationInfo->context = | 160 _didFinishNavigationInfo->context = |
| 161 web::NavigationContextImpl::CreateNavigationContext( | 161 web::NavigationContextImpl::CreateNavigationContext( |
| 162 navigation->GetWebState(), navigation->GetUrl()); | 162 navigation->GetWebState(), navigation->GetUrl()); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); | 246 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 247 _stopLoadingInfo->web_state = webState; | 247 _stopLoadingInfo->web_state = webState; |
| 248 } | 248 } |
| 249 | 249 |
| 250 - (void)webStateDidStartLoading:(web::WebState*)webState { | 250 - (void)webStateDidStartLoading:(web::WebState*)webState { |
| 251 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); | 251 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 252 _startLoadingInfo->web_state = webState; | 252 _startLoadingInfo->web_state = webState; |
| 253 } | 253 } |
| 254 | 254 |
| 255 @end | 255 @end |
| OLD | NEW |