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/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/download/download_manager_impl.h" | 8 #include "content/browser/download/download_manager_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 #if !defined(OS_MACOSX) | 294 #if !defined(OS_MACOSX) |
295 // Tests that the onbeforeunload and onunload logic is short-circuited if the | 295 // Tests that the onbeforeunload and onunload logic is short-circuited if the |
296 // old renderer is gone. In that case, we don't want to wait for the old | 296 // old renderer is gone. In that case, we don't want to wait for the old |
297 // renderer to run the handlers. | 297 // renderer to run the handlers. |
298 // We need to disable this on Mac because the crash causes the OS CrashReporter | 298 // We need to disable this on Mac because the crash causes the OS CrashReporter |
299 // process to kick in to analyze the poor dead renderer. Unfortunately, if the | 299 // process to kick in to analyze the poor dead renderer. Unfortunately, if the |
300 // app isn't stripped of debug symbols, this takes about five minutes to | 300 // app isn't stripped of debug symbols, this takes about five minutes to |
301 // complete and isn't conducive to quick turnarounds. As we don't currently | 301 // complete and isn't conducive to quick turnarounds. As we don't currently |
302 // strip the app on the build bots, this is bad times. | 302 // strip the app on the build bots, this is bad times. |
303 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteAfterCrash) { | 303 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteAfterCrash) { |
| 304 // Make sure we have a live process before trying to kill it. |
| 305 NavigateToURL(shell(), GURL("about:blank")); |
| 306 |
304 // Cause the renderer to crash. | 307 // Cause the renderer to crash. |
305 RenderProcessHostWatcher crash_observer( | 308 RenderProcessHostWatcher crash_observer( |
306 shell()->web_contents(), | 309 shell()->web_contents(), |
307 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 310 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
308 NavigateToURL(shell(), GURL(kChromeUICrashURL)); | 311 NavigateToURL(shell(), GURL(kChromeUICrashURL)); |
309 // Wait for browser to notice the renderer crash. | 312 // Wait for browser to notice the renderer crash. |
310 crash_observer.Wait(); | 313 crash_observer.Wait(); |
311 | 314 |
312 // Navigate to a new cross-site page. The browser should not wait around for | 315 // Navigate to a new cross-site page. The browser should not wait around for |
313 // the old renderer's on{before}unload handlers to run. | 316 // the old renderer's on{before}unload handlers to run. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); | 461 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); |
459 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 462 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
460 | 463 |
461 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 464 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); |
462 ShellNetworkDelegate::SetAcceptAllCookies(false); | 465 ShellNetworkDelegate::SetAcceptAllCookies(false); |
463 | 466 |
464 CheckTitleTest(url, "cookie set"); | 467 CheckTitleTest(url, "cookie set"); |
465 } | 468 } |
466 | 469 |
467 } // namespace content | 470 } // namespace content |
OLD | NEW |