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

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

Issue 483773002: PlzNavigate: implement CommitNavigation on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + fix compilation error Created 6 years, 2 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 3877 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 EXPECT_EQ(0, controller.GetPendingEntryIndex()); 3888 EXPECT_EQ(0, controller.GetPendingEntryIndex());
3889 // The actual cross-navigation is suspended until the current RVH tells us 3889 // The actual cross-navigation is suspended until the current RVH tells us
3890 // it unloaded, simulate that. 3890 // it unloaded, simulate that.
3891 contents()->ProceedWithCrossSiteNavigation(); 3891 contents()->ProceedWithCrossSiteNavigation();
3892 // Also make sure we told the page to navigate. 3892 // Also make sure we told the page to navigate.
3893 const IPC::Message* message = 3893 const IPC::Message* message =
3894 process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3894 process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3895 ASSERT_TRUE(message != NULL); 3895 ASSERT_TRUE(message != NULL);
3896 Tuple1<FrameMsg_Navigate_Params> nav_params; 3896 Tuple1<FrameMsg_Navigate_Params> nav_params;
3897 FrameMsg_Navigate::Read(message, &nav_params); 3897 FrameMsg_Navigate::Read(message, &nav_params);
3898 EXPECT_EQ(url1, nav_params.a.url); 3898 EXPECT_EQ(url1, nav_params.a.common_params.url);
3899 process()->sink().ClearMessages(); 3899 process()->sink().ClearMessages();
3900 3900
3901 // Now test history.forward() 3901 // Now test history.forward()
3902 contents()->OnGoToEntryAtOffset(2); 3902 contents()->OnGoToEntryAtOffset(2);
3903 EXPECT_EQ(2, controller.GetPendingEntryIndex()); 3903 EXPECT_EQ(2, controller.GetPendingEntryIndex());
3904 // The actual cross-navigation is suspended until the current RVH tells us 3904 // The actual cross-navigation is suspended until the current RVH tells us
3905 // it unloaded, simulate that. 3905 // it unloaded, simulate that.
3906 contents()->ProceedWithCrossSiteNavigation(); 3906 contents()->ProceedWithCrossSiteNavigation();
3907 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3907 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3908 ASSERT_TRUE(message != NULL); 3908 ASSERT_TRUE(message != NULL);
3909 FrameMsg_Navigate::Read(message, &nav_params); 3909 FrameMsg_Navigate::Read(message, &nav_params);
3910 EXPECT_EQ(url3, nav_params.a.url); 3910 EXPECT_EQ(url3, nav_params.a.common_params.url);
3911 process()->sink().ClearMessages(); 3911 process()->sink().ClearMessages();
3912 3912
3913 controller.DiscardNonCommittedEntries(); 3913 controller.DiscardNonCommittedEntries();
3914 3914
3915 // Make sure an extravagant history.go() doesn't break. 3915 // Make sure an extravagant history.go() doesn't break.
3916 contents()->OnGoToEntryAtOffset(120); // Out of bounds. 3916 contents()->OnGoToEntryAtOffset(120); // Out of bounds.
3917 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); 3917 EXPECT_EQ(-1, controller.GetPendingEntryIndex());
3918 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3918 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3919 EXPECT_TRUE(message == NULL); 3919 EXPECT_TRUE(message == NULL);
3920 } 3920 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4354 params.post_id = -1; 4354 params.post_id = -1;
4355 test_rvh()->SendNavigateWithParams(&params); 4355 test_rvh()->SendNavigateWithParams(&params);
4356 4356
4357 // Now reload. replaceState overrides the POST, so we should not show a 4357 // Now reload. replaceState overrides the POST, so we should not show a
4358 // repost warning dialog. 4358 // repost warning dialog.
4359 controller_impl().Reload(true); 4359 controller_impl().Reload(true);
4360 EXPECT_EQ(0, delegate->repost_form_warning_count()); 4360 EXPECT_EQ(0, delegate->repost_form_warning_count());
4361 } 4361 }
4362 4362
4363 } // namespace content 4363 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698