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

Unified Diff: ios/web/navigation/navigation_manager_impl_unittest.mm

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: Remove unused methods in navigation manager delegate Created 3 years, 9 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/navigation/navigation_manager_impl_unittest.mm
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm
index 38394c937603ad695921d37fd62384cc3dc0aa05..1f9b3f0aac1dd0abfda4c09787aa6c690bacb717 100644
--- a/ios/web/navigation/navigation_manager_impl_unittest.mm
+++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -598,4 +598,19 @@ void OnNavigationItemCommitted(const LoadCommittedDetails&) override {}
EXPECT_EQ(item2->GetUserAgentType(), item3->GetUserAgentType());
}
Eugene But (OOO till 7-30) 2017/03/15 17:53:32 Can we add more tests? Specifically tests which wo
+// Tests that calling |Reload| on NavigationManager leaves the Url of the
+// visible item unchanged.
+TEST_F(NavigationManagerTest, ReloadWithNormalReloadType) {
+ navigation_manager()->AddPendingItem(
+ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED,
+ web::NavigationInitiationType::USER_INITIATED);
+ ASSERT_TRUE(navigation_manager()->GetVisibleItem());
+
+ GURL url_before_reload = navigation_manager()->GetVisibleItem()->GetURL();
+ navigation_manager()->Reload(web::ReloadType::NORMAL, true);
Eugene But (OOO till 7-30) 2017/03/15 17:53:32 nit: /*check_for_repost*/
+
+ EXPECT_EQ(url_before_reload,
+ navigation_manager()->GetVisibleItem()->GetURL());
+}
+
} // namespace web

Powered by Google App Engine
This is Rietveld 408576698