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

Unified Diff: ios/web/public/test/fakes/crw_test_web_state_observer.mm

Issue 2845913003: Cleaned up unused methods from WebStateImpl and NavigationContextImpl. (Closed)
Patch Set: Fixed tests 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/fakes/crw_test_web_state_observer.mm
diff --git a/ios/web/public/test/fakes/crw_test_web_state_observer.mm b/ios/web/public/test/fakes/crw_test_web_state_observer.mm
index efba022c3f8d673088c7faff3393f23b5675b67d..f109894f4393a338ff16bd19e35f6ce60967fff3 100644
--- a/ios/web/public/test/fakes/crw_test_web_state_observer.mm
+++ b/ios/web/public/test/fakes/crw_test_web_state_observer.mm
@@ -144,26 +144,16 @@ TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() =
- (void)webState:(web::WebState*)webState
didFinishNavigation:(web::NavigationContext*)navigation {
+ ASSERT_TRUE(!navigation->IsErrorPage() || !navigation->IsSameDocument());
_didFinishNavigationInfo =
base::MakeUnique<web::TestDidFinishNavigationInfo>();
_didFinishNavigationInfo->web_state = webState;
- if (navigation->IsSameDocument()) {
- ASSERT_FALSE(navigation->IsErrorPage());
- _didFinishNavigationInfo->context =
- web::NavigationContextImpl::CreateSameDocumentNavigationContext(
- navigation->GetWebState(), navigation->GetUrl());
- } else if (navigation->IsErrorPage()) {
- ASSERT_FALSE(navigation->IsSameDocument());
- _didFinishNavigationInfo->context =
- web::NavigationContextImpl::CreateErrorPageNavigationContext(
- navigation->GetWebState(), navigation->GetUrl(),
- navigation->GetResponseHeaders());
- } else {
- _didFinishNavigationInfo->context =
- web::NavigationContextImpl::CreateNavigationContext(
- navigation->GetWebState(), navigation->GetUrl(),
- navigation->GetResponseHeaders());
- }
+ std::unique_ptr<web::NavigationContextImpl> context =
+ web::NavigationContextImpl::CreateNavigationContext(
+ navigation->GetWebState(), navigation->GetUrl());
+ context->SetIsSameDocument(navigation->IsSameDocument());
+ context->SetIsErrorPage(navigation->IsErrorPage());
+ _didFinishNavigationInfo->context = std::move(context);
}
- (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success {
« 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