| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 bool got_downloads() const { return got_downloads_; } | 93 bool got_downloads() const { return got_downloads_; } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 bool got_downloads_; | 96 bool got_downloads_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 // Test title for content created by javascript window.open(). | 99 // Test title for content created by javascript window.open(). |
| 100 // See http://crbug.com/5988 | 100 // See http://crbug.com/5988 |
| 101 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) { | 101 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) { |
| 102 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 102 ASSERT_TRUE(embedded_test_server()->Start()); |
| 103 | 103 |
| 104 GURL url(embedded_test_server()->GetURL("/dynamic1.html")); | 104 GURL url(embedded_test_server()->GetURL("/dynamic1.html")); |
| 105 base::string16 title; | 105 base::string16 title; |
| 106 ASSERT_TRUE(GetPopupTitle(url, &title)); | 106 ASSERT_TRUE(GetPopupTitle(url, &title)); |
| 107 EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Popup Title"), | 107 EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Popup Title"), |
| 108 base::CompareCase::SENSITIVE)) | 108 base::CompareCase::SENSITIVE)) |
| 109 << "Actual title: " << title; | 109 << "Actual title: " << title; |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Test title for content created by javascript window.open(). | 112 // Test title for content created by javascript window.open(). |
| 113 // See http://crbug.com/5988 | 113 // See http://crbug.com/5988 |
| 114 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) { | 114 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) { |
| 115 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 115 ASSERT_TRUE(embedded_test_server()->Start()); |
| 116 | 116 |
| 117 GURL url(embedded_test_server()->GetURL("/dynamic2.html")); | 117 GURL url(embedded_test_server()->GetURL("/dynamic2.html")); |
| 118 base::string16 title; | 118 base::string16 title; |
| 119 ASSERT_TRUE(GetPopupTitle(url, &title)); | 119 ASSERT_TRUE(GetPopupTitle(url, &title)); |
| 120 EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Dynamic Title"), | 120 EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Dynamic Title"), |
| 121 base::CompareCase::SENSITIVE)) | 121 base::CompareCase::SENSITIVE)) |
| 122 << "Actual title: " << title; | 122 << "Actual title: " << title; |
| 123 } | 123 } |
| 124 | 124 |
| 125 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 125 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 171 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 172 ContentDispositionInline) { | 172 ContentDispositionInline) { |
| 173 CheckTitleTest( | 173 CheckTitleTest( |
| 174 net::URLRequestMockHTTPJob::GetMockUrl("content-disposition-inline.html"), | 174 net::URLRequestMockHTTPJob::GetMockUrl("content-disposition-inline.html"), |
| 175 "success"); | 175 "success"); |
| 176 } | 176 } |
| 177 | 177 |
| 178 // Test for bug #1091358. | 178 // Test for bug #1091358. |
| 179 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest) { | 179 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest) { |
| 180 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 180 ASSERT_TRUE(embedded_test_server()->Start()); |
| 181 NavigateToURL( | 181 NavigateToURL( |
| 182 shell(), embedded_test_server()->GetURL("/sync_xmlhttprequest.html")); | 182 shell(), embedded_test_server()->GetURL("/sync_xmlhttprequest.html")); |
| 183 | 183 |
| 184 // Let's check the XMLHttpRequest ran successfully. | 184 // Let's check the XMLHttpRequest ran successfully. |
| 185 bool success = false; | 185 bool success = false; |
| 186 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 186 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
| 187 shell()->web_contents(), | 187 shell()->web_contents(), |
| 188 "window.domAutomationController.send(DidSyncRequestSucceed());", | 188 "window.domAutomationController.send(DidSyncRequestSucceed());", |
| 189 &success)); | 189 &success)); |
| 190 EXPECT_TRUE(success); | 190 EXPECT_TRUE(success); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // If this flakes, use http://crbug.com/62776. | 193 // If this flakes, use http://crbug.com/62776. |
| 194 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 194 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 195 SyncXMLHttpRequest_Disallowed) { | 195 SyncXMLHttpRequest_Disallowed) { |
| 196 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 196 ASSERT_TRUE(embedded_test_server()->Start()); |
| 197 NavigateToURL( | 197 NavigateToURL( |
| 198 shell(), | 198 shell(), |
| 199 embedded_test_server()->GetURL("/sync_xmlhttprequest_disallowed.html")); | 199 embedded_test_server()->GetURL("/sync_xmlhttprequest_disallowed.html")); |
| 200 | 200 |
| 201 // Let's check the XMLHttpRequest ran successfully. | 201 // Let's check the XMLHttpRequest ran successfully. |
| 202 bool success = false; | 202 bool success = false; |
| 203 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 203 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
| 204 shell()->web_contents(), | 204 shell()->web_contents(), |
| 205 "window.domAutomationController.send(DidSucceed());", | 205 "window.domAutomationController.send(DidSucceed());", |
| 206 &success)); | 206 &success)); |
| 207 EXPECT_TRUE(success); | 207 EXPECT_TRUE(success); |
| 208 } | 208 } |
| 209 | 209 |
| 210 // Test for bug #1159553 -- A synchronous xhr (whose content-type is | 210 // Test for bug #1159553 -- A synchronous xhr (whose content-type is |
| 211 // downloadable) would trigger download and hang the renderer process, | 211 // downloadable) would trigger download and hang the renderer process, |
| 212 // if executed while navigating to a new page. | 212 // if executed while navigating to a new page. |
| 213 // Disabled on Mac: see http://crbug.com/56264 | 213 // Disabled on Mac: see http://crbug.com/56264 |
| 214 #if defined(OS_MACOSX) | 214 #if defined(OS_MACOSX) |
| 215 #define MAYBE_SyncXMLHttpRequest_DuringUnload \ | 215 #define MAYBE_SyncXMLHttpRequest_DuringUnload \ |
| 216 DISABLED_SyncXMLHttpRequest_DuringUnload | 216 DISABLED_SyncXMLHttpRequest_DuringUnload |
| 217 #else | 217 #else |
| 218 #define MAYBE_SyncXMLHttpRequest_DuringUnload SyncXMLHttpRequest_DuringUnload | 218 #define MAYBE_SyncXMLHttpRequest_DuringUnload SyncXMLHttpRequest_DuringUnload |
| 219 #endif | 219 #endif |
| 220 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 220 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 221 MAYBE_SyncXMLHttpRequest_DuringUnload) { | 221 MAYBE_SyncXMLHttpRequest_DuringUnload) { |
| 222 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 222 ASSERT_TRUE(embedded_test_server()->Start()); |
| 223 BrowserContext::GetDownloadManager( | 223 BrowserContext::GetDownloadManager( |
| 224 shell()->web_contents()->GetBrowserContext())->AddObserver(this); | 224 shell()->web_contents()->GetBrowserContext())->AddObserver(this); |
| 225 | 225 |
| 226 CheckTitleTest( | 226 CheckTitleTest( |
| 227 embedded_test_server()->GetURL("/sync_xmlhttprequest_during_unload.html"), | 227 embedded_test_server()->GetURL("/sync_xmlhttprequest_during_unload.html"), |
| 228 "sync xhr on unload"); | 228 "sync xhr on unload"); |
| 229 | 229 |
| 230 // Navigate to a new page, to dispatch unload event and trigger xhr. | 230 // Navigate to a new page, to dispatch unload event and trigger xhr. |
| 231 // (the bug would make this step hang the renderer). | 231 // (the bug would make this step hang the renderer). |
| 232 CheckTitleTest( | 232 CheckTitleTest( |
| 233 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); | 233 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); |
| 234 | 234 |
| 235 ASSERT_FALSE(got_downloads()); | 235 ASSERT_FALSE(got_downloads()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 // Flaky everywhere. http://crbug.com/130404 | 238 // Flaky everywhere. http://crbug.com/130404 |
| 239 // Tests that onunload is run for cross-site requests. (Bug 1114994) | 239 // Tests that onunload is run for cross-site requests. (Bug 1114994) |
| 240 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 240 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 241 DISABLED_CrossSiteOnunloadCookie) { | 241 DISABLED_CrossSiteOnunloadCookie) { |
| 242 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 242 ASSERT_TRUE(embedded_test_server()->Start()); |
| 243 | 243 |
| 244 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 244 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
| 245 CheckTitleTest(url, "set cookie on unload"); | 245 CheckTitleTest(url, "set cookie on unload"); |
| 246 | 246 |
| 247 // Navigate to a new cross-site page, to dispatch unload event and set the | 247 // Navigate to a new cross-site page, to dispatch unload event and set the |
| 248 // cookie. | 248 // cookie. |
| 249 CheckTitleTest( | 249 CheckTitleTest( |
| 250 net::URLRequestMockHTTPJob::GetMockUrl("content-sniffer-test0.html"), | 250 net::URLRequestMockHTTPJob::GetMockUrl("content-sniffer-test0.html"), |
| 251 "Content Sniffer Test 0"); | 251 "Content Sniffer Test 0"); |
| 252 | 252 |
| 253 // Check that the cookie was set. | 253 // Check that the cookie was set. |
| 254 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); | 254 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 // If this flakes, use http://crbug.com/130404 | 257 // If this flakes, use http://crbug.com/130404 |
| 258 // Tests that onunload is run for cross-site requests to URLs that complete | 258 // Tests that onunload is run for cross-site requests to URLs that complete |
| 259 // without network loads (e.g., about:blank, data URLs). | 259 // without network loads (e.g., about:blank, data URLs). |
| 260 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 260 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 261 DISABLED_CrossSiteImmediateLoadOnunloadCookie) { | 261 DISABLED_CrossSiteImmediateLoadOnunloadCookie) { |
| 262 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 262 ASSERT_TRUE(embedded_test_server()->Start()); |
| 263 | 263 |
| 264 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 264 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
| 265 CheckTitleTest(url, "set cookie on unload"); | 265 CheckTitleTest(url, "set cookie on unload"); |
| 266 | 266 |
| 267 // Navigate to a cross-site page that loads immediately without making a | 267 // Navigate to a cross-site page that loads immediately without making a |
| 268 // network request. The unload event should still be run. | 268 // network request. The unload event should still be run. |
| 269 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 269 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
| 270 | 270 |
| 271 // Check that the cookie was set. | 271 // Check that the cookie was set. |
| 272 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); | 272 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 287 http_response->set_code(net::HTTP_NO_CONTENT); | 287 http_response->set_code(net::HTTP_NO_CONTENT); |
| 288 return http_response.Pass(); | 288 return http_response.Pass(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace | 291 } // namespace |
| 292 | 292 |
| 293 // Tests that the unload handler is not run for 204 responses. | 293 // Tests that the unload handler is not run for 204 responses. |
| 294 // If this flakes use http://crbug.com/80596. | 294 // If this flakes use http://crbug.com/80596. |
| 295 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 295 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 296 CrossSiteNoUnloadOn204) { | 296 CrossSiteNoUnloadOn204) { |
| 297 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 297 ASSERT_TRUE(embedded_test_server()->Start()); |
| 298 | 298 |
| 299 // Start with a URL that sets a cookie in its unload handler. | 299 // Start with a URL that sets a cookie in its unload handler. |
| 300 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 300 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
| 301 CheckTitleTest(url, "set cookie on unload"); | 301 CheckTitleTest(url, "set cookie on unload"); |
| 302 | 302 |
| 303 // Navigate to a cross-site URL that returns a 204 No Content response. | 303 // Navigate to a cross-site URL that returns a 204 No Content response. |
| 304 const char kNoContentPath[] = "/nocontent"; | 304 const char kNoContentPath[] = "/nocontent"; |
| 305 embedded_test_server()->RegisterRequestHandler( | 305 embedded_test_server()->RegisterRequestHandler( |
| 306 base::Bind(&NoContentResponseHandler, kNoContentPath)); | 306 base::Bind(&NoContentResponseHandler, kNoContentPath)); |
| 307 NavigateToURL(shell(), embedded_test_server()->GetURL(kNoContentPath)); | 307 NavigateToURL(shell(), embedded_test_server()->GetURL(kNoContentPath)); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 GURL url = GetTestUrl("", "title2.html"); | 357 GURL url = GetTestUrl("", "title2.html"); |
| 358 CheckTitleTest(url, "Title Of Awesomeness"); | 358 CheckTitleTest(url, "Title Of Awesomeness"); |
| 359 } | 359 } |
| 360 | 360 |
| 361 // Flaky everywhere. http://crbug.com/130404 | 361 // Flaky everywhere. http://crbug.com/130404 |
| 362 // Tests that a cross-site navigation to an error page (resulting in the link | 362 // Tests that a cross-site navigation to an error page (resulting in the link |
| 363 // doctor page) still runs the onunload handler and can support navigations | 363 // doctor page) still runs the onunload handler and can support navigations |
| 364 // away from the link doctor page. (Bug 1235537) | 364 // away from the link doctor page. (Bug 1235537) |
| 365 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 365 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 366 DISABLED_CrossSiteNavigationErrorPage) { | 366 DISABLED_CrossSiteNavigationErrorPage) { |
| 367 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 367 ASSERT_TRUE(embedded_test_server()->Start()); |
| 368 | 368 |
| 369 GURL url(embedded_test_server()->GetURL("/onunload_cookie.html")); | 369 GURL url(embedded_test_server()->GetURL("/onunload_cookie.html")); |
| 370 CheckTitleTest(url, "set cookie on unload"); | 370 CheckTitleTest(url, "set cookie on unload"); |
| 371 | 371 |
| 372 // Navigate to a new cross-site URL that results in an error. | 372 // Navigate to a new cross-site URL that results in an error. |
| 373 // TODO(creis): If this causes crashes or hangs, it might be for the same | 373 // TODO(creis): If this causes crashes or hangs, it might be for the same |
| 374 // reason as ErrorPageTest::DNSError. See bug 1199491 and | 374 // reason as ErrorPageTest::DNSError. See bug 1199491 and |
| 375 // http://crbug.com/22877. | 375 // http://crbug.com/22877. |
| 376 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( | 376 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( |
| 377 net::ERR_NAME_NOT_RESOLVED); | 377 net::ERR_NAME_NOT_RESOLVED); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 402 "window.domAutomationController.send(true);"; | 402 "window.domAutomationController.send(true);"; |
| 403 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 403 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
| 404 shell()->web_contents(), | 404 shell()->web_contents(), |
| 405 redirect_script, | 405 redirect_script, |
| 406 &success)); | 406 &success)); |
| 407 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 407 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
| 408 } | 408 } |
| 409 | 409 |
| 410 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 410 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 411 CrossSiteNavigationErrorPage2) { | 411 CrossSiteNavigationErrorPage2) { |
| 412 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 412 ASSERT_TRUE(embedded_test_server()->Start()); |
| 413 | 413 |
| 414 GURL url(embedded_test_server()->GetURL("/title2.html")); | 414 GURL url(embedded_test_server()->GetURL("/title2.html")); |
| 415 CheckTitleTest(url, "Title Of Awesomeness"); | 415 CheckTitleTest(url, "Title Of Awesomeness"); |
| 416 | 416 |
| 417 // Navigate to a new cross-site URL that results in an error. | 417 // Navigate to a new cross-site URL that results in an error. |
| 418 // TODO(creis): If this causes crashes or hangs, it might be for the same | 418 // TODO(creis): If this causes crashes or hangs, it might be for the same |
| 419 // reason as ErrorPageTest::DNSError. See bug 1199491 and | 419 // reason as ErrorPageTest::DNSError. See bug 1199491 and |
| 420 // http://crbug.com/22877. | 420 // http://crbug.com/22877. |
| 421 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( | 421 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( |
| 422 net::ERR_NAME_NOT_RESOLVED); | 422 net::ERR_NAME_NOT_RESOLVED); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 http_response->AddCustomHeader( | 473 http_response->AddCustomHeader( |
| 474 "Location", request.relative_url.substr(request_path.length())); | 474 "Location", request.relative_url.substr(request_path.length())); |
| 475 return http_response.Pass(); | 475 return http_response.Pass(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace | 478 } // namespace |
| 479 | 479 |
| 480 // Test that we update the cookie policy URLs correctly when transferring | 480 // Test that we update the cookie policy URLs correctly when transferring |
| 481 // navigations. | 481 // navigations. |
| 482 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { | 482 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { |
| 483 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 483 ASSERT_TRUE(embedded_test_server()->Start()); |
| 484 embedded_test_server()->RegisterRequestHandler( | 484 embedded_test_server()->RegisterRequestHandler( |
| 485 base::Bind(&HandleRedirectRequest, "/redirect?")); | 485 base::Bind(&HandleRedirectRequest, "/redirect?")); |
| 486 | 486 |
| 487 std::string set_cookie_url(base::StringPrintf( | 487 std::string set_cookie_url(base::StringPrintf( |
| 488 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); | 488 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); |
| 489 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 489 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
| 490 | 490 |
| 491 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 491 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); |
| 492 ShellNetworkDelegate::SetAcceptAllCookies(false); | 492 ShellNetworkDelegate::SetAcceptAllCookies(false); |
| 493 | 493 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 517 | 517 |
| 518 private: | 518 private: |
| 519 GURL watch_url_; | 519 GURL watch_url_; |
| 520 ui::PageTransition page_transition_; | 520 ui::PageTransition page_transition_; |
| 521 }; | 521 }; |
| 522 | 522 |
| 523 // Test that ui::PAGE_TRANSITION_CLIENT_REDIRECT is correctly set | 523 // Test that ui::PAGE_TRANSITION_CLIENT_REDIRECT is correctly set |
| 524 // when encountering a meta refresh tag. | 524 // when encountering a meta refresh tag. |
| 525 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 525 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 526 PageTransitionClientRedirect) { | 526 PageTransitionClientRedirect) { |
| 527 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 527 ASSERT_TRUE(embedded_test_server()->Start()); |
| 528 | 528 |
| 529 PageTransitionResourceDispatcherHostDelegate delegate( | 529 PageTransitionResourceDispatcherHostDelegate delegate( |
| 530 embedded_test_server()->GetURL("/title1.html")); | 530 embedded_test_server()->GetURL("/title1.html")); |
| 531 ResourceDispatcherHost::Get()->SetDelegate(&delegate); | 531 ResourceDispatcherHost::Get()->SetDelegate(&delegate); |
| 532 | 532 |
| 533 NavigateToURLBlockUntilNavigationsComplete( | 533 NavigateToURLBlockUntilNavigationsComplete( |
| 534 shell(), | 534 shell(), |
| 535 embedded_test_server()->GetURL("/client_redirect.html"), | 535 embedded_test_server()->GetURL("/client_redirect.html"), |
| 536 2); | 536 2); |
| 537 | 537 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 // Reload with Lo-Fi disabled. | 745 // Reload with Lo-Fi disabled. |
| 746 Reset(false); | 746 Reset(false); |
| 747 TestNavigationObserver tab_observer(shell()->web_contents(), 1); | 747 TestNavigationObserver tab_observer(shell()->web_contents(), 1); |
| 748 shell()->web_contents()->GetController().ReloadDisableLoFi(true); | 748 shell()->web_contents()->GetController().ReloadDisableLoFi(true); |
| 749 tab_observer.Wait(); | 749 tab_observer.Wait(); |
| 750 CheckResourcesRequested(false); | 750 CheckResourcesRequested(false); |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace content | 753 } // namespace content |
| OLD | NEW |