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 7825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7836 GURL main_url(embedded_test_server()->GetURL( | 7836 GURL main_url(embedded_test_server()->GetURL( |
7837 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 7837 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
7838 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 7838 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
7839 | 7839 |
7840 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 7840 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) |
7841 ->GetFrameTree() | 7841 ->GetFrameTree() |
7842 ->root(); | 7842 ->root(); |
7843 | 7843 |
7844 // "Select all" in the subframe. The bug only happens if there's a selection | 7844 // "Select all" in the subframe. The bug only happens if there's a selection |
7845 // change, which triggers the path through didChangeSelection. | 7845 // change, which triggers the path through didChangeSelection. |
7846 root->child_at(0)->current_frame_host()->Send(new InputMsg_SelectAll( | 7846 root->child_at(0)->current_frame_host()->GetFrameInputHandler()->SelectAll(); |
7847 root->child_at(0)->current_frame_host()->GetRoutingID())); | |
7848 | 7847 |
7849 // Prevent b.com process from terminating right away once the subframe | 7848 // Prevent b.com process from terminating right away once the subframe |
7850 // navigates away from b.com below. This is necessary so that the renderer | 7849 // navigates away from b.com below. This is necessary so that the renderer |
7851 // process has time to process the closings of RenderWidget and RenderView, | 7850 // process has time to process the closings of RenderWidget and RenderView, |
7852 // which is where the original bug was triggered. Incrementing worker | 7851 // which is where the original bug was triggered. Incrementing worker |
7853 // RefCount will cause RenderProcessHostImpl::Cleanup to forego process | 7852 // RefCount will cause RenderProcessHostImpl::Cleanup to forego process |
7854 // termination. | 7853 // termination. |
7855 RenderProcessHost* subframe_process = | 7854 RenderProcessHost* subframe_process = |
7856 root->child_at(0)->current_frame_host()->GetProcess(); | 7855 root->child_at(0)->current_frame_host()->GetProcess(); |
7857 subframe_process->IncrementSharedWorkerRefCount(); | 7856 subframe_process->IncrementSharedWorkerRefCount(); |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10078 names.insert(root->children[0]->frame_entry->frame_unique_name()); | 10077 names.insert(root->children[0]->frame_entry->frame_unique_name()); |
10079 } | 10078 } |
10080 | 10079 |
10081 // More than one entry in the set means that the subframe frame navigation | 10080 // More than one entry in the set means that the subframe frame navigation |
10082 // entries didn't have a consistent unique name. This will break history | 10081 // entries didn't have a consistent unique name. This will break history |
10083 // navigations =( | 10082 // navigations =( |
10084 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; | 10083 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; |
10085 } | 10084 } |
10086 | 10085 |
10087 } // namespace content | 10086 } // namespace content |
OLD | NEW |