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

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

Issue 251823002: Move didAccessInitialDocument to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 8 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/navigation_controller_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index 8003d5a38197055d7fc81a37b4cde28bff519266..dca450e934fb98ad974bfac43d2dae7865cb0084 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -2887,16 +2887,15 @@ TEST_F(NavigationControllerTest, ShowRendererURLInNewTabUntilModified) {
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
is_renderer_initiated());
EXPECT_TRUE(controller.IsInitialNavigation());
- EXPECT_FALSE(test_rvh()->has_accessed_initial_document());
+ EXPECT_FALSE(contents()->HasAccessedInitialDocument());
// There should be no title yet.
EXPECT_TRUE(contents()->GetTitle().empty());
// If something else modifies the contents of the about:blank page, then
// we must revert to showing about:blank to avoid a URL spoof.
- test_rvh()->OnMessageReceived(
- ViewHostMsg_DidAccessInitialDocument(0));
- EXPECT_TRUE(test_rvh()->has_accessed_initial_document());
+ main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0));
+ EXPECT_TRUE(contents()->HasAccessedInitialDocument());
EXPECT_FALSE(controller.GetVisibleEntry());
EXPECT_EQ(url, controller.GetPendingEntry()->GetURL());
@@ -2928,7 +2927,7 @@ TEST_F(NavigationControllerTest, ShowBrowserURLAfterFailUntilModified) {
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
is_renderer_initiated());
EXPECT_TRUE(controller.IsInitialNavigation());
- EXPECT_FALSE(test_rvh()->has_accessed_initial_document());
+ EXPECT_FALSE(contents()->HasAccessedInitialDocument());
// There should be no title yet.
EXPECT_TRUE(contents()->GetTitle().empty());
@@ -2947,9 +2946,8 @@ TEST_F(NavigationControllerTest, ShowBrowserURLAfterFailUntilModified) {
// If something else later modifies the contents of the about:blank page, then
// we must revert to showing about:blank to avoid a URL spoof.
- test_rvh()->OnMessageReceived(
- ViewHostMsg_DidAccessInitialDocument(0));
- EXPECT_TRUE(test_rvh()->has_accessed_initial_document());
+ main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0));
+ EXPECT_TRUE(contents()->HasAccessedInitialDocument());
EXPECT_FALSE(controller.GetVisibleEntry());
EXPECT_FALSE(controller.GetPendingEntry());
@@ -2980,7 +2978,7 @@ TEST_F(NavigationControllerTest, ShowRendererURLAfterFailUntilModified) {
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
is_renderer_initiated());
EXPECT_TRUE(controller.IsInitialNavigation());
- EXPECT_FALSE(test_rvh()->has_accessed_initial_document());
+ EXPECT_FALSE(contents()->HasAccessedInitialDocument());
// There should be no title yet.
EXPECT_TRUE(contents()->GetTitle().empty());
@@ -2998,9 +2996,8 @@ TEST_F(NavigationControllerTest, ShowRendererURLAfterFailUntilModified) {
// If something else later modifies the contents of the about:blank page, then
// we must revert to showing about:blank to avoid a URL spoof.
- test_rvh()->OnMessageReceived(
- ViewHostMsg_DidAccessInitialDocument(0));
- EXPECT_TRUE(test_rvh()->has_accessed_initial_document());
+ main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0));
+ EXPECT_TRUE(contents()->HasAccessedInitialDocument());
EXPECT_FALSE(controller.GetVisibleEntry());
EXPECT_EQ(url, controller.GetPendingEntry()->GetURL());
@@ -3027,7 +3024,7 @@ TEST_F(NavigationControllerTest, DontShowRendererURLInNewTabAfterCommit) {
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
is_renderer_initiated());
EXPECT_TRUE(controller.IsInitialNavigation());
- EXPECT_FALSE(test_rvh()->has_accessed_initial_document());
+ EXPECT_FALSE(contents()->HasAccessedInitialDocument());
// Simulate a commit and then starting a new pending navigation.
main_test_rfh()->SendNavigate(0, url1);
@@ -3038,7 +3035,7 @@ TEST_F(NavigationControllerTest, DontShowRendererURLInNewTabAfterCommit) {
// We should not consider this an initial navigation, and thus should
// not show the pending URL.
- EXPECT_FALSE(test_rvh()->has_accessed_initial_document());
+ EXPECT_FALSE(contents()->HasAccessedInitialDocument());
EXPECT_FALSE(controller.IsInitialNavigation());
EXPECT_TRUE(controller.GetVisibleEntry());
EXPECT_EQ(url1, controller.GetVisibleEntry()->GetURL());
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | content/browser/frame_host/render_frame_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698