| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); | 86 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); |
| 87 EXPECT_NE(*target_routing_id, | 87 EXPECT_NE(*target_routing_id, |
| 88 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); | 88 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); |
| 89 | 89 |
| 90 // Now, simulate a link click coming from the renderer. | 90 // Now, simulate a link click coming from the renderer. |
| 91 GURL extension_url("https://bar.com/simple_page.html"); | 91 GURL extension_url("https://bar.com/simple_page.html"); |
| 92 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); | 92 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); |
| 93 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( | 93 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( |
| 94 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false, | 94 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false, |
| 95 nullptr, std::string(), Referrer(), WindowOpenDisposition::CURRENT_TAB, | 95 nullptr, std::string(), Referrer(), WindowOpenDisposition::CURRENT_TAB, |
| 96 false, false, true); | 96 false, true); |
| 97 | 97 |
| 98 // Since the navigation above requires a cross-process swap, there will be a | 98 // Since the navigation above requires a cross-process swap, there will be a |
| 99 // speculative/pending RenderFrameHost. Ensure it exists and is in a different | 99 // speculative/pending RenderFrameHost. Ensure it exists and is in a different |
| 100 // process than the initial page. | 100 // process than the initial page. |
| 101 RenderFrameHostImpl* next_rfh; | 101 RenderFrameHostImpl* next_rfh; |
| 102 if (IsBrowserSideNavigationEnabled()) | 102 if (IsBrowserSideNavigationEnabled()) |
| 103 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host(); | 103 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host(); |
| 104 else | 104 else |
| 105 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host(); | 105 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host(); |
| 106 | 106 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // |target_url|. | 606 // |target_url|. |
| 607 WaitForLoadStop(shell()->web_contents()); | 607 WaitForLoadStop(shell()->web_contents()); |
| 608 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); | 608 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); |
| 609 | 609 |
| 610 // Verify that the malicious renderer got killed. | 610 // Verify that the malicious renderer got killed. |
| 611 exit_observer.Wait(); | 611 exit_observer.Wait(); |
| 612 EXPECT_FALSE(exit_observer.did_exit_normally()); | 612 EXPECT_FALSE(exit_observer.did_exit_normally()); |
| 613 } | 613 } |
| 614 | 614 |
| 615 } // namespace content | 615 } // namespace content |
| OLD | NEW |