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

Side by Side Diff: content/browser/web_contents/render_view_host_manager_unittest.cc

Issue 25654005: Remove GetActiveEntry usage from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment, added TODO, rebased on ToT. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "content/browser/renderer_host/test_render_view_host.h" 6 #include "content/browser/renderer_host/test_render_view_host.h"
7 #include "content/browser/site_instance_impl.h" 7 #include "content/browser/site_instance_impl.h"
8 #include "content/browser/web_contents/navigation_controller_impl.h" 8 #include "content/browser/web_contents/navigation_controller_impl.h"
9 #include "content/browser/web_contents/navigation_entry_impl.h" 9 #include "content/browser/web_contents/navigation_entry_impl.h"
10 #include "content/browser/web_contents/render_view_host_manager.h" 10 #include "content/browser/web_contents/render_view_host_manager.h"
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 params.page_state = PageState::CreateFromURL(kUrl2); 957 params.page_state = PageState::CreateFromURL(kUrl2);
958 contents()->DidNavigate(evil_rvh, params); 958 contents()->DidNavigate(evil_rvh, params);
959 959
960 // That should have cancelled the pending RVH, and the evil RVH should be the 960 // That should have cancelled the pending RVH, and the evil RVH should be the
961 // current one. 961 // current one.
962 EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> 962 EXPECT_TRUE(contents()->GetRenderManagerForTesting()->
963 pending_render_view_host() == NULL); 963 pending_render_view_host() == NULL);
964 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host()); 964 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host());
965 965
966 // Also we should not have a pending navigation entry. 966 // Also we should not have a pending navigation entry.
967 NavigationEntry* entry = contents()->GetController().GetActiveEntry(); 967 EXPECT_TRUE(contents()->GetController().GetPendingEntry() == NULL);
968 NavigationEntry* entry = contents()->GetController().GetVisibleEntry();
968 ASSERT_TRUE(entry != NULL); 969 ASSERT_TRUE(entry != NULL);
969 EXPECT_EQ(kUrl2, entry->GetURL()); 970 EXPECT_EQ(kUrl2, entry->GetURL());
970 } 971 }
971 972
972 // Ensure that we can go back and forward even if a SwapOut ACK isn't received. 973 // Ensure that we can go back and forward even if a SwapOut ACK isn't received.
973 // See http://crbug.com/93427. 974 // See http://crbug.com/93427.
974 TEST_F(RenderViewHostManagerTest, NavigateAfterMissingSwapOutACK) { 975 TEST_F(RenderViewHostManagerTest, NavigateAfterMissingSwapOutACK) {
975 const GURL kUrl1("http://www.google.com/"); 976 const GURL kUrl1("http://www.google.com/");
976 const GURL kUrl2("http://www.chromium.org/"); 977 const GURL kUrl2("http://www.chromium.org/");
977 978
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 Source<RenderWidgetHost>(host2)); 1299 Source<RenderWidgetHost>(host2));
1299 manager.ShouldClosePage(false, true, base::TimeTicks()); 1300 manager.ShouldClosePage(false, true, base::TimeTicks());
1300 1301
1301 EXPECT_TRUE( 1302 EXPECT_TRUE(
1302 notifications.Check1AndReset(NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED)); 1303 notifications.Check1AndReset(NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED));
1303 EXPECT_FALSE(manager.pending_render_view_host()); 1304 EXPECT_FALSE(manager.pending_render_view_host());
1304 EXPECT_EQ(host, manager.current_host()); 1305 EXPECT_EQ(host, manager.current_host());
1305 } 1306 }
1306 1307
1307 } // namespace content 1308 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl_unittest.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698