| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 *target_routing_id = | 83 *target_routing_id = |
| 84 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); | 84 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); |
| 85 EXPECT_NE(*target_routing_id, | 85 EXPECT_NE(*target_routing_id, |
| 86 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); | 86 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); |
| 87 | 87 |
| 88 // Now, simulate a link click coming from the renderer. | 88 // Now, simulate a link click coming from the renderer. |
| 89 GURL extension_url("https://bar.com/simple_page.html"); | 89 GURL extension_url("https://bar.com/simple_page.html"); |
| 90 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); | 90 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); |
| 91 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( | 91 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( |
| 92 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false, | 92 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false, |
| 93 nullptr, nullptr, Referrer(), CURRENT_TAB, false, true); | 93 nullptr, nullptr, Referrer(), WindowOpenDisposition::CURRENT_TAB, false, |
| 94 true); |
| 94 | 95 |
| 95 // Since the navigation above requires a cross-process swap, there will be a | 96 // Since the navigation above requires a cross-process swap, there will be a |
| 96 // speculative/pending RenderFrameHost. Ensure it exists and is in a different | 97 // speculative/pending RenderFrameHost. Ensure it exists and is in a different |
| 97 // process than the initial page. | 98 // process than the initial page. |
| 98 RenderFrameHostImpl* next_rfh; | 99 RenderFrameHostImpl* next_rfh; |
| 99 if (IsBrowserSideNavigationEnabled()) | 100 if (IsBrowserSideNavigationEnabled()) |
| 100 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host(); | 101 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host(); |
| 101 else | 102 else |
| 102 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host(); | 103 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host(); |
| 103 | 104 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 // separate task of the message loop, so ensure that the process is still | 551 // separate task of the message loop, so ensure that the process is still |
| 551 // considered alive. | 552 // considered alive. |
| 552 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); | 553 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); |
| 553 | 554 |
| 554 exit_observer.Wait(); | 555 exit_observer.Wait(); |
| 555 EXPECT_FALSE(exit_observer.did_exit_normally()); | 556 EXPECT_FALSE(exit_observer.did_exit_normally()); |
| 556 ResourceDispatcherHost::Get()->SetDelegate(nullptr); | 557 ResourceDispatcherHost::Get()->SetDelegate(nullptr); |
| 557 } | 558 } |
| 558 | 559 |
| 559 } // namespace content | 560 } // namespace content |
| OLD | NEW |