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 std::string foo_com("foo.com"); | 125 std::string foo_com("foo.com"); |
127 replace_host.SetHostStr(foo_com); | 126 replace_host.SetHostStr(foo_com); |
128 url2 = url2.ReplaceComponents(replace_host); | 127 url2 = url2.ReplaceComponents(replace_host); |
129 | 128 |
130 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); | 129 GURL url3 = test_server()->GetURL("files/site_isolation/blank.html?3"); |
131 url3 = url3.ReplaceComponents(replace_host); | 130 url3 = url3.ReplaceComponents(replace_host); |
132 | 131 |
133 NavigateToURL(shell(), url1); | 132 NavigateToURL(shell(), url1); |
134 | 133 |
135 Shell* popup = OpenWindowFromJavaScript(shell(), url2); | 134 Shell* popup = OpenWindowFromJavaScript(shell(), url2); |
136 NavigateToURL(popup, url3); | 135 NavigateToURL(popup, url3); |
137 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); | 136 EXPECT_TRUE(AttemptCloseFromJavaScript(popup->web_contents())); |
138 } | 137 } |
139 | 138 |
140 } // namespace content | 139 } // namespace content |
OLD | NEW |