OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/browser_thread_impl.h" | 5 #include "content/browser/browser_thread_impl.h" |
6 #include "content/browser/browser_url_handler.h" | 6 #include "content/browser/browser_url_handler.h" |
7 #include "content/browser/mock_content_browser_client.h" | 7 #include "content/browser/mock_content_browser_client.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance.h" | 9 #include "content/browser/site_instance.h" |
10 #include "content/browser/tab_contents/navigation_controller_impl.h" | 10 #include "content/browser/tab_contents/navigation_controller_impl.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 TestRenderViewHost* dest_rvh2 = static_cast<TestRenderViewHost*>( | 191 TestRenderViewHost* dest_rvh2 = static_cast<TestRenderViewHost*>( |
192 contents2.GetRenderManagerForTesting()->pending_render_view_host()); | 192 contents2.GetRenderManagerForTesting()->pending_render_view_host()); |
193 ASSERT_TRUE(dest_rvh2); | 193 ASSERT_TRUE(dest_rvh2); |
194 ntp_rvh2->SendShouldCloseACK(true); | 194 ntp_rvh2->SendShouldCloseACK(true); |
195 dest_rvh2->SendNavigate(101, kDestUrl); | 195 dest_rvh2->SendNavigate(101, kDestUrl); |
196 ntp_rvh2->OnSwapOutACK(); | 196 ntp_rvh2->OnSwapOutACK(); |
197 | 197 |
198 // The two RVH's should be different in every way. | 198 // The two RVH's should be different in every way. |
199 EXPECT_NE(active_rvh()->process(), dest_rvh2->process()); | 199 EXPECT_NE(active_rvh()->process(), dest_rvh2->process()); |
200 EXPECT_NE(active_rvh()->site_instance(), dest_rvh2->site_instance()); | 200 EXPECT_NE(active_rvh()->site_instance(), dest_rvh2->site_instance()); |
201 EXPECT_NE(active_rvh()->site_instance()->browsing_instance(), | 201 EXPECT_NE(active_rvh()->site_instance()->browsing_instance_, |
202 dest_rvh2->site_instance()->browsing_instance()); | 202 dest_rvh2->site_instance()->browsing_instance_); |
203 | 203 |
204 // Navigate both to the new tab page, and verify that they share a | 204 // Navigate both to the new tab page, and verify that they share a |
205 // SiteInstance. | 205 // SiteInstance. |
206 NavigateActiveAndCommit(kNtpUrl); | 206 NavigateActiveAndCommit(kNtpUrl); |
207 | 207 |
208 contents2.GetController().LoadURL( | 208 contents2.GetController().LoadURL( |
209 kNtpUrl, content::Referrer(), content::PAGE_TRANSITION_LINK, | 209 kNtpUrl, content::Referrer(), content::PAGE_TRANSITION_LINK, |
210 std::string()); | 210 std::string()); |
211 dest_rvh2->SendShouldCloseACK(true); | 211 dest_rvh2->SendShouldCloseACK(true); |
212 static_cast<TestRenderViewHost*>(contents2.GetRenderManagerForTesting()-> | 212 static_cast<TestRenderViewHost*>(contents2.GetRenderManagerForTesting()-> |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // current one. | 615 // current one. |
616 EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> | 616 EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> |
617 pending_render_view_host() == NULL); | 617 pending_render_view_host() == NULL); |
618 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host()); | 618 EXPECT_EQ(evil_rvh, contents()->GetRenderManagerForTesting()->current_host()); |
619 | 619 |
620 // Also we should not have a pending navigation entry. | 620 // Also we should not have a pending navigation entry. |
621 NavigationEntry* entry = contents()->GetController().GetActiveEntry(); | 621 NavigationEntry* entry = contents()->GetController().GetActiveEntry(); |
622 ASSERT_TRUE(entry != NULL); | 622 ASSERT_TRUE(entry != NULL); |
623 EXPECT_EQ(kUrl2, entry->GetURL()); | 623 EXPECT_EQ(kUrl2, entry->GetURL()); |
624 } | 624 } |
OLD | NEW |