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

Unified Diff: ios/chrome/browser/tabs/tab_unittest.mm

Issue 2879413002: Pass NavigationContext to WebStateImpl::OnNavigationStarted. (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 | « no previous file | ios/web/web_state/navigation_callbacks_inttest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_unittest.mm
diff --git a/ios/chrome/browser/tabs/tab_unittest.mm b/ios/chrome/browser/tabs/tab_unittest.mm
index 76d2518ff4380daec5bef5ff334c2d4a3c9193e8..d9ad849212682060903741ba4615d98375ed6bc2 100644
--- a/ios/chrome/browser/tabs/tab_unittest.mm
+++ b/ios/chrome/browser/tabs/tab_unittest.mm
@@ -232,7 +232,10 @@ class TabTest : public BlockCleanupTest {
DCHECK_EQ(tab_.get().webState, web_state_impl_.get());
[tab_ webWillAddPendingURL:userUrl transition:ui::PAGE_TRANSITION_TYPED];
- web_state_impl_->OnProvisionalNavigationStarted(userUrl);
+ std::unique_ptr<web::NavigationContext> context1 =
+ web::NavigationContextImpl::CreateNavigationContext(
+ web_state_impl_.get(), userUrl);
+ web_state_impl_->OnNavigationStarted(context1.get());
[tab_ webWillAddPendingURL:redirectUrl
transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT];
@@ -242,13 +245,13 @@ class TabTest : public BlockCleanupTest {
web::NavigationInitiationType::RENDERER_INITIATED,
web::NavigationManager::UserAgentOverrideOption::INHERIT);
- web_state_impl_->OnProvisionalNavigationStarted(redirectUrl);
- [[tab_ navigationManagerImpl]->GetSessionController() commitPendingItem];
- web_state_impl_->UpdateHttpResponseHeaders(redirectUrl);
- std::unique_ptr<web::NavigationContext> context =
+ std::unique_ptr<web::NavigationContext> context2 =
web::NavigationContextImpl::CreateNavigationContext(
web_state_impl_.get(), redirectUrl);
- web_state_impl_->OnNavigationFinished(context.get());
+ web_state_impl_->OnNavigationStarted(context2.get());
+ [[tab_ navigationManagerImpl]->GetSessionController() commitPendingItem];
+ web_state_impl_->UpdateHttpResponseHeaders(redirectUrl);
+ web_state_impl_->OnNavigationFinished(context2.get());
base::string16 new_title = base::SysNSStringToUTF16(title);
[tab_ navigationManager]->GetLastCommittedItem()->SetTitle(new_title);
« no previous file with comments | « no previous file | ios/web/web_state/navigation_callbacks_inttest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698