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

Unified Diff: content/browser/transition_browsertest.cc

Issue 378743002: Navigation transitions: Place transition page in same process as destination page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/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

Powered by Google App Engine
This is Rietveld 408576698