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

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

Issue 475783002: PlzNavigate: add cancel navigation logic for uncommitted requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests for the navigation request ID Created 6 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
Index: content/browser/frame_host/render_frame_host_manager_unittest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc
index e8db0e1eabc065a18bdb3e2c020cb73422512ad3..93446cee53c9907a87b460783002445f0bfc0a33 100644
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -1855,6 +1855,7 @@ TEST_F(RenderFrameHostManagerTest, BrowserSideNavigationBeginNavigation) {
const GURL kUrl1("http://www.google.com/");
const GURL kUrl2("http://www.chromium.org/");
const GURL kUrl3("http://www.gmail.com/");
+ const int64 firstNavRequestID = 1;
clamy 2014/08/18 11:51:24 Please rename this variable as kFirstNavRequestId
// Navigate to the first page.
contents()->NavigateAndCommit(kUrl1);
@@ -1878,6 +1879,7 @@ TEST_F(RenderFrameHostManagerTest, BrowserSideNavigationBeginNavigation) {
kUrl1, subframe_request->info_for_testing().first_party_for_cookies);
EXPECT_FALSE(subframe_request->info_for_testing().is_main_frame);
EXPECT_TRUE(subframe_request->info_for_testing().parent_is_main_frame);
+ EXPECT_EQ(firstNavRequestID, subframe_request->navigation_request_id());
// Simulate a BeginNavigation IPC on the main frame.
main_test_rfh()->SendBeginNavigationWithURL(kUrl3);
@@ -1889,6 +1891,7 @@ TEST_F(RenderFrameHostManagerTest, BrowserSideNavigationBeginNavigation) {
EXPECT_EQ(kUrl3, main_request->info_for_testing().first_party_for_cookies);
EXPECT_TRUE(main_request->info_for_testing().is_main_frame);
EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame);
+ EXPECT_EQ(firstNavRequestID + 1, main_request->navigation_request_id());
}
} // namespace content
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698