| 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 7833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7844 GURL main_url(embedded_test_server()->GetURL( | 7844 GURL main_url(embedded_test_server()->GetURL( |
| 7845 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 7845 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
| 7846 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 7846 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
| 7847 | 7847 |
| 7848 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 7848 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) |
| 7849 ->GetFrameTree() | 7849 ->GetFrameTree() |
| 7850 ->root(); | 7850 ->root(); |
| 7851 | 7851 |
| 7852 // "Select all" in the subframe. The bug only happens if there's a selection | 7852 // "Select all" in the subframe. The bug only happens if there's a selection |
| 7853 // change, which triggers the path through didChangeSelection. | 7853 // change, which triggers the path through didChangeSelection. |
| 7854 root->child_at(0)->current_frame_host()->Send(new InputMsg_SelectAll( | 7854 root->child_at(0)->current_frame_host()->GetFrameInputHandler()->SelectAll(); |
| 7855 root->child_at(0)->current_frame_host()->GetRoutingID())); | |
| 7856 | 7855 |
| 7857 // Prevent b.com process from terminating right away once the subframe | 7856 // Prevent b.com process from terminating right away once the subframe |
| 7858 // navigates away from b.com below. This is necessary so that the renderer | 7857 // navigates away from b.com below. This is necessary so that the renderer |
| 7859 // process has time to process the closings of RenderWidget and RenderView, | 7858 // process has time to process the closings of RenderWidget and RenderView, |
| 7860 // which is where the original bug was triggered. Incrementing worker | 7859 // which is where the original bug was triggered. Incrementing worker |
| 7861 // RefCount will cause RenderProcessHostImpl::Cleanup to forego process | 7860 // RefCount will cause RenderProcessHostImpl::Cleanup to forego process |
| 7862 // termination. | 7861 // termination. |
| 7863 RenderProcessHost* subframe_process = | 7862 RenderProcessHost* subframe_process = |
| 7864 root->child_at(0)->current_frame_host()->GetProcess(); | 7863 root->child_at(0)->current_frame_host()->GetProcess(); |
| 7865 subframe_process->IncrementSharedWorkerRefCount(); | 7864 subframe_process->IncrementSharedWorkerRefCount(); |
| (...skipping 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10182 // Go back again. This should go to foo.com. | 10181 // Go back again. This should go to foo.com. |
| 10183 { | 10182 { |
| 10184 TestNavigationObserver back_observer(web_contents()); | 10183 TestNavigationObserver back_observer(web_contents()); |
| 10185 web_contents()->GetController().GoBack(); | 10184 web_contents()->GetController().GoBack(); |
| 10186 back_observer.Wait(); | 10185 back_observer.Wait(); |
| 10187 } | 10186 } |
| 10188 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); | 10187 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); |
| 10189 } | 10188 } |
| 10190 | 10189 |
| 10191 } // namespace content | 10190 } // namespace content |
| OLD | NEW |