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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 1009993002: PlzNavigate: destroy the speculative RFH on renderer-initiated navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 783
784 // Make a pending entry to somewhere new. 784 // Make a pending entry to somewhere new.
785 const GURL kExistingURL2("http://bee"); 785 const GURL kExistingURL2("http://bee");
786 controller.LoadURL( 786 controller.LoadURL(
787 kExistingURL2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); 787 kExistingURL2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
788 EXPECT_EQ(0U, notifications.size()); 788 EXPECT_EQ(0U, notifications.size());
789 789
790 // After the beforeunload but before it commits, do a new navigation. 790 // After the beforeunload but before it commits, do a new navigation.
791 main_test_rfh()->PrepareForCommit(); 791 main_test_rfh()->PrepareForCommit();
792 const GURL kNewURL("http://see"); 792 const GURL kNewURL("http://see");
793 main_test_rfh()->SendRendererInitiatedNavigationRequest(kNewURL, true);
nasko 2015/03/16 18:48:37 I think this is already in Carlos' recent CL.
carlosk 2015/03/17 14:42:59 It is. Rebasing will sort it out.
793 main_test_rfh()->PrepareForCommit(); 794 main_test_rfh()->PrepareForCommit();
794 contents()->GetMainFrame()->SendNavigate(3, kNewURL); 795 contents()->GetMainFrame()->SendNavigate(3, kNewURL);
795 796
796 // There should no longer be any pending entry, and the third navigation we 797 // There should no longer be any pending entry, and the third navigation we
797 // just made should be committed. 798 // just made should be committed.
798 EXPECT_EQ(1U, navigation_entry_committed_counter_); 799 EXPECT_EQ(1U, navigation_entry_committed_counter_);
799 navigation_entry_committed_counter_ = 0; 800 navigation_entry_committed_counter_ = 0;
800 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); 801 EXPECT_EQ(-1, controller.GetPendingEntryIndex());
801 EXPECT_EQ(1, controller.GetLastCommittedEntryIndex()); 802 EXPECT_EQ(1, controller.GetLastCommittedEntryIndex());
802 EXPECT_EQ(kNewURL, controller.GetVisibleEntry()->GetURL()); 803 EXPECT_EQ(kNewURL, controller.GetVisibleEntry()->GetURL());
(...skipping 3733 matching lines...) Expand 10 before | Expand all | Expand 10 after
4536 { 4537 {
4537 LoadCommittedDetails details; 4538 LoadCommittedDetails details;
4538 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); 4539 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details);
4539 EXPECT_EQ(PAGE_TYPE_ERROR, 4540 EXPECT_EQ(PAGE_TYPE_ERROR,
4540 controller_impl().GetLastCommittedEntry()->GetPageType()); 4541 controller_impl().GetLastCommittedEntry()->GetPageType());
4541 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); 4542 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type);
4542 } 4543 }
4543 } 4544 }
4544 4545
4545 } // namespace content 4546 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | content/browser/frame_host/navigator_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698