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/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/browser/download/download_manager_impl.h" | 9 #include "content/browser/download/download_manager_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 "sync xhr on unload"); | 216 "sync xhr on unload"); |
217 | 217 |
218 // Navigate to a new page, to dispatch unload event and trigger xhr. | 218 // Navigate to a new page, to dispatch unload event and trigger xhr. |
219 // (the bug would make this step hang the renderer). | 219 // (the bug would make this step hang the renderer). |
220 CheckTitleTest( | 220 CheckTitleTest( |
221 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); | 221 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); |
222 | 222 |
223 ASSERT_FALSE(got_downloads()); | 223 ASSERT_FALSE(got_downloads()); |
224 } | 224 } |
225 | 225 |
226 // Flaky on mac bots. crbug.com/429190 | 226 // Flaky everywhere. http://crbug.com/130404 |
227 #if defined(OS_MACOSX) | |
228 #define MAYBE_CrossSiteOnunloadCookie DISABLED_CrossSiteOnunloadCookie | |
229 #else | |
230 #define MAYBE_CrossSiteOnunloadCookie CrossSiteOnunloadCookie | |
231 #endif | |
232 // Tests that onunload is run for cross-site requests. (Bug 1114994) | 227 // Tests that onunload is run for cross-site requests. (Bug 1114994) |
233 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 228 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
234 MAYBE_CrossSiteOnunloadCookie) { | 229 DISABLED_CrossSiteOnunloadCookie) { |
235 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 230 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
236 | 231 |
237 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 232 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
238 CheckTitleTest(url, "set cookie on unload"); | 233 CheckTitleTest(url, "set cookie on unload"); |
239 | 234 |
240 // Navigate to a new cross-site page, to dispatch unload event and set the | 235 // Navigate to a new cross-site page, to dispatch unload event and set the |
241 // cookie. | 236 // cookie. |
242 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), | 237 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), |
243 "Content Sniffer Test 0"); | 238 "Content Sniffer Test 0"); |
244 | 239 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // Start with an HTTP page. | 331 // Start with an HTTP page. |
337 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), | 332 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), |
338 "Content Sniffer Test 0"); | 333 "Content Sniffer Test 0"); |
339 | 334 |
340 // Now load a file:// page, which does not use the BufferedEventHandler. | 335 // Now load a file:// page, which does not use the BufferedEventHandler. |
341 // Make sure that the page loads and displays a title, and doesn't get stuck. | 336 // Make sure that the page loads and displays a title, and doesn't get stuck. |
342 GURL url = GetTestUrl("", "title2.html"); | 337 GURL url = GetTestUrl("", "title2.html"); |
343 CheckTitleTest(url, "Title Of Awesomeness"); | 338 CheckTitleTest(url, "Title Of Awesomeness"); |
344 } | 339 } |
345 | 340 |
346 // Flaky on mac bots. crbug.com/429190 | 341 // Flaky everywhere. http://crbug.com/130404 |
347 #if defined(OS_MACOSX) | |
348 #define MAYBE_CrossSiteNavigationErrorPage DISABLED_CrossSiteNavigationErrorPage | |
349 #else | |
350 #define MAYBE_CrossSiteNavigationErrorPage CrossSiteNavigationErrorPage | |
351 #endif | |
352 // Tests that a cross-site navigation to an error page (resulting in the link | 342 // Tests that a cross-site navigation to an error page (resulting in the link |
353 // doctor page) still runs the onunload handler and can support navigations | 343 // doctor page) still runs the onunload handler and can support navigations |
354 // away from the link doctor page. (Bug 1235537) | 344 // away from the link doctor page. (Bug 1235537) |
355 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 345 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
356 MAYBE_CrossSiteNavigationErrorPage) { | 346 DISABLED_CrossSiteNavigationErrorPage) { |
357 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 347 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
358 | 348 |
359 GURL url(embedded_test_server()->GetURL("/onunload_cookie.html")); | 349 GURL url(embedded_test_server()->GetURL("/onunload_cookie.html")); |
360 CheckTitleTest(url, "set cookie on unload"); | 350 CheckTitleTest(url, "set cookie on unload"); |
361 | 351 |
362 // Navigate to a new cross-site URL that results in an error. | 352 // Navigate to a new cross-site URL that results in an error. |
363 // TODO(creis): If this causes crashes or hangs, it might be for the same | 353 // TODO(creis): If this causes crashes or hangs, it might be for the same |
364 // reason as ErrorPageTest::DNSError. See bug 1199491 and | 354 // reason as ErrorPageTest::DNSError. See bug 1199491 and |
365 // http://crbug.com/22877. | 355 // http://crbug.com/22877. |
366 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( | 356 GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); | 466 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); |
477 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 467 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
478 | 468 |
479 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 469 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); |
480 ShellNetworkDelegate::SetAcceptAllCookies(false); | 470 ShellNetworkDelegate::SetAcceptAllCookies(false); |
481 | 471 |
482 CheckTitleTest(url, "cookie set"); | 472 CheckTitleTest(url, "cookie set"); |
483 } | 473 } |
484 | 474 |
485 } // namespace content | 475 } // namespace content |
OLD | NEW |