OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "content/browser/browser_thread_impl.h" | 6 #include "content/browser/browser_thread_impl.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_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
10 #include "content/browser/web_contents/navigation_controller_impl.h" | 10 #include "content/browser/web_contents/navigation_controller_impl.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation | 174 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation |
175 // without making any network requests. | 175 // without making any network requests. |
176 if (old_rvh != active_rvh()) | 176 if (old_rvh != active_rvh()) |
177 old_rvh->OnSwapOutACK(); | 177 old_rvh->OnSwapOutACK(); |
178 } | 178 } |
179 | 179 |
180 bool ShouldSwapProcesses(RenderViewHostManager* manager, | 180 bool ShouldSwapProcesses(RenderViewHostManager* manager, |
181 const NavigationEntryImpl* cur_entry, | 181 const NavigationEntryImpl* cur_entry, |
182 const NavigationEntryImpl* new_entry) const { | 182 const NavigationEntryImpl* new_entry) const { |
183 return manager->ShouldSwapProcessesForNavigation(cur_entry, new_entry); | 183 return manager->ShouldSwapBrowsingInstancesForNavigation(cur_entry, |
| 184 new_entry); |
184 } | 185 } |
185 | 186 |
186 private: | 187 private: |
187 RenderViewHostManagerTestClient client_; | 188 RenderViewHostManagerTestClient client_; |
188 RenderViewHostManagerTestBrowserClient browser_client_; | 189 RenderViewHostManagerTestBrowserClient browser_client_; |
189 content::ContentClient* old_client_; | 190 content::ContentClient* old_client_; |
190 content::ContentBrowserClient* old_browser_client_; | 191 content::ContentBrowserClient* old_browser_client_; |
191 }; | 192 }; |
192 | 193 |
193 // Tests that when you navigate from the New TabPage to another page, and | 194 // Tests that when you navigate from the New TabPage to another page, and |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 EXPECT_FALSE(rvh1->GetSiteInstance()->IsRelatedSiteInstance( | 829 EXPECT_FALSE(rvh1->GetSiteInstance()->IsRelatedSiteInstance( |
829 rvh3->GetSiteInstance())); | 830 rvh3->GetSiteInstance())); |
830 | 831 |
831 // No scripting is allowed across BrowsingInstances, so we should not create | 832 // No scripting is allowed across BrowsingInstances, so we should not create |
832 // swapped out RVHs for the opener chain in this case. | 833 // swapped out RVHs for the opener chain in this case. |
833 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( | 834 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( |
834 rvh3->GetSiteInstance())); | 835 rvh3->GetSiteInstance())); |
835 EXPECT_FALSE(opener2_manager->GetSwappedOutRenderViewHost( | 836 EXPECT_FALSE(opener2_manager->GetSwappedOutRenderViewHost( |
836 rvh3->GetSiteInstance())); | 837 rvh3->GetSiteInstance())); |
837 } | 838 } |
OLD | NEW |