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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 }; | 163 }; |
164 | 164 |
165 // TODO(nasko): Disable this test until out-of-process iframes is ready and the | 165 // TODO(nasko): Disable this test until out-of-process iframes is ready and the |
166 // security checks are back in place. | 166 // security checks are back in place. |
167 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrossSiteIframe) { | 167 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrossSiteIframe) { |
168 ASSERT_TRUE(test_server()->Start()); | 168 ASSERT_TRUE(test_server()->Start()); |
169 net::TestServer https_server( | 169 net::TestServer https_server( |
170 net::TestServer::TYPE_HTTPS, | 170 net::TestServer::TYPE_HTTPS, |
171 net::TestServer::kLocalhost, | 171 net::TestServer::kLocalhost, |
172 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 172 net::TestServer::GetSourceRelativePath( |
| 173 base::FilePath(FILE_PATH_LITERAL("content/test/data")))); |
173 ASSERT_TRUE(https_server.Start()); | 174 ASSERT_TRUE(https_server.Start()); |
174 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); | 175 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); |
175 | 176 |
176 NavigateToURL(shell(), main_url); | 177 NavigateToURL(shell(), main_url); |
177 | 178 |
178 SitePerProcessWebContentsObserver observer(shell()->web_contents()); | 179 SitePerProcessWebContentsObserver observer(shell()->web_contents()); |
179 { | 180 { |
180 // Load same-site page into Iframe. | 181 // Load same-site page into Iframe. |
181 GURL http_url(test_server()->GetURL("files/title1.html")); | 182 GURL http_url(test_server()->GetURL("files/title1.html")); |
182 EXPECT_TRUE(NavigateIframeToURL(shell(), http_url, "test")); | 183 EXPECT_TRUE(NavigateIframeToURL(shell(), http_url, "test")); |
(...skipping 11 matching lines...) Expand all Loading... |
194 } | 195 } |
195 | 196 |
196 // TODO(nasko): Disable this test until out-of-process iframes is ready and the | 197 // TODO(nasko): Disable this test until out-of-process iframes is ready and the |
197 // security checks are back in place. | 198 // security checks are back in place. |
198 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 199 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
199 DISABLED_CrossSiteIframeRedirectOnce) { | 200 DISABLED_CrossSiteIframeRedirectOnce) { |
200 ASSERT_TRUE(test_server()->Start()); | 201 ASSERT_TRUE(test_server()->Start()); |
201 net::TestServer https_server( | 202 net::TestServer https_server( |
202 net::TestServer::TYPE_HTTPS, | 203 net::TestServer::TYPE_HTTPS, |
203 net::TestServer::kLocalhost, | 204 net::TestServer::kLocalhost, |
204 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 205 net::TestServer::GetSourceRelativePath( |
| 206 base::FilePath(FILE_PATH_LITERAL("content/test/data")))); |
205 ASSERT_TRUE(https_server.Start()); | 207 ASSERT_TRUE(https_server.Start()); |
206 | 208 |
207 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); | 209 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); |
208 GURL http_url(test_server()->GetURL("files/title1.html")); | 210 GURL http_url(test_server()->GetURL("files/title1.html")); |
209 GURL https_url(https_server.GetURL("files/title1.html")); | 211 GURL https_url(https_server.GetURL("files/title1.html")); |
210 | 212 |
211 NavigateToURL(shell(), main_url); | 213 NavigateToURL(shell(), main_url); |
212 | 214 |
213 SitePerProcessWebContentsObserver observer(shell()->web_contents()); | 215 SitePerProcessWebContentsObserver observer(shell()->web_contents()); |
214 { | 216 { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 } | 320 } |
319 | 321 |
320 // TODO(nasko): Disable this test until out-of-process iframes is ready and the | 322 // TODO(nasko): Disable this test until out-of-process iframes is ready and the |
321 // security checks are back in place. | 323 // security checks are back in place. |
322 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 324 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
323 DISABLED_CrossSiteIframeRedirectTwice) { | 325 DISABLED_CrossSiteIframeRedirectTwice) { |
324 ASSERT_TRUE(test_server()->Start()); | 326 ASSERT_TRUE(test_server()->Start()); |
325 net::TestServer https_server( | 327 net::TestServer https_server( |
326 net::TestServer::TYPE_HTTPS, | 328 net::TestServer::TYPE_HTTPS, |
327 net::TestServer::kLocalhost, | 329 net::TestServer::kLocalhost, |
328 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 330 net::TestServer::GetSourceRelativePath( |
| 331 base::FilePath(FILE_PATH_LITERAL("content/test/data")))); |
329 ASSERT_TRUE(https_server.Start()); | 332 ASSERT_TRUE(https_server.Start()); |
330 | 333 |
331 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); | 334 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); |
332 GURL http_url(test_server()->GetURL("files/title1.html")); | 335 GURL http_url(test_server()->GetURL("files/title1.html")); |
333 GURL https_url(https_server.GetURL("files/title1.html")); | 336 GURL https_url(https_server.GetURL("files/title1.html")); |
334 | 337 |
335 NavigateToURL(shell(), main_url); | 338 NavigateToURL(shell(), main_url); |
336 | 339 |
337 SitePerProcessWebContentsObserver observer(shell()->web_contents()); | 340 SitePerProcessWebContentsObserver observer(shell()->web_contents()); |
338 { | 341 { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 "server-redirect?" + client_redirect_http_url.spec())); | 396 "server-redirect?" + client_redirect_http_url.spec())); |
394 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test")); | 397 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test")); |
395 | 398 |
396 // DidFailProvisionalLoad when navigating to client_redirect_http_url. | 399 // DidFailProvisionalLoad when navigating to client_redirect_http_url. |
397 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); | 400 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); |
398 EXPECT_FALSE(observer.navigation_succeeded()); | 401 EXPECT_FALSE(observer.navigation_succeeded()); |
399 } | 402 } |
400 } | 403 } |
401 | 404 |
402 } | 405 } |
OLD | NEW |