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

Side by Side Diff: ios/web/public/test/fakes/crw_test_web_state_observer.mm

Issue 2901633002: Replaced NavigationContext::IsErrorPage with NavigationContext::GetError (Closed)
Patch Set: Created 3 years, 7 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 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 #import "ios/web/public/web_state/navigation_context.h"
9 #include "ios/web/web_state/navigation_context_impl.h" 9 #import "ios/web/web_state/navigation_context_impl.h"
10 #include "net/http/http_response_headers.h" 10 #include "net/http/http_response_headers.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace web { 13 namespace web {
14 TestFormActivityInfo::TestFormActivityInfo() {} 14 TestFormActivityInfo::TestFormActivityInfo() {}
15 TestFormActivityInfo::~TestFormActivityInfo() = default; 15 TestFormActivityInfo::~TestFormActivityInfo() = default;
16 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {} 16 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {}
17 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() = 17 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() =
18 default; 18 default;
19 } 19 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 - (web::TestStartLoadingInfo*)startLoadingInfo { 122 - (web::TestStartLoadingInfo*)startLoadingInfo {
123 return _startLoadingInfo.get(); 123 return _startLoadingInfo.get();
124 } 124 }
125 125
126 #pragma mark CRWWebStateObserver methods - 126 #pragma mark CRWWebStateObserver methods -
127 127
128 - (void)webState:(web::WebState*)webState 128 - (void)webState:(web::WebState*)webState
129 didStartNavigation:(web::NavigationContext*)navigation { 129 didStartNavigation:(web::NavigationContext*)navigation {
130 ASSERT_TRUE(!navigation->IsErrorPage() || !navigation->IsSameDocument()); 130 ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument());
131 _didStartNavigationInfo = base::MakeUnique<web::TestDidStartNavigationInfo>(); 131 _didStartNavigationInfo = base::MakeUnique<web::TestDidStartNavigationInfo>();
132 _didStartNavigationInfo->web_state = webState; 132 _didStartNavigationInfo->web_state = webState;
133 std::unique_ptr<web::NavigationContextImpl> context = 133 std::unique_ptr<web::NavigationContextImpl> context =
134 web::NavigationContextImpl::CreateNavigationContext( 134 web::NavigationContextImpl::CreateNavigationContext(
135 navigation->GetWebState(), navigation->GetUrl()); 135 navigation->GetWebState(), navigation->GetUrl());
136 context->SetIsSameDocument(navigation->IsSameDocument()); 136 context->SetIsSameDocument(navigation->IsSameDocument());
137 context->SetIsErrorPage(navigation->IsErrorPage()); 137 context->SetError(navigation->GetError());
138 _didStartNavigationInfo->context = std::move(context); 138 _didStartNavigationInfo->context = std::move(context);
139 } 139 }
140 140
141 - (void)webState:(web::WebState*)webState 141 - (void)webState:(web::WebState*)webState
142 didCommitNavigationWithDetails: 142 didCommitNavigationWithDetails:
143 (const web::LoadCommittedDetails&)load_details { 143 (const web::LoadCommittedDetails&)load_details {
144 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); 144 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>();
145 _commitNavigationInfo->web_state = webState; 145 _commitNavigationInfo->web_state = webState;
146 _commitNavigationInfo->load_details = load_details; 146 _commitNavigationInfo->load_details = load_details;
147 } 147 }
148 148
149 - (void)webState:(web::WebState*)webState 149 - (void)webState:(web::WebState*)webState
150 didFinishNavigation:(web::NavigationContext*)navigation { 150 didFinishNavigation:(web::NavigationContext*)navigation {
151 ASSERT_TRUE(!navigation->IsErrorPage() || !navigation->IsSameDocument()); 151 ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument());
152 _didFinishNavigationInfo = 152 _didFinishNavigationInfo =
153 base::MakeUnique<web::TestDidFinishNavigationInfo>(); 153 base::MakeUnique<web::TestDidFinishNavigationInfo>();
154 _didFinishNavigationInfo->web_state = webState; 154 _didFinishNavigationInfo->web_state = webState;
155 std::unique_ptr<web::NavigationContextImpl> context = 155 std::unique_ptr<web::NavigationContextImpl> context =
156 web::NavigationContextImpl::CreateNavigationContext( 156 web::NavigationContextImpl::CreateNavigationContext(
157 navigation->GetWebState(), navigation->GetUrl()); 157 navigation->GetWebState(), navigation->GetUrl());
158 context->SetIsSameDocument(navigation->IsSameDocument()); 158 context->SetIsSameDocument(navigation->IsSameDocument());
159 context->SetIsErrorPage(navigation->IsErrorPage()); 159 context->SetError(navigation->GetError());
160 _didFinishNavigationInfo->context = std::move(context); 160 _didFinishNavigationInfo->context = std::move(context);
161 } 161 }
162 162
163 - (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success { 163 - (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success {
164 _loadPageInfo = base::MakeUnique<web::TestLoadPageInfo>(); 164 _loadPageInfo = base::MakeUnique<web::TestLoadPageInfo>();
165 _loadPageInfo->web_state = webState; 165 _loadPageInfo->web_state = webState;
166 _loadPageInfo->success = success; 166 _loadPageInfo->success = success;
167 } 167 }
168 168
169 - (void)webStateDidDismissInterstitial:(web::WebState*)webState { 169 - (void)webStateDidDismissInterstitial:(web::WebState*)webState {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); 243 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>();
244 _stopLoadingInfo->web_state = webState; 244 _stopLoadingInfo->web_state = webState;
245 } 245 }
246 246
247 - (void)webStateDidStartLoading:(web::WebState*)webState { 247 - (void)webStateDidStartLoading:(web::WebState*)webState {
248 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); 248 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>();
249 _startLoadingInfo->web_state = webState; 249 _startLoadingInfo->web_state = webState;
250 } 250 }
251 251
252 @end 252 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab_unittest.mm ('k') | ios/web/public/test/fakes/test_web_state_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698