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

Unified Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 2339673002: Do not clear the favicon for an in-page navigation. (Closed)
Patch Set: test! Created 4 years, 3 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 | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index 85afbdb2bea4c574c8b00ece48cf6f5c22954d1a..0412e2545faec36a0b20bb72f417f45bae5aeb33 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6016,4 +6016,26 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
"Referer: http://a.com:.*/form_that_posts_cross_site.html"));
}
+// Check that the favicon is not cleared for navigating in-page.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ InPageNavigationDoesNotClearFavicon) {
+ // Load a page and fake a favicon for it.
+ NavigationController& controller = shell()->web_contents()->GetController();
+ ASSERT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
+ content::NavigationEntry* entry = controller.GetLastCommittedEntry();
+ ASSERT_TRUE(entry);
+ content::FaviconStatus& favicon_status = entry->GetFavicon();
+ favicon_status.valid = true;
+
+ ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page1#")));
+ entry = controller.GetLastCommittedEntry();
+ content::FaviconStatus& favicon_status2 = entry->GetFavicon();
+ EXPECT_TRUE(favicon_status2.valid);
+
+ ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page2")));
+ entry = controller.GetLastCommittedEntry();
+ content::FaviconStatus& favicon_status3 = entry->GetFavicon();
+ EXPECT_FALSE(favicon_status3.valid);
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698