| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/background/background_mode_manager.h" | 8 #include "chrome/browser/background/background_mode_manager.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_shutdown.h" | 10 #include "chrome/browser/browser_shutdown.h" |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 RepeatedNotificationObserver close_observer( | 800 RepeatedNotificationObserver close_observer( |
| 801 chrome::NOTIFICATION_BROWSER_CLOSED, 2); | 801 chrome::NOTIFICATION_BROWSER_CLOSED, 2); |
| 802 TestBrowserCloseManager::AttemptClose( | 802 TestBrowserCloseManager::AttemptClose( |
| 803 TestBrowserCloseManager::USER_CHOICE_USER_ALLOWS_CLOSE); | 803 TestBrowserCloseManager::USER_CHOICE_USER_ALLOWS_CLOSE); |
| 804 close_observer.Wait(); | 804 close_observer.Wait(); |
| 805 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); | 805 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); |
| 806 EXPECT_TRUE(chrome::BrowserIterator().done()); | 806 EXPECT_TRUE(chrome::BrowserIterator().done()); |
| 807 } | 807 } |
| 808 | 808 |
| 809 // Test shutdown with downloads in progress and beforeunload handlers. | 809 // Test shutdown with downloads in progress and beforeunload handlers. |
| 810 // Disabled, see http://crbug.com/315754. |
| 810 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, | 811 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, |
| 811 TestBeforeUnloadAndDownloads) { | 812 DISABLED_TestBeforeUnloadAndDownloads) { |
| 812 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 813 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 813 ASSERT_NO_FATAL_FAILURE(CreateStalledDownload(browser())); | 814 ASSERT_NO_FATAL_FAILURE(CreateStalledDownload(browser())); |
| 814 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL( | 815 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL( |
| 815 browser(), embedded_test_server()->GetURL("/beforeunload.html"))); | 816 browser(), embedded_test_server()->GetURL("/beforeunload.html"))); |
| 816 | 817 |
| 817 content::WindowedNotificationObserver cancel_observer( | 818 content::WindowedNotificationObserver cancel_observer( |
| 818 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, | 819 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, |
| 819 content::NotificationService::AllSources()); | 820 content::NotificationService::AllSources()); |
| 820 TestBrowserCloseManager::AttemptClose( | 821 TestBrowserCloseManager::AttemptClose( |
| 821 TestBrowserCloseManager::USER_CHOICE_USER_CANCELS_CLOSE); | 822 TestBrowserCloseManager::USER_CHOICE_USER_CANCELS_CLOSE); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 | 925 |
| 925 chrome::CloseAllBrowsers(); | 926 chrome::CloseAllBrowsers(); |
| 926 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 927 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
| 927 EXPECT_TRUE(chrome::BrowserIterator().done()); | 928 EXPECT_TRUE(chrome::BrowserIterator().done()); |
| 928 EXPECT_TRUE(IsBackgroundModeSuspended()); | 929 EXPECT_TRUE(IsBackgroundModeSuspended()); |
| 929 } | 930 } |
| 930 | 931 |
| 931 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 932 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 932 BrowserCloseManagerWithBackgroundModeBrowserTest, | 933 BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 933 testing::Bool()); | 934 testing::Bool()); |
| OLD | NEW |