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 8544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8555 // |popup2|. This is allowed since the main tab is |popup2|'s opener. | 8555 // |popup2|. This is allowed since the main tab is |popup2|'s opener. |
8556 EXPECT_TRUE(NavigateToURL(shell(), b_url)); | 8556 EXPECT_TRUE(NavigateToURL(shell(), b_url)); |
8557 | 8557 |
8558 base::string16 expected_title(base::UTF8ToUTF16("foo")); | 8558 base::string16 expected_title(base::UTF8ToUTF16("foo")); |
8559 TitleWatcher title_watcher(popup2->web_contents(), expected_title); | 8559 TitleWatcher title_watcher(popup2->web_contents(), expected_title); |
8560 EXPECT_TRUE(ExecuteScript( | 8560 EXPECT_TRUE(ExecuteScript( |
8561 shell(), "window.open('','popup2').postMessage('foo', '*');")); | 8561 shell(), "window.open('','popup2').postMessage('foo', '*');")); |
8562 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 8562 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
8563 } | 8563 } |
8564 | 8564 |
| 8565 // This tests that we don't hide the RenderViewHost when reusing the |
| 8566 // RenderViewHost for a subframe. See https://crbug.com/638375. |
| 8567 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ReusedRenderViewNotHidden) { |
| 8568 GURL a_url(embedded_test_server()->GetURL("a.com", "/title1.html")); |
| 8569 GURL b_url_a_subframe(embedded_test_server()->GetURL( |
| 8570 "b.com", "/cross_site_iframe_factory.html?b(a)")); |
| 8571 |
| 8572 EXPECT_TRUE(NavigateToURL(shell(), a_url)); |
| 8573 |
| 8574 // Open a popup in a.com. |
| 8575 Shell* popup = OpenPopup(shell(), a_url, "popup"); |
| 8576 |
| 8577 // Navigate this popup to b.com with an a.com subframe. |
| 8578 EXPECT_TRUE(NavigateToURL(popup, b_url_a_subframe)); |
| 8579 |
| 8580 FrameTreeNode* root = static_cast<WebContentsImpl*>(popup->web_contents()) |
| 8581 ->GetFrameTree() |
| 8582 ->root(); |
| 8583 FrameTreeNode* child_node = root->child_at(0); |
| 8584 |
| 8585 EXPECT_FALSE(child_node->current_frame_host() |
| 8586 ->render_view_host() |
| 8587 ->GetWidget() |
| 8588 ->is_hidden()); |
| 8589 } |
| 8590 |
8565 } // namespace content | 8591 } // namespace content |
OLD | NEW |