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