| 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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2268 GURL main_url(embedded_test_server()->GetURL( | 2268 GURL main_url(embedded_test_server()->GetURL( |
| 2269 "a.com", "/cross_site_iframe_factory.html?a(a)")); | 2269 "a.com", "/cross_site_iframe_factory.html?a(a)")); |
| 2270 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 2270 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
| 2271 | 2271 |
| 2272 // It is safe to obtain the root frame tree node here, as it doesn't change. | 2272 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 2273 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 2273 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| 2274 FrameTreeNode* child = root->child_at(0); | 2274 FrameTreeNode* child = root->child_at(0); |
| 2275 GURL url_a = child->current_url(); | 2275 GURL url_a = child->current_url(); |
| 2276 | 2276 |
| 2277 // Disable host resolution in the test server and try to navigate the subframe | 2277 // Disable host resolution in the test server and try to navigate the subframe |
| 2278 // cross-site, which will lead to a committed net error (which looks like | 2278 // cross-site, which will lead to a committed net error. |
| 2279 // success to the TestNavigationObserver). | |
| 2280 GURL url_b = embedded_test_server()->GetURL("b.com", "/title3.html"); | 2279 GURL url_b = embedded_test_server()->GetURL("b.com", "/title3.html"); |
| 2281 host_resolver()->ClearRules(); | 2280 host_resolver()->ClearRules(); |
| 2282 TestNavigationObserver observer(shell()->web_contents()); | 2281 TestNavigationObserver observer(shell()->web_contents()); |
| 2283 NavigateIframeToURL(shell()->web_contents(), "child-0", url_b); | 2282 NavigateIframeToURL(shell()->web_contents(), "child-0", url_b); |
| 2284 EXPECT_TRUE(observer.last_navigation_succeeded()); | 2283 EXPECT_FALSE(observer.last_navigation_succeeded()); |
| 2285 EXPECT_EQ(url_b, observer.last_navigation_url()); | 2284 EXPECT_EQ(url_b, observer.last_navigation_url()); |
| 2286 EXPECT_EQ(2, shell()->web_contents()->GetController().GetEntryCount()); | 2285 EXPECT_EQ(2, shell()->web_contents()->GetController().GetEntryCount()); |
| 2287 | 2286 |
| 2288 // PlzNavigate: Ensure that we have created a new process for the subframe. | 2287 // PlzNavigate: Ensure that we have created a new process for the subframe. |
| 2289 if (IsBrowserSideNavigationEnabled()) { | 2288 if (IsBrowserSideNavigationEnabled()) { |
| 2290 EXPECT_EQ( | 2289 EXPECT_EQ( |
| 2291 " Site A ------------ proxies for B\n" | 2290 " Site A ------------ proxies for B\n" |
| 2292 " +--Site B ------- proxies for A\n" | 2291 " +--Site B ------- proxies for A\n" |
| 2293 "Where A = http://a.com/\n" | 2292 "Where A = http://a.com/\n" |
| 2294 " B = http://b.com/", | 2293 " B = http://b.com/", |
| (...skipping 6871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9166 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); | 9165 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); |
| 9167 | 9166 |
| 9168 // Pretend that a.com just requested a context menu. This used to cause a | 9167 // Pretend that a.com just requested a context menu. This used to cause a |
| 9169 // because the RenderWidgetHostView is destroyed when the frame is swapped and | 9168 // because the RenderWidgetHostView is destroyed when the frame is swapped and |
| 9170 // added to pending delete list. | 9169 // added to pending delete list. |
| 9171 rfh->OnMessageReceived( | 9170 rfh->OnMessageReceived( |
| 9172 FrameHostMsg_ContextMenu(rfh->GetRoutingID(), ContextMenuParams())); | 9171 FrameHostMsg_ContextMenu(rfh->GetRoutingID(), ContextMenuParams())); |
| 9173 } | 9172 } |
| 9174 | 9173 |
| 9175 } // namespace content | 9174 } // namespace content |
| OLD | NEW |