Chromium Code Reviews| Index: content/browser/transition_browsertest.cc |
| diff --git a/content/browser/transition_browsertest.cc b/content/browser/transition_browsertest.cc |
| index 5cc07e6f467104bf1f0e966e8addc0cd9cf439d0..2683a78475eefe7af25b0e3358cb93b0c4fc9490 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,32 @@ 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")); |
| + |
| + int outgoing_process_id = |
| + shell()->web_contents()->GetRenderProcessHost()->GetID(); |
| + |
| + WebContents::CreateParams create_params( |
| + shell()->web_contents()->GetBrowserContext(), |
| + shell()->web_contents()->GetSiteInstance()); |
| + scoped_ptr<WebContents> transition_web_contents( |
| + WebContents::Create(create_params)); |
| + |
| + NavigationController::LoadURLParams params(GURL(url::kAboutBlankURL)); |
| + transition_web_contents->GetController().LoadURLWithParams(params); |
| + transition_web_contents->Focus(); |
| + |
| + WaitForLoadStop(transition_web_contents.get()); |
| + |
| + int transition_process_id = |
| + transition_web_contents->GetRenderProcessHost()->GetID(); |
| + |
| + ASSERT_EQ(outgoing_process_id, transition_process_id); |
|
Charlie Reis
2014/07/25 17:31:22
nit: Use EXPECT_* for things we're testing (so tha
shatch
2014/07/25 20:57:06
Done.
|
| +} |
| + |
| } // namespace content |