| 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 6058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6069 observer.Wait(); | 6069 observer.Wait(); |
| 6070 EXPECT_EQ(1U, root->child_count()); | 6070 EXPECT_EQ(1U, root->child_count()); |
| 6071 | 6071 |
| 6072 // Make sure the a.com renderer does not crash. | 6072 // Make sure the a.com renderer does not crash. |
| 6073 int child_count = 0; | 6073 int child_count = 0; |
| 6074 EXPECT_TRUE(ExecuteScriptAndExtractInt( | 6074 EXPECT_TRUE(ExecuteScriptAndExtractInt( |
| 6075 root, "domAutomationController.send(frames.length)", &child_count)); | 6075 root, "domAutomationController.send(frames.length)", &child_count)); |
| 6076 EXPECT_EQ(1, child_count); | 6076 EXPECT_EQ(1, child_count); |
| 6077 } | 6077 } |
| 6078 | 6078 |
| 6079 #if defined(OS_LINUX) |
| 6080 #define MAYBE_NavigateAboutBlankAndDetach DISABLED_NavigateAboutBlankAndDetach |
| 6081 #else |
| 6082 #define MAYBE_NavigateAboutBlankAndDetach NavigateAboutBlankAndDetach |
| 6083 #endif |
| 6079 // Similar to NavigateProxyAndDetachBeforeCommit, but uses a synchronous | 6084 // Similar to NavigateProxyAndDetachBeforeCommit, but uses a synchronous |
| 6080 // navigation to about:blank and the parent removes the child frame in a load | 6085 // navigation to about:blank and the parent removes the child frame in a load |
| 6081 // event handler for the subframe. | 6086 // event handler for the subframe. |
| 6082 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateAboutBlankAndDetach) { | 6087 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| 6088 MAYBE_NavigateAboutBlankAndDetach) { |
| 6083 GURL main_url( | 6089 GURL main_url( |
| 6084 embedded_test_server()->GetURL("a.com", "/remove_frame_on_load.html")); | 6090 embedded_test_server()->GetURL("a.com", "/remove_frame_on_load.html")); |
| 6085 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 6091 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
| 6086 | 6092 |
| 6087 WebContents* contents = shell()->web_contents(); | 6093 WebContents* contents = shell()->web_contents(); |
| 6088 FrameTreeNode* root = | 6094 FrameTreeNode* root = |
| 6089 static_cast<WebContentsImpl*>(contents)->GetFrameTree()->root(); | 6095 static_cast<WebContentsImpl*>(contents)->GetFrameTree()->root(); |
| 6090 EXPECT_EQ(1U, root->child_count()); | 6096 EXPECT_EQ(1U, root->child_count()); |
| 6091 FrameTreeNode* child = root->child_at(0); | 6097 FrameTreeNode* child = root->child_at(0); |
| 6092 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 6098 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
| (...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8520 EXPECT_TRUE(NavigateToURL(shell(), b_url)); | 8526 EXPECT_TRUE(NavigateToURL(shell(), b_url)); |
| 8521 | 8527 |
| 8522 base::string16 expected_title(base::UTF8ToUTF16("foo")); | 8528 base::string16 expected_title(base::UTF8ToUTF16("foo")); |
| 8523 TitleWatcher title_watcher(popup2->web_contents(), expected_title); | 8529 TitleWatcher title_watcher(popup2->web_contents(), expected_title); |
| 8524 EXPECT_TRUE(ExecuteScript( | 8530 EXPECT_TRUE(ExecuteScript( |
| 8525 shell(), "window.open('','popup2').postMessage('foo', '*');")); | 8531 shell(), "window.open('','popup2').postMessage('foo', '*');")); |
| 8526 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 8532 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 8527 } | 8533 } |
| 8528 | 8534 |
| 8529 } // namespace content | 8535 } // namespace content |
| OLD | NEW |