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

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

Issue 2541513004: Ensure scrollToFragmentAnchor called before restoreScrollPositionAndViewState. (Closed)
Patch Set: bokan@ comments addressed 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
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..97ef36bfb217261e0ccb1b0af96a2a8b2d35612c 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 reload page with url anchor scroll to correct position.
Charlie Reis 2016/12/05 18:54:15 nit: s/reload/reloading a/ nit: s/scroll/scrolls/
+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
Charlie Reis 2016/12/05 18:54:15 Minor nit: Capitalize and end with period.
+ 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,

Powered by Google App Engine
This is Rietveld 408576698