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

Unified Diff: ios/web/public/test/fakes/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
Index: ios/web/public/test/fakes/test_web_state_observer.mm
diff --git a/ios/web/public/test/fakes/test_web_state_observer.mm b/ios/web/public/test/fakes/test_web_state_observer.mm
index 7a5a3b825b2d59f4ba00ae4585a2e6e43820c49e..a9ef9304630716e26ffeecf7fdfc97363ce3f12a 100644
--- a/ios/web/public/test/fakes/test_web_state_observer.mm
+++ b/ios/web/public/test/fakes/test_web_state_observer.mm
@@ -65,27 +65,17 @@ void TestWebStateObserver::NavigationItemChanged() {
navigation_item_changed_info_->web_state = web_state();
}
-void TestWebStateObserver::DidFinishNavigation(NavigationContext* context) {
+void TestWebStateObserver::DidFinishNavigation(NavigationContext* navigation) {
+ ASSERT_TRUE(!navigation->IsErrorPage() || !navigation->IsSameDocument());
did_finish_navigation_info_ =
base::MakeUnique<web::TestDidFinishNavigationInfo>();
did_finish_navigation_info_->web_state = web_state();
- if (context->IsSameDocument()) {
- ASSERT_FALSE(context->IsErrorPage());
- did_finish_navigation_info_->context =
- NavigationContextImpl::CreateSameDocumentNavigationContext(
- context->GetWebState(), context->GetUrl());
- } else if (context->IsErrorPage()) {
- ASSERT_FALSE(context->IsSameDocument());
- did_finish_navigation_info_->context =
- NavigationContextImpl::CreateErrorPageNavigationContext(
- context->GetWebState(), context->GetUrl(),
- context->GetResponseHeaders());
- } else {
- did_finish_navigation_info_->context =
- NavigationContextImpl::CreateNavigationContext(
- context->GetWebState(), context->GetUrl(),
- context->GetResponseHeaders());
- }
+ std::unique_ptr<web::NavigationContextImpl> context =
+ web::NavigationContextImpl::CreateNavigationContext(
+ navigation->GetWebState(), navigation->GetUrl());
+ context->SetIsSameDocument(navigation->IsSameDocument());
+ context->SetIsErrorPage(navigation->IsErrorPage());
+ did_finish_navigation_info_->context = std::move(context);
}
void TestWebStateObserver::TitleWasSet() {
« no previous file with comments | « ios/web/public/test/fakes/crw_test_web_state_observer.mm ('k') | ios/web/web_state/navigation_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698