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

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

Issue 2541513004: Ensure scrollToFragmentAnchor called before restoreScrollPositionAndViewState. (Closed)
Patch Set: add scrollToFragmentAnchor back to performPostLayoutTasks Created 4 years 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 | content/test/data/navigation_controller/reload-with-url-anchor.html » ('j') | 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 64fe1da373172c0f6badd4a1dc316cc26c3483ba..97a1c0d2c7b7fddbc1461751e47eb075950777d4 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -1336,6 +1336,25 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
}
+// Verify that reloading a page with url anchor scrolls to correct position.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, ReloadWithUrlAnchor) {
+ GURL url1(embedded_test_server()->GetURL(
+ "/navigation_controller/reload-with-url-anchor.html#d2"));
+ EXPECT_TRUE(NavigateToURL(shell(), url1));
+
+ std::string script =
+ "domAutomationController.send(document.getElementById('div').scrollTop)";
+ int value = 0;
+ EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), script, &value));
+ EXPECT_EQ(100, value);
+
+ // Reload.
+ ReloadBlockUntilNavigationsComplete(shell(), 1);
+
+ EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), script, &value));
+ EXPECT_EQ(100, value);
+}
+
// Verify that empty GURL navigations are not classified as SAME_PAGE.
// See https://crbug.com/534980.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
« no previous file with comments | « no previous file | content/test/data/navigation_controller/reload-with-url-anchor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698