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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc

Issue 6709056: Avoid corrupting the pending_entry when an unexpected navigation commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 9 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 | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index 25a9a4368651484f0456f6794f76eab34e3df7c7..cd60ad8c1ed4dbe2dbc130f7550ac37d553a1a47 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -105,11 +105,16 @@ class SafeBrowsingBlockingPageTest : public RenderViewHostTestHarness,
contents()->TestDidNavigate(contents_->render_view_host(), params);
}
- void GoBack() {
+ void GoBackCrossSite() {
NavigationEntry* entry = contents()->controller().GetEntryAtOffset(-1);
ASSERT_TRUE(entry);
contents()->controller().GoBack();
- Navigate(entry->url().spec().c_str(), entry->page_id());
+
+ // The navigation should commit in the pending RVH.
+ ViewHostMsg_FrameNavigate_Params params;
+ InitNavigateParams(&params, entry->page_id(), GURL(entry->url()),
+ PageTransition::TYPED);
+ contents()->TestDidNavigate(contents_->pending_rvh(), params);
}
void ShowInterstitial(ResourceType::Type resource_type,
@@ -457,7 +462,7 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) {
// Proceed, then navigate back.
ProceedThroughInterstitial(sb_interstitial);
Navigate(kBadURL, 2); // Commit the navigation.
- GoBack();
+ GoBackCrossSite();
// We are back on the good page.
sb_interstitial = GetSafeBrowsingBlockingPage();
« no previous file with comments | « no previous file | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698