| 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 "chrome/browser/lifetime/browser_close_manager.h" | 5 #include "chrome/browser/lifetime/browser_close_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 ASSERT_NO_FATAL_FAILURE(AcceptClose()); | 734 ASSERT_NO_FATAL_FAILURE(AcceptClose()); |
| 735 ASSERT_NO_FATAL_FAILURE(AcceptClose()); | 735 ASSERT_NO_FATAL_FAILURE(AcceptClose()); |
| 736 ASSERT_NO_FATAL_FAILURE(AcceptClose()); | 736 ASSERT_NO_FATAL_FAILURE(AcceptClose()); |
| 737 ASSERT_NO_FATAL_FAILURE(AcceptClose()); | 737 ASSERT_NO_FATAL_FAILURE(AcceptClose()); |
| 738 | 738 |
| 739 close_observer.Wait(); | 739 close_observer.Wait(); |
| 740 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); | 740 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); |
| 741 EXPECT_TRUE(BrowserList::GetInstance()->empty()); | 741 EXPECT_TRUE(BrowserList::GetInstance()->empty()); |
| 742 } | 742 } |
| 743 | 743 |
| 744 // TODO(crbug/713201): |
| 745 // BrowserCloseManagerBrowserTest.AddBeforeUnloadDuringClosing flaky on Mac. |
| 746 #if defined(OS_MACOSX) |
| 747 #define MAYBE_AddBeforeUnloadDuringClosing DISABLED_AddBeforeUnloadDuringClosing |
| 748 #else |
| 749 #define MAYBE_AddBeforeUnloadDuringClosing AddBeforeUnloadDuringClosing |
| 750 #endif |
| 751 |
| 744 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, | 752 IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, |
| 745 AddBeforeUnloadDuringClosing) { | 753 MAYBE_AddBeforeUnloadDuringClosing) { |
| 746 // TODO(crbug.com/250305): Currently FastUnloadController is broken. | 754 // TODO(crbug.com/250305): Currently FastUnloadController is broken. |
| 747 // And it is difficult to fix this issue without fixing that one. | 755 // And it is difficult to fix this issue without fixing that one. |
| 748 if (GetParam()) | 756 if (GetParam()) |
| 749 return; | 757 return; |
| 750 | 758 |
| 751 ASSERT_TRUE(embedded_test_server()->Start()); | 759 ASSERT_TRUE(embedded_test_server()->Start()); |
| 752 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL( | 760 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL( |
| 753 browser(), embedded_test_server()->GetURL("/title1.html"))); | 761 browser(), embedded_test_server()->GetURL("/title1.html"))); |
| 754 | 762 |
| 755 // Open second window. | 763 // Open second window. |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 | 1286 |
| 1279 chrome::CloseAllBrowsers(); | 1287 chrome::CloseAllBrowsers(); |
| 1280 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 1288 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
| 1281 EXPECT_TRUE(BrowserList::GetInstance()->empty()); | 1289 EXPECT_TRUE(BrowserList::GetInstance()->empty()); |
| 1282 EXPECT_TRUE(IsBackgroundModeSuspended()); | 1290 EXPECT_TRUE(IsBackgroundModeSuspended()); |
| 1283 } | 1291 } |
| 1284 | 1292 |
| 1285 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 1293 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 1286 BrowserCloseManagerWithBackgroundModeBrowserTest, | 1294 BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 1287 testing::Bool()); | 1295 testing::Bool()); |
| OLD | NEW |