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

Unified Diff: content/browser/web_contents/navigation_controller_impl_unittest.cc

Issue 10871090: history.replaceState(..., location.href) clearing page-action icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « content/browser/web_contents/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/navigation_controller_impl_unittest.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl_unittest.cc (revision 153705)
+++ content/browser/web_contents/navigation_controller_impl_unittest.cc (working copy)
@@ -1435,7 +1435,27 @@
EXPECT_TRUE(notifications.Check1AndReset(
content::NOTIFICATION_NAV_ENTRY_COMMITTED));
- // First navigation.
+ // Distinguish reload vs. history.replaceState() of same url.
Charlie Reis 2012/08/28 21:48:21 This comment is confusing, since you don't test re
Tom Sepez 2012/08/28 21:57:59 Done.
+ ViewHostMsg_FrameNavigate_Params self_params;
+ self_params.page_id = 1;
+ self_params.url = url1;
+ self_params.transition = content::PAGE_TRANSITION_LINK;
+ self_params.should_update_history = false;
+ self_params.gesture = NavigationGestureUser;
+ self_params.is_post = false;
+ self_params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url1));
+ self_params.was_within_same_page = true;
+
+ // This should generate a new entry.
Charlie Reis 2012/08/28 21:48:21 Again, this is tricky to follow because there's a
Tom Sepez 2012/08/28 21:57:59 This appears to be an artifact of the interaction
Charlie Reis 2012/08/28 22:17:23 Can we just call RendererDidNavigate() on the init
+ content::LoadCommittedDetails details;
+ EXPECT_TRUE(controller.RendererDidNavigate(self_params, &details));
+ EXPECT_TRUE(notifications.Check1AndReset(
+ content::NOTIFICATION_NAV_ENTRY_COMMITTED));
+ EXPECT_TRUE(details.is_in_page);
+ EXPECT_FALSE(details.did_replace_entry);
+ EXPECT_EQ(2, controller.GetEntryCount());
+
+ // Fragment navigation.
const GURL url2("http://foo#a");
ViewHostMsg_FrameNavigate_Params params;
params.page_id = 1;
@@ -1446,13 +1466,12 @@
params.is_post = false;
params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2));
- // This should generate a new entry.
- content::LoadCommittedDetails details;
+ // This should not generate a new entry.
EXPECT_TRUE(controller.RendererDidNavigate(params, &details));
EXPECT_TRUE(notifications.Check1AndReset(
content::NOTIFICATION_NAV_ENTRY_COMMITTED));
EXPECT_TRUE(details.is_in_page);
- EXPECT_FALSE(details.did_replace_entry);
+ EXPECT_TRUE(details.did_replace_entry);
EXPECT_EQ(2, controller.GetEntryCount());
// Go back one.
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698