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

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

Issue 1139823006: Ensure that unique ids are unique. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 7 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/frame_host/navigation_entry_impl.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 6cc541ef01a1ebc629e2985f6bbac94a1190f1bb..3f371bf7c09b1797070363034fa28f9d76a61586 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -57,6 +57,27 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURL) {
EXPECT_EQ(controller.GetVisibleEntry()->GetOriginalRequestURL(), history_url);
}
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, UniqueIDs) {
+ const NavigationControllerImpl& controller =
+ static_cast<const NavigationControllerImpl&>(
+ shell()->web_contents()->GetController());
+
+ GURL main_url(embedded_test_server()->GetURL(
+ "/navigation_controller/page_with_link_to_load_iframe.html"));
+ NavigateToURL(shell(), main_url);
+ ASSERT_EQ(1, controller.GetEntryCount());
+
+ // Use JavaScript to click the link and load the iframe.
+ std::string script = "document.getElementById('link').click()";
+ EXPECT_TRUE(content::ExecuteScript(shell()->web_contents(), script));
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+ ASSERT_EQ(2, controller.GetEntryCount());
+
+ // Unique IDs should... um... be unique.
+ ASSERT_NE(controller.GetEntryAtIndex(0)->GetUniqueID(),
+ controller.GetEntryAtIndex(1)->GetUniqueID());
+}
+
// The renderer uses the position in the history list as a clue to whether a
// navigation is stale. In the case where the entry limit is reached and the
// history list is pruned, make sure that there is no mismatch that would cause
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698