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

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: Using non-inherited structs Created 6 years, 3 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/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 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 EXPECT_EQ(0, controller.GetPendingEntryIndex()); 3869 EXPECT_EQ(0, controller.GetPendingEntryIndex());
3870 // The actual cross-navigation is suspended until the current RVH tells us 3870 // The actual cross-navigation is suspended until the current RVH tells us
3871 // it unloaded, simulate that. 3871 // it unloaded, simulate that.
3872 contents()->ProceedWithCrossSiteNavigation(); 3872 contents()->ProceedWithCrossSiteNavigation();
3873 // Also make sure we told the page to navigate. 3873 // Also make sure we told the page to navigate.
3874 const IPC::Message* message = 3874 const IPC::Message* message =
3875 process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3875 process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3876 ASSERT_TRUE(message != NULL); 3876 ASSERT_TRUE(message != NULL);
3877 Tuple1<FrameMsg_Navigate_Params> nav_params; 3877 Tuple1<FrameMsg_Navigate_Params> nav_params;
3878 FrameMsg_Navigate::Read(message, &nav_params); 3878 FrameMsg_Navigate::Read(message, &nav_params);
3879 EXPECT_EQ(url1, nav_params.a.url); 3879 EXPECT_EQ(url1, nav_params.a.core_params.url);
3880 process()->sink().ClearMessages(); 3880 process()->sink().ClearMessages();
3881 3881
3882 // Now test history.forward() 3882 // Now test history.forward()
3883 contents()->OnGoToEntryAtOffset(2); 3883 contents()->OnGoToEntryAtOffset(2);
3884 EXPECT_EQ(2, controller.GetPendingEntryIndex()); 3884 EXPECT_EQ(2, controller.GetPendingEntryIndex());
3885 // The actual cross-navigation is suspended until the current RVH tells us 3885 // The actual cross-navigation is suspended until the current RVH tells us
3886 // it unloaded, simulate that. 3886 // it unloaded, simulate that.
3887 contents()->ProceedWithCrossSiteNavigation(); 3887 contents()->ProceedWithCrossSiteNavigation();
3888 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3888 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3889 ASSERT_TRUE(message != NULL); 3889 ASSERT_TRUE(message != NULL);
3890 FrameMsg_Navigate::Read(message, &nav_params); 3890 FrameMsg_Navigate::Read(message, &nav_params);
3891 EXPECT_EQ(url3, nav_params.a.url); 3891 EXPECT_EQ(url3, nav_params.a.core_params.url);
3892 process()->sink().ClearMessages(); 3892 process()->sink().ClearMessages();
3893 3893
3894 controller.DiscardNonCommittedEntries(); 3894 controller.DiscardNonCommittedEntries();
3895 3895
3896 // Make sure an extravagant history.go() doesn't break. 3896 // Make sure an extravagant history.go() doesn't break.
3897 contents()->OnGoToEntryAtOffset(120); // Out of bounds. 3897 contents()->OnGoToEntryAtOffset(120); // Out of bounds.
3898 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); 3898 EXPECT_EQ(-1, controller.GetPendingEntryIndex());
3899 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID); 3899 message = process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
3900 EXPECT_TRUE(message == NULL); 3900 EXPECT_TRUE(message == NULL);
3901 } 3901 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4335 params.post_id = -1; 4335 params.post_id = -1;
4336 test_rvh()->SendNavigateWithParams(&params); 4336 test_rvh()->SendNavigateWithParams(&params);
4337 4337
4338 // Now reload. replaceState overrides the POST, so we should not show a 4338 // Now reload. replaceState overrides the POST, so we should not show a
4339 // repost warning dialog. 4339 // repost warning dialog.
4340 controller_impl().Reload(true); 4340 controller_impl().Reload(true);
4341 EXPECT_EQ(0, delegate->repost_form_warning_count()); 4341 EXPECT_EQ(0, delegate->repost_form_warning_count());
4342 } 4342 }
4343 4343
4344 } // namespace content 4344 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698