Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2496233003: Destroy the old RenderWidgetHostView when swapping out a main frame. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 8786 matching lines...) Expand 10 before | Expand all | Expand 10 after
8797 load_observer.Wait(); 8797 load_observer.Wait();
8798 8798
8799 // Ensure that the iframe reuses its parent's process. 8799 // Ensure that the iframe reuses its parent's process.
8800 EXPECT_EQ(blank_url, child->current_url()); 8800 EXPECT_EQ(blank_url, child->current_url());
8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), 8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
8802 child->current_frame_host()->GetSiteInstance()); 8802 child->current_frame_host()->GetSiteInstance());
8803 EXPECT_EQ(root->current_frame_host()->GetProcess(), 8803 EXPECT_EQ(root->current_frame_host()->GetProcess(),
8804 child->current_frame_host()->GetProcess()); 8804 child->current_frame_host()->GetProcess());
8805 } 8805 }
8806 8806
8807 // This tests that we don't hide the RenderViewHost when reusing the
8808 // RenderViewHost for a subframe. See https://crbug.com/638375.
8809 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ReusedRenderViewNotHidden) {
8810 GURL a_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
8811 GURL b_url_a_subframe(embedded_test_server()->GetURL(
8812 "b.com", "/cross_site_iframe_factory.html?b(a)"));
8813
8814 EXPECT_TRUE(NavigateToURL(shell(), a_url));
8815
8816 // Open a popup in a.com.
8817 Shell* popup = OpenPopup(shell(), a_url, "popup");
8818
8819 // Navigate this popup to b.com with an a.com subframe.
8820 EXPECT_TRUE(NavigateToURL(popup, b_url_a_subframe));
8821
8822 FrameTreeNode* root = static_cast<WebContentsImpl*>(popup->web_contents())
8823 ->GetFrameTree()
8824 ->root();
8825 FrameTreeNode* child_node = root->child_at(0);
8826
8827 EXPECT_FALSE(child_node->current_frame_host()
8828 ->render_view_host()
8829 ->GetWidget()
8830 ->is_hidden());
8831 }
8832
8807 } // namespace content 8833 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698