OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
8 #include "content/public/browser/web_contents_delegate.h" | 8 #include "content/public/browser/web_contents_delegate.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); | 107 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); |
108 NavigateToURL(shell(), url1); | 108 NavigateToURL(shell(), url1); |
109 | 109 |
110 Shell* popup = OpenWindowFromJavaScript(shell(), url2); | 110 Shell* popup = OpenWindowFromJavaScript(shell(), url2); |
111 NavigateToURL(popup, url3); | 111 NavigateToURL(popup, url3); |
112 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); | 112 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); |
113 } | 113 } |
114 | 114 |
115 // Tests that window.close() works in a popup window that has navigated a few | 115 // Tests that window.close() works in a popup window that has navigated a few |
116 // times and swapped processes. | 116 // times and swapped processes. |
117 // Crashes on all platforms. http://crbug.com/399709 | 117 IN_PROC_BROWSER_TEST_F(OpenedByDOMTest, CrossProcessPopup) { |
118 IN_PROC_BROWSER_TEST_F(OpenedByDOMTest, DISABLED_CrossProcessPopup) { | |
119 host_resolver()->AddRule("*", "127.0.0.1"); | 118 host_resolver()->AddRule("*", "127.0.0.1"); |
120 ASSERT_TRUE(test_server()->Start()); | 119 ASSERT_TRUE(test_server()->Start()); |
121 | 120 |
122 GURL url1 = test_server()->GetURL("files/site_isolation/blank.html?1"); | 121 GURL url1 = test_server()->GetURL("files/site_isolation/blank.html?1"); |
123 | 122 |
124 GURL url2 = test_server()->GetURL("files/site_isolation/blank.html?2"); | 123 GURL url2 = test_server()->GetURL("files/site_isolation/blank.html?2"); |
125 GURL::Replacements replace_host; | 124 GURL::Replacements replace_host; |
126 replace_host.SetHostStr("foo.com"); | 125 replace_host.SetHostStr("foo.com"); |
127 url2 = url2.ReplaceComponents(replace_host); | 126 url2 = url2.ReplaceComponents(replace_host); |
128 | 127 |
129 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); | 128 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); |
130 url3 = url3.ReplaceComponents(replace_host); | 129 url3 = url3.ReplaceComponents(replace_host); |
131 | 130 |
132 NavigateToURL(shell(), url1); | 131 NavigateToURL(shell(), url1); |
133 | 132 |
134 Shell* popup = OpenWindowFromJavaScript(shell(), url2); | 133 Shell* popup = OpenWindowFromJavaScript(shell(), url2); |
135 NavigateToURL(popup, url3); | 134 NavigateToURL(popup, url3); |
136 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); | 135 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); |
137 } | 136 } |
138 | 137 |
139 } // namespace content | 138 } // namespace content |
OLD | NEW |