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

Unified Diff: chrome/browser/favicon/content_favicon_driver_browsertest.cc

Issue 2949023002: [WIP] Fix history.replaceState() not propagating back favicons (Closed)
Patch Set: Focus on history.replaceState() Created 3 years, 5 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 | chrome/browser/history/history_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/content_favicon_driver_browsertest.cc
diff --git a/chrome/browser/favicon/content_favicon_driver_browsertest.cc b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
index 539aacec46565c1bd45023fa00a1e5291a8aebe6..fc8501097a76e178d2db9dfa396eeb9c7840a742 100644
--- a/chrome/browser/favicon/content_favicon_driver_browsertest.cc
+++ b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
@@ -443,6 +443,29 @@ IN_PROC_BROWSER_TEST_F(
GetFaviconForPageURL(landing_url, favicon_base::FAVICON).bitmap_data);
}
+// Test that a page which uses JavaScript's history.replaceState() to update
+// the URL in the omnibox (and history) gets associated favicons.
+IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest,
+ AssociateIconWithInitialPageIconDespiteReplaceState) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+ GURL url =
+ embedded_test_server()->GetURL("/favicon/replacestate_with_favicon.html");
+ GURL replacestate_url = embedded_test_server()->GetURL(
+ "/favicon/replacestate_with_favicon_replaced.html");
+
+ PendingTaskWaiter waiter(web_contents(), replacestate_url);
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(), url, WindowOpenDisposition::CURRENT_TAB,
+ ui_test_utils::BROWSER_TEST_NONE);
+ waiter.Wait();
+
+ EXPECT_NE(nullptr,
+ GetFaviconForPageURL(url, favicon_base::FAVICON).bitmap_data);
+ EXPECT_NE(nullptr,
+ GetFaviconForPageURL(replacestate_url, favicon_base::FAVICON)
+ .bitmap_data);
+}
+
#if defined(OS_ANDROID)
IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest,
LoadIconFromWebManifestDespitePushState) {
« no previous file with comments | « no previous file | chrome/browser/history/history_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698