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/renderer_host/test_render_view_host.h" | 7 #include "content/browser/renderer_host/test_render_view_host.h" |
8 #include "content/browser/site_instance_impl.h" | 8 #include "content/browser/site_instance_impl.h" |
9 #include "content/browser/web_contents/navigation_controller_impl.h" | 9 #include "content/browser/web_contents/navigation_controller_impl.h" |
10 #include "content/browser/web_contents/navigation_entry_impl.h" | 10 #include "content/browser/web_contents/navigation_entry_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->ShouldSwapBrowsingInstanceForNavigation(cur_entry, | 183 return manager->ShouldSwapProcessesForNavigation(cur_entry, new_entry); |
184 new_entry); | |
185 } | 184 } |
186 | 185 |
187 private: | 186 private: |
188 RenderViewHostManagerTestClient client_; | 187 RenderViewHostManagerTestClient client_; |
189 RenderViewHostManagerTestBrowserClient browser_client_; | 188 RenderViewHostManagerTestBrowserClient browser_client_; |
190 content::ContentClient* old_client_; | 189 content::ContentClient* old_client_; |
191 content::ContentBrowserClient* old_browser_client_; | 190 content::ContentBrowserClient* old_browser_client_; |
192 }; | 191 }; |
193 | 192 |
194 // Tests that when you navigate from the New TabPage to another page, and | 193 // 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... |
829 EXPECT_FALSE(rvh1->GetSiteInstance()->IsRelatedSiteInstance( | 828 EXPECT_FALSE(rvh1->GetSiteInstance()->IsRelatedSiteInstance( |
830 rvh3->GetSiteInstance())); | 829 rvh3->GetSiteInstance())); |
831 | 830 |
832 // No scripting is allowed across BrowsingInstances, so we should not create | 831 // No scripting is allowed across BrowsingInstances, so we should not create |
833 // swapped out RVHs for the opener chain in this case. | 832 // swapped out RVHs for the opener chain in this case. |
834 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( | 833 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( |
835 rvh3->GetSiteInstance())); | 834 rvh3->GetSiteInstance())); |
836 EXPECT_FALSE(opener2_manager->GetSwappedOutRenderViewHost( | 835 EXPECT_FALSE(opener2_manager->GetSwappedOutRenderViewHost( |
837 rvh3->GetSiteInstance())); | 836 rvh3->GetSiteInstance())); |
838 } | 837 } |
OLD | NEW |