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

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

Issue 2742923002: Use SameDocument term in tests instead of SamePage. (Closed)
Patch Set: Fixed compilation 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..c4f369a545dc87dec500f000f74c6fa2f1d74667 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6038,23 +6038,24 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_EQ(0U, root->child_count());
}
-// Test that navigations classified as SAME_PAGE properly update all the
Charlie Reis 2017/03/10 21:01:38 We should leave this as SAME_PAGE. (See below for
Eugene But (OOO till 7-30) 2017/03/10 21:41:59 Done.
-// members of FrameNavigationEntry. If not, it is possible to get a mismatch
-// between the origin and URL of a document as seen in
+// Test that navigations classified as same document navigaiton properly update
+// all the members of FrameNavigationEntry. If not, it is possible to get a
+// mismatch between the origin and URL of a document as seen in
// https://crbug.com/630103.
-IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
- EnsureSamePageNavigationUpdatesFrameNavigationEntry) {
Charlie Reis 2017/03/10 21:01:38 We should leave the test name here as is, unless w
Eugene But (OOO till 7-30) 2017/03/10 21:41:59 Done.
+IN_PROC_BROWSER_TEST_F(
+ NavigationControllerBrowserTest,
+ EnsureSameDocumentNavigationUpdatesFrameNavigationEntry) {
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 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
@@ -6079,11 +6080,11 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
// Prior to fixing the issue, the above omnibox navigation (which is
- // classified as SAME_PAGE) was leaving the FrameNavigationEntry with the
+ // classified as same document) was leaving the FrameNavigationEntry with the
Charlie Reis 2017/03/10 21:01:38 No, this needs to stay SAME_PAGE for now, because
Eugene But (OOO till 7-30) 2017/03/10 21:41:59 Done.
// 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 +6152,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 +6216,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 +6678,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 +6751,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