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 6201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6212 observer.Wait(); | 6212 observer.Wait(); |
6213 EXPECT_EQ(1U, root->child_count()); | 6213 EXPECT_EQ(1U, root->child_count()); |
6214 | 6214 |
6215 // Make sure the a.com renderer does not crash. | 6215 // Make sure the a.com renderer does not crash. |
6216 int child_count = 0; | 6216 int child_count = 0; |
6217 EXPECT_TRUE(ExecuteScriptAndExtractInt( | 6217 EXPECT_TRUE(ExecuteScriptAndExtractInt( |
6218 root, "domAutomationController.send(frames.length)", &child_count)); | 6218 root, "domAutomationController.send(frames.length)", &child_count)); |
6219 EXPECT_EQ(1, child_count); | 6219 EXPECT_EQ(1, child_count); |
6220 } | 6220 } |
6221 | 6221 |
6222 #if defined(OS_LINUX) | |
6223 #define MAYBE_NavigateAboutBlankAndDetach DISABLED_NavigateAboutBlankAndDetach | |
6224 #else | |
6225 #define MAYBE_NavigateAboutBlankAndDetach NavigateAboutBlankAndDetach | |
6226 #endif | |
6227 // Similar to NavigateProxyAndDetachBeforeCommit, but uses a synchronous | 6222 // Similar to NavigateProxyAndDetachBeforeCommit, but uses a synchronous |
6228 // navigation to about:blank and the parent removes the child frame in a load | 6223 // navigation to about:blank and the parent removes the child frame in a load |
6229 // event handler for the subframe. | 6224 // event handler for the subframe. |
6230 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 6225 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateAboutBlankAndDetach) { |
alexmos
2017/01/13 02:26:54
This test was disabled in https://crbug.com/660622
Charlie Reis
2017/01/18 00:18:41
Acknowledged.
| |
6231 MAYBE_NavigateAboutBlankAndDetach) { | |
6232 GURL main_url( | 6226 GURL main_url( |
6233 embedded_test_server()->GetURL("a.com", "/remove_frame_on_load.html")); | 6227 embedded_test_server()->GetURL("a.com", "/remove_frame_on_load.html")); |
6234 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 6228 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
6235 | 6229 |
6236 WebContents* contents = shell()->web_contents(); | 6230 WebContents* contents = shell()->web_contents(); |
6237 FrameTreeNode* root = | 6231 FrameTreeNode* root = |
6238 static_cast<WebContentsImpl*>(contents)->GetFrameTree()->root(); | 6232 static_cast<WebContentsImpl*>(contents)->GetFrameTree()->root(); |
6239 EXPECT_EQ(1U, root->child_count()); | 6233 EXPECT_EQ(1U, root->child_count()); |
6240 FrameTreeNode* child = root->child_at(0); | 6234 FrameTreeNode* child = root->child_at(0); |
6241 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 6235 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
6242 child->current_frame_host()->GetSiteInstance()); | 6236 child->current_frame_host()->GetSiteInstance()); |
6243 | 6237 |
6244 // Navigate the child frame to "about:blank" from the parent document. | 6238 // Navigate the child frame to "about:blank" from the parent document and |
6245 TestNavigationObserver observer(shell()->web_contents()); | 6239 // wait for it to be removed. |
6240 FrameDeletedObserver observer(child); | |
6246 EXPECT_TRUE(ExecuteScript( | 6241 EXPECT_TRUE(ExecuteScript( |
6247 root, base::StringPrintf("f.src = '%s'", url::kAboutBlankURL))); | 6242 root, base::StringPrintf("f.src = '%s'", url::kAboutBlankURL))); |
6248 observer.Wait(); | 6243 observer.Wait(); |
6249 | 6244 |
6250 // Make sure the a.com renderer does not crash and the frame is removed. | 6245 // Make sure the a.com renderer does not crash and the frame is removed. |
6251 int child_count = 0; | 6246 int child_count = 0; |
6252 EXPECT_TRUE(ExecuteScriptAndExtractInt( | 6247 EXPECT_TRUE(ExecuteScriptAndExtractInt( |
6253 root, "domAutomationController.send(frames.length)", &child_count)); | 6248 root, "domAutomationController.send(frames.length)", &child_count)); |
6254 EXPECT_EQ(0, child_count); | 6249 EXPECT_EQ(0, child_count); |
6255 } | 6250 } |
(...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9040 | 9035 |
9041 std::string result; | 9036 std::string result; |
9042 EXPECT_TRUE(ExecuteScriptAndExtractString( | 9037 EXPECT_TRUE(ExecuteScriptAndExtractString( |
9043 root, | 9038 root, |
9044 "window.domAutomationController.send(frames[0].document.body.innerText);", | 9039 "window.domAutomationController.send(frames[0].document.body.innerText);", |
9045 &result)); | 9040 &result)); |
9046 EXPECT_EQ("This page has no title.", result); | 9041 EXPECT_EQ("This page has no title.", result); |
9047 } | 9042 } |
9048 | 9043 |
9049 } // namespace content | 9044 } // namespace content |
OLD | NEW |