Index: content/browser/transition_browsertest.cc |
diff --git a/content/browser/transition_browsertest.cc b/content/browser/transition_browsertest.cc |
index 5cc07e6f467104bf1f0e966e8addc0cd9cf439d0..b5c835ca8328d445a7a828bb06123032874d93ae 100644 |
--- a/content/browser/transition_browsertest.cc |
+++ b/content/browser/transition_browsertest.cc |
@@ -9,6 +9,7 @@ |
#include "content/browser/transition_request_manager.h" |
#include "content/browser/web_contents/web_contents_impl.h" |
#include "content/public/browser/web_contents_observer.h" |
+#include "content/public/test/browser_test_utils.h" |
#include "content/public/test/content_browser_test.h" |
#include "content/public/test/content_browser_test_utils.h" |
#include "content/public/test/test_utils.h" |
@@ -116,4 +117,41 @@ IN_PROC_BROWSER_TEST_F(TransitionBrowserTest, |
ASSERT_TRUE(observer->did_defer_response()); |
} |
+// This tests that the renderer is reused between the outgoing and transition. |
+IN_PROC_BROWSER_TEST_F(TransitionBrowserTest, |
+ TransitionNavigationSharesRenderer) { |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
+ |
+ NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); |
+ |
+ GURL transition_url = |
+ TransitionRequestManager::GetInstance()->CreateTransitionURL(); |
+ |
+ int outgoing_process_id = |
+ shell()->web_contents()->GetRenderProcessHost()->GetID(); |
+ |
+ TransitionRequestManager::GetInstance()->AddPendingTransitionProcessID( |
+ transition_url, outgoing_process_id); |
+ |
+ Shell* shell2 = |
+ Shell::CreateNewWindow(shell()->web_contents()->GetBrowserContext(), |
+ GURL(), |
+ NULL, |
+ MSG_ROUTING_NONE, |
+ gfx::Size()); |
+ |
+ NavigationController::LoadURLParams params( |
+ embedded_test_server()->GetURL("/title2.html")); |
+ params.transition_type = PageTransitionFromInt( |
+ PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR); |
+ params.virtual_url_for_transition = transition_url; |
+ shell2->web_contents()->GetController().LoadURLWithParams(params); |
+ shell2->web_contents()->Focus(); |
+ |
+ WaitForLoadStop(shell2->web_contents()); |
+ |
+ ASSERT_EQ(outgoing_process_id, |
+ shell2->web_contents()->GetRenderProcessHost()->GetID()); |
+} |
+ |
} // namespace content |