| 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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 8233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8244 ->GetFrameTree() | 8244 ->GetFrameTree() |
| 8245 ->root(); | 8245 ->root(); |
| 8246 | 8246 |
| 8247 // Start a cross-process navigation and wait until the response is received. | 8247 // Start a cross-process navigation and wait until the response is received. |
| 8248 GURL cross_site_url_1 = | 8248 GURL cross_site_url_1 = |
| 8249 embedded_test_server()->GetURL("b.com", "/title1.html"); | 8249 embedded_test_server()->GetURL("b.com", "/title1.html"); |
| 8250 TestNavigationManager cross_site_manager(shell()->web_contents(), | 8250 TestNavigationManager cross_site_manager(shell()->web_contents(), |
| 8251 cross_site_url_1); | 8251 cross_site_url_1); |
| 8252 shell()->web_contents()->GetController().LoadURL( | 8252 shell()->web_contents()->GetController().LoadURL( |
| 8253 cross_site_url_1, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 8253 cross_site_url_1, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
| 8254 EXPECT_TRUE(cross_site_manager.WaitForWillProcessResponse()); | 8254 EXPECT_TRUE(cross_site_manager.WaitForResponse()); |
| 8255 | 8255 |
| 8256 // Start a renderer-initiated navigation to a cross-process url and make sure | 8256 // Start a renderer-initiated navigation to a cross-process url and make sure |
| 8257 // the navigation will be blocked before being transferred. | 8257 // the navigation will be blocked before being transferred. |
| 8258 GURL cross_site_url_2 = | 8258 GURL cross_site_url_2 = |
| 8259 embedded_test_server()->GetURL("c.com", "/title1.html"); | 8259 embedded_test_server()->GetURL("c.com", "/title1.html"); |
| 8260 TestNavigationManager transfer_manager(shell()->web_contents(), | 8260 TestNavigationManager transfer_manager(shell()->web_contents(), |
| 8261 cross_site_url_2); | 8261 cross_site_url_2); |
| 8262 EXPECT_TRUE(ExecuteScript( | 8262 EXPECT_TRUE(ExecuteScript( |
| 8263 root, "location.href = '" + cross_site_url_2.spec() + "';")); | 8263 root, "location.href = '" + cross_site_url_2.spec() + "';")); |
| 8264 EXPECT_TRUE(transfer_manager.WaitForWillProcessResponse()); | 8264 EXPECT_TRUE(transfer_manager.WaitForResponse()); |
| 8265 | 8265 |
| 8266 // Now have the cross-process navigation commit and mark the current RFH as | 8266 // Now have the cross-process navigation commit and mark the current RFH as |
| 8267 // pending deletion. | 8267 // pending deletion. |
| 8268 cross_site_manager.WaitForNavigationFinished(); | 8268 cross_site_manager.WaitForNavigationFinished(); |
| 8269 | 8269 |
| 8270 // Resume the navigation in the previous RFH that has just been marked as | 8270 // Resume the navigation in the previous RFH that has just been marked as |
| 8271 // pending deletion. We should not crash. | 8271 // pending deletion. We should not crash. |
| 8272 transfer_manager.WaitForNavigationFinished(); | 8272 transfer_manager.WaitForNavigationFinished(); |
| 8273 } | 8273 } |
| 8274 | 8274 |
| 8275 } // namespace content | 8275 } // namespace content |
| OLD | NEW |