diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 01:02:46 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 01:02:46 +0000 |
commit | 1be69aa0ed94b85870485aa090cf73e31b94dc79 (patch) | |
tree | 8a8006f2511af5f07e1764a086ab11de26adf5c7 /chrome/browser/tab_contents/test_tab_contents.cc | |
parent | a0ddf29301017291854f477c02c180bf349b9e1c (diff) | |
download | chromium_src-1be69aa0ed94b85870485aa090cf73e31b94dc79.zip chromium_src-1be69aa0ed94b85870485aa090cf73e31b94dc79.tar.gz chromium_src-1be69aa0ed94b85870485aa090cf73e31b94dc79.tar.bz2 |
Revert "Don't create pending entries when a navigation is initiated by the page."
TBR=jcivelli
Review URL: http://codereview.chromium.org/3360003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/test_tab_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents/test_tab_contents.cc | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/chrome/browser/tab_contents/test_tab_contents.cc b/chrome/browser/tab_contents/test_tab_contents.cc index 2c1ba39..54a6873 100644 --- a/chrome/browser/tab_contents/test_tab_contents.cc +++ b/chrome/browser/tab_contents/test_tab_contents.cc @@ -45,7 +45,7 @@ void TestTabContents::Observe(NotificationType type, } } -TestRenderViewHost* TestTabContents::pending_rvh() const { +TestRenderViewHost* TestTabContents::pending_rvh() { return static_cast<TestRenderViewHost*>( render_manager_.pending_render_view_host_); } @@ -70,34 +70,7 @@ void TestTabContents::NavigateAndCommit(const GURL& url) { bool reverse_on_redirect = false; BrowserURLHandler::RewriteURLIfNecessary( &loaded_url, profile(), &reverse_on_redirect); - - // LoadURL created a navigation entry, now simulate the RenderView sending - // a notification that it actually navigated. - CommitPendingNavigation(); -} - -void TestTabContents::CommitPendingNavigation() { - // If we are doing a cross-site navigation, this simulates the current RVH - // notifying that it has unloaded so the pending RVH is resumed and can - // navigate. - ProceedWithCrossSiteNavigation(); - TestRenderViewHost* rvh = pending_rvh(); - if (!rvh) - rvh = static_cast<TestRenderViewHost*>(render_manager_.current_host()); - - const NavigationEntry* entry = controller().pending_entry(); - DCHECK(entry); - int page_id = entry->page_id(); - if (page_id == -1) { - // It's a new navigation, assign a never-seen page id to it. - page_id = - static_cast<MockRenderProcessHost*>(rvh->process())->max_page_id() + 1; - } - rvh->SendNavigate(page_id, entry->url()); -} - -void TestTabContents::ProceedWithCrossSiteNavigation() { - if (!pending_rvh()) - return; - render_manager_.ShouldClosePage(true, true); + static_cast<TestRenderViewHost*>(render_view_host())->SendNavigate( + static_cast<MockRenderProcessHost*>(render_view_host()->process())-> + max_page_id() + 1, loaded_url); } |