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

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

Issue 23022006: Remove GetActiveEntry usage from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Save Page As code and test. Created 7 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 | 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 params.page_state = PageState::CreateFromURL(kUrl2); 943 params.page_state = PageState::CreateFromURL(kUrl2);
944 contents()->DidNavigate(evil_rvh, params); 944 contents()->DidNavigate(evil_rvh, params);
945 945
946 // That should have cancelled the pending RVH, and the evil RVH should be the 946 // That should have cancelled the pending RVH, and the evil RVH should be the
947 // current one. 947 // current one.
948 EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> 948 EXPECT_TRUE(contents()->GetRenderManagerForTesting()->
949 pending_render_view_host() == NULL); 949 pending_render_view_host() == NULL);
950 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host()); 950 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host());
951 951
952 // Also we should not have a pending navigation entry. 952 // Also we should not have a pending navigation entry.
953 NavigationEntry* entry = contents()->GetController().GetActiveEntry(); 953 EXPECT_TRUE(contents()->GetController().GetPendingEntry() == NULL);
Charlie Reis 2013/09/16 23:10:54 nit: Just use EXPECT_FALSE and we won't need the "
nasko 2013/09/18 17:03:18 I kept it consistent with the surrounding code, wh
Charlie Reis 2013/09/18 18:36:05 Ok. Feel free to send a cleanup CL to me after th
954 NavigationEntry* entry = contents()->GetController().GetVisibleEntry();
954 ASSERT_TRUE(entry != NULL); 955 ASSERT_TRUE(entry != NULL);
955 EXPECT_EQ(kUrl2, entry->GetURL()); 956 EXPECT_EQ(kUrl2, entry->GetURL());
956 } 957 }
957 958
958 // Ensure that we can go back and forward even if a SwapOut ACK isn't received. 959 // Ensure that we can go back and forward even if a SwapOut ACK isn't received.
959 // See http://crbug.com/93427. 960 // See http://crbug.com/93427.
960 TEST_F(RenderViewHostManagerTest, NavigateAfterMissingSwapOutACK) { 961 TEST_F(RenderViewHostManagerTest, NavigateAfterMissingSwapOutACK) {
961 const GURL kUrl1("http://www.google.com/"); 962 const GURL kUrl1("http://www.google.com/");
962 const GURL kUrl2("http://www.chromium.org/"); 963 const GURL kUrl2("http://www.chromium.org/");
963 964
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 1210
1210 // Commit. 1211 // Commit.
1211 manager.DidNavigateMainFrame(host); 1212 manager.DidNavigateMainFrame(host);
1212 EXPECT_EQ(host, manager.current_host()); 1213 EXPECT_EQ(host, manager.current_host());
1213 ASSERT_TRUE(host); 1214 ASSERT_TRUE(host);
1214 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), 1215 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()),
1215 instance); 1216 instance);
1216 } 1217 }
1217 1218
1218 } // namespace content 1219 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698