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

Unified Diff: ios/web/web_state/web_state_impl_unittest.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/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/web_state_observer_bridge_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl_unittest.mm
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm
index 78627b74f5801f93672e60e00cf2b0847ab56137..e4c327385f326c4a4d4fa1bfbd427463055f28e9 100644
--- a/ios/web/web_state/web_state_impl_unittest.mm
+++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -351,8 +351,7 @@ TEST_F(WebStateImplTest, ObserverTest) {
ASSERT_FALSE(observer->did_finish_navigation_info());
const GURL url("http://test");
std::unique_ptr<web::NavigationContext> context =
- NavigationContextImpl::CreateNavigationContext(
- web_state_.get(), url, nullptr /* response_headers */);
+ NavigationContextImpl::CreateNavigationContext(web_state_.get(), url);
web_state_->OnNavigationFinished(context.get());
ASSERT_TRUE(observer->did_finish_navigation_info());
EXPECT_EQ(web_state_.get(),
@@ -410,37 +409,8 @@ TEST_F(WebStateImplTest, ObserverTest) {
EXPECT_EQ(web_state_.get(), observer->load_page_info()->web_state);
EXPECT_TRUE(observer->load_page_info()->success);
- // Reset the observer and test that DidFinishNavigation() is called
- // for same document navigations.
- observer = base::MakeUnique<TestWebStateObserver>(web_state_.get());
- ASSERT_FALSE(observer->did_finish_navigation_info());
- web_state_->OnSameDocumentNavigation(url);
- ASSERT_TRUE(observer->did_finish_navigation_info());
- EXPECT_EQ(web_state_.get(),
- observer->did_finish_navigation_info()->web_state);
- actual_context = observer->did_finish_navigation_info()->context.get();
- ASSERT_TRUE(actual_context);
- EXPECT_EQ(url, actual_context->GetUrl());
- EXPECT_TRUE(actual_context->IsSameDocument());
- EXPECT_FALSE(actual_context->IsErrorPage());
- EXPECT_FALSE(actual_context->GetResponseHeaders());
-
- // Reset the observer and test that DidFinishNavigation() is called
- // for error navigations.
- observer = base::MakeUnique<TestWebStateObserver>(web_state_.get());
- ASSERT_FALSE(observer->did_finish_navigation_info());
- web_state_->OnErrorPageNavigation(url);
- ASSERT_TRUE(observer->did_finish_navigation_info());
- EXPECT_EQ(web_state_.get(),
- observer->did_finish_navigation_info()->web_state);
- actual_context = observer->did_finish_navigation_info()->context.get();
- ASSERT_TRUE(actual_context);
- EXPECT_EQ(url, actual_context->GetUrl());
- EXPECT_FALSE(actual_context->IsSameDocument());
- EXPECT_TRUE(actual_context->IsErrorPage());
- EXPECT_FALSE(actual_context->GetResponseHeaders());
-
// Test that OnTitleChanged() is called.
+ observer = base::MakeUnique<TestWebStateObserver>(web_state_.get());
ASSERT_FALSE(observer->title_was_set_info());
web_state_->OnTitleChanged();
ASSERT_TRUE(observer->title_was_set_info());
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/web_state_observer_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698