| 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // Tests that the onbeforeunload and onunload logic is short-circuited if the | 328 // Tests that the onbeforeunload and onunload logic is short-circuited if the |
| 329 // old renderer is gone. In that case, we don't want to wait for the old | 329 // old renderer is gone. In that case, we don't want to wait for the old |
| 330 // renderer to run the handlers. | 330 // renderer to run the handlers. |
| 331 // We need to disable this on Mac because the crash causes the OS CrashReporter | 331 // We need to disable this on Mac because the crash causes the OS CrashReporter |
| 332 // process to kick in to analyze the poor dead renderer. Unfortunately, if the | 332 // process to kick in to analyze the poor dead renderer. Unfortunately, if the |
| 333 // app isn't stripped of debug symbols, this takes about five minutes to | 333 // app isn't stripped of debug symbols, this takes about five minutes to |
| 334 // complete and isn't conducive to quick turnarounds. As we don't currently | 334 // complete and isn't conducive to quick turnarounds. As we don't currently |
| 335 // strip the app on the build bots, this is bad times. | 335 // strip the app on the build bots, this is bad times. |
| 336 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteAfterCrash) { | 336 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteAfterCrash) { |
| 337 // Cause the renderer to crash. | 337 // Cause the renderer to crash. |
| 338 ui_test_utils::WindowedNotificationObserver crash_observer( | 338 content::WindowedNotificationObserver crash_observer( |
| 339 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 339 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
| 340 content::NotificationService::AllSources()); | 340 content::NotificationService::AllSources()); |
| 341 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); | 341 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); |
| 342 // Wait for browser to notice the renderer crash. | 342 // Wait for browser to notice the renderer crash. |
| 343 crash_observer.Wait(); | 343 crash_observer.Wait(); |
| 344 | 344 |
| 345 // Navigate to a new cross-site page. The browser should not wait around for | 345 // Navigate to a new cross-site page. The browser should not wait around for |
| 346 // the old renderer's on{before}unload handlers to run. | 346 // the old renderer's on{before}unload handlers to run. |
| 347 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), | 347 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), |
| 348 "Content Sniffer Test 0", 1); | 348 "Content Sniffer Test 0", 1); |
| 349 } | 349 } |
| 350 #endif // !defined(OS_MACOSX) | 350 #endif // !defined(OS_MACOSX) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 459 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 460 CrossSiteFailedRequest) { | 460 CrossSiteFailedRequest) { |
| 461 // Visit another URL first to trigger a cross-site navigation. | 461 // Visit another URL first to trigger a cross-site navigation. |
| 462 GURL url(content::kTestNewTabURL); | 462 GURL url(content::kTestNewTabURL); |
| 463 ui_test_utils::NavigateToURL(browser(), url); | 463 ui_test_utils::NavigateToURL(browser(), url); |
| 464 | 464 |
| 465 // Visit a URL that fails without calling ResourceDispatcherHost::Read. | 465 // Visit a URL that fails without calling ResourceDispatcherHost::Read. |
| 466 GURL broken_url("chrome://theme"); | 466 GURL broken_url("chrome://theme"); |
| 467 CheckTitleTest(broken_url, "chrome://theme/ is not available", 1); | 467 CheckTitleTest(broken_url, "chrome://theme/ is not available", 1); |
| 468 } | 468 } |
| OLD | NEW |