| 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 765 } |
| 766 | 766 |
| 767 // Test shutdown with a download in progress from one profile, where the only | 767 // Test shutdown with a download in progress from one profile, where the only |
| 768 // open windows are for another profile. | 768 // open windows are for another profile. |
| 769 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, | 769 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, |
| 770 TestWithDownloadsFromDifferentProfiles) { | 770 TestWithDownloadsFromDifferentProfiles) { |
| 771 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 771 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 772 base::FilePath path = | 772 base::FilePath path = |
| 773 profile_manager->user_data_dir().AppendASCII("test_profile"); | 773 profile_manager->user_data_dir().AppendASCII("test_profile"); |
| 774 if (!base::PathExists(path)) | 774 if (!base::PathExists(path)) |
| 775 ASSERT_TRUE(file_util::CreateDirectory(path)); | 775 ASSERT_TRUE(base::CreateDirectory(path)); |
| 776 Profile* other_profile = | 776 Profile* other_profile = |
| 777 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 777 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
| 778 profile_manager->RegisterTestingProfile(other_profile, true, false); | 778 profile_manager->RegisterTestingProfile(other_profile, true, false); |
| 779 Browser* other_profile_browser = CreateBrowser(other_profile); | 779 Browser* other_profile_browser = CreateBrowser(other_profile); |
| 780 | 780 |
| 781 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 781 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 782 ASSERT_NO_FATAL_FAILURE(CreateStalledDownload(browser())); | 782 ASSERT_NO_FATAL_FAILURE(CreateStalledDownload(browser())); |
| 783 { | 783 { |
| 784 RepeatedNotificationObserver close_observer( | 784 RepeatedNotificationObserver close_observer( |
| 785 chrome::NOTIFICATION_BROWSER_CLOSED, 1); | 785 chrome::NOTIFICATION_BROWSER_CLOSED, 1); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 | 934 |
| 935 chrome::CloseAllBrowsers(); | 935 chrome::CloseAllBrowsers(); |
| 936 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 936 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
| 937 EXPECT_TRUE(chrome::BrowserIterator().done()); | 937 EXPECT_TRUE(chrome::BrowserIterator().done()); |
| 938 EXPECT_TRUE(IsBackgroundModeSuspended()); | 938 EXPECT_TRUE(IsBackgroundModeSuspended()); |
| 939 } | 939 } |
| 940 | 940 |
| 941 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 941 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 942 BrowserCloseManagerWithBackgroundModeBrowserTest, | 942 BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 943 testing::Bool()); | 943 testing::Bool()); |
| OLD | NEW |