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

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

Issue 2742923002: Use SameDocument term in tests instead of SamePage. (Closed)
Patch Set: Addressed review comments 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
« no previous file with comments | « no previous file | content/browser/media/session/media_session_service_impl_browsertest.cc » ('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 014e75eee1888ed8ca6b5e6dbdff03e4133c85cb..bf41fac607ab3451905b4528f659ddd6fd682370 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6048,13 +6048,13 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
static_cast<WebContentsImpl*>(shell()->web_contents());
FrameTreeNode* root = web_contents->GetFrameTree()->root();
- // Navigate to a simple page and then perform an in-page navigation.
+ // Navigate to a simple page and then perform a fragment change navigation.
GURL start_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
EXPECT_TRUE(NavigateToURL(shell(), start_url));
- GURL same_page_url(
+ GURL fragment_change_url(
embedded_test_server()->GetURL("a.com", "/title1.html#foo"));
- EXPECT_TRUE(NavigateToURL(shell(), same_page_url));
+ EXPECT_TRUE(NavigateToURL(shell(), fragment_change_url));
EXPECT_EQ(2, web_contents->GetController().GetEntryCount());
// Replace the URL of the current NavigationEntry with one that will cause
@@ -6082,8 +6082,8 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
// classified as SAME_PAGE) was leaving the FrameNavigationEntry with the
// same document sequence number as the previous entry but updates the URL.
// Doing a back session history navigation now will cause the browser to
- // consider it as in-page because of this matching document sequence number
- // and lead to a mismatch of origin and URL in the renderer process.
+ // consider it as same document because of this matching document sequence
+ // number and lead to a mismatch of origin and URL in the renderer process.
{
TestNavigationObserver observer(web_contents);
web_contents->GetController().GoBack();
@@ -6151,26 +6151,27 @@ class GoBackAndCommitFilter : public BrowserMessageFilter {
};
// Test which simulates a race condition between a cross-origin, same-process
-// navigation and a same page session history navigation. When such a race
+// navigation and a same document session history navigation. When such a race
// occurs, the renderer will commit the cross-origin navigation, updating its
// version of the current document sequence number, and will send an IPC to the
// browser process. The session history navigation comes after the commit for
// the cross-origin navigation and updates the URL, but not the origin of the
// document. This results in mismatch between the two and causes the renderer
// process to be killed. See https://crbug.com/630103.
-IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
- RaceCrossOriginNavigationAndSamePageHistoryNavigation) {
+IN_PROC_BROWSER_TEST_F(
+ NavigationControllerBrowserTest,
+ RaceCrossOriginNavigationAndSameDocumentHistoryNavigation) {
WebContentsImpl* web_contents =
static_cast<WebContentsImpl*>(shell()->web_contents());
FrameTreeNode* root = web_contents->GetFrameTree()->root();
- // Navigate to a simple page and then perform an in-page navigation.
+ // Navigate to a simple page and then perform a same document navigation.
GURL start_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
EXPECT_TRUE(NavigateToURL(shell(), start_url));
- GURL same_page_url(
+ GURL same_document_url(
embedded_test_server()->GetURL("a.com", "/title1.html#foo"));
- EXPECT_TRUE(NavigateToURL(shell(), same_page_url));
+ EXPECT_TRUE(NavigateToURL(shell(), same_document_url));
EXPECT_EQ(2, web_contents->GetController().GetEntryCount());
// Create a GoBackAndCommitFilter, which will delay the commit IPC for a
@@ -6214,7 +6215,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_TRUE(ExecuteScriptAndExtractString(
web_contents, "domAutomationController.send(document.origin)",
&origin));
- EXPECT_EQ(same_page_url.GetOrigin().spec(), origin + "/");
+ EXPECT_EQ(same_document_url.GetOrigin().spec(), origin + "/");
} else {
// Wait for the back navigation to commit as well.
history_commit_observer.Wait();
@@ -6676,10 +6677,10 @@ class NavigationHandleCommitObserver : public WebContentsObserver {
bool was_renderer_initiated_;
};
-// Test that a same-page navigation does not lead to the deletion of the
-// NavigationHandle for an ongoing different page navigation.
+// Test that a same document navigation does not lead to the deletion of the
+// NavigationHandle for an ongoing different document navigation.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
- SamePageNavigationDoesntDeleteNavigationHandle) {
+ SameDocumentNavigationDoesntDeleteNavigationHandle) {
const GURL kURL1 = embedded_test_server()->GetURL("/title1.html");
const GURL kPushStateURL =
embedded_test_server()->GetURL("/title1.html#fragment");
@@ -6749,10 +6750,10 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
-// Tests that a same-page browser-initiated navigation is properly reported by
-// the NavigationHandle.
+// Tests that a same document browser-initiated navigation is properly reported
+// by the NavigationHandle.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
- SamePageBrowserInitiated) {
+ SameDocumentBrowserInitiated) {
const GURL kURL = embedded_test_server()->GetURL("/title1.html");
const GURL kFragmentURL =
embedded_test_server()->GetURL("/title1.html#fragment");
« no previous file with comments | « no previous file | content/browser/media/session/media_session_service_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698