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

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

Issue 1184423005: Add item and document sequence numbers to FrameNavigationEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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 ae5d04d2e163dd2ca50af4fab7c2ef39d08501eb..667a767d0e3432551637ae98fdfc466c8421e8f1 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -1548,6 +1548,45 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
}
+// Verifies that item sequence numbers and document sequence numbers update
+// properly for main frames and subframes.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ FrameNavigationEntry_SequenceNumbers) {
+ const NavigationControllerImpl& controller =
+ static_cast<const NavigationControllerImpl&>(
+ shell()->web_contents()->GetController());
+
+ // 1. Navigate the main frame.
+ GURL url2(embedded_test_server()->GetURL(
+ "/navigation_controller/page_with_links.html"));
+ NavigateToURL(shell(), url2);
+ FrameTreeNode* root =
+ static_cast<WebContentsImpl*>(shell()->web_contents())->
+ GetFrameTree()->root();
+
+ FrameNavigationEntry* frame_entry =
+ controller.GetLastCommittedEntry()->root_node()->frame_entry.get();
+ int64 isn_1 = frame_entry->item_sequence_number();
+ int64 dsn_1 = frame_entry->document_sequence_number();
+ EXPECT_NE(-1, isn_1);
+ EXPECT_NE(-1, dsn_1);
Avi (use Gerrit) 2015/06/18 00:57:00 -1? I would have thought that would be a "not assi
Charlie Reis 2015/06/18 20:30:17 Right: EXPECT_NE.
+
+ // 2. Do an in-page fragment navigation.
+ std::string script = "document.getElementById('fraglink').click()";
+ EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(), script));
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+
+ frame_entry =
+ controller.GetLastCommittedEntry()->root_node()->frame_entry.get();
+ int64 isn_2 = frame_entry->item_sequence_number();
+ int64 dsn_2 = frame_entry->document_sequence_number();
+ EXPECT_NE(-1, isn_2);
+ EXPECT_NE(isn_1, isn_2);
+ EXPECT_EQ(dsn_1, dsn_2);
Avi (use Gerrit) 2015/06/18 00:57:00 So document sequence numbers are sometimes shared
Charlie Reis 2015/06/18 20:30:17 It's from Blink, so I assume the answer is no. Th
+
+ // TODO(creis): Add a subframe test.
Charlie Reis 2015/06/17 22:56:23 I'll add this as well. (I was debating checking t
Charlie Reis 2015/06/18 20:30:17 Done.
+}
+
namespace {
class HttpThrottle : public ResourceThrottle {

Powered by Google App Engine
This is Rietveld 408576698