Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: chrome/browser/lifetime/browser_close_manager_browsertest.cc

Issue 1644773003: Remove BrowserIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-desktop-1
Patch Set: . Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager.cc ('k') | chrome/browser/memory/tab_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/lifetime/browser_close_manager_browsertest.cc
diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
index 1d8766219439e8d1e424196ece0f20153a2892ad..fdc7d4ea5a04fa763d3882fcf525d6e177700bde 100644
--- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc
+++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
@@ -27,7 +27,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_iterator.h"
+#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
@@ -268,7 +268,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, TestSingleTabShutdown) {
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
@@ -292,7 +292,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test is flaky on Mac. http://crbug.com/517687
@@ -333,7 +333,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
chrome::CloseAllBrowsersAndQuit();
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that the tab closed after the aborted shutdown attempt is not re-opened
@@ -397,7 +397,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, TestMultipleWindows) {
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that tabs in the same window with a beforeunload event that hangs are
@@ -439,7 +439,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that tabs in different windows with a beforeunload event that hangs are
@@ -474,7 +474,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that a window created during shutdown is closed.
@@ -491,7 +491,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that a window created during shutdown with a beforeunload handler can
@@ -523,7 +523,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that tabs added during shutdown are closed.
@@ -546,7 +546,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test that tabs created during shutdown with beforeunload handlers can cancel
@@ -587,7 +587,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
@@ -619,7 +619,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test is flaky on Windows and Mac. See http://crbug.com/276366.
@@ -659,7 +659,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
@@ -690,7 +690,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest,
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
INSTANTIATE_TEST_CASE_P(BrowserCloseManagerBrowserTest,
@@ -745,7 +745,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestBrowserCloseManager::NO_USER_CHOICE);
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_EQ(1, DownloadService::NonMaliciousDownloadCountAllProfiles());
// Attempting to close again should not crash.
@@ -795,7 +795,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestBrowserCloseManager::NO_USER_CHOICE);
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
// Test shutdown with a download in progress.
@@ -820,7 +820,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestBrowserCloseManager::USER_CHOICE_USER_ALLOWS_CLOSE);
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
if (browser_defaults::kBrowserAliveWithNoWindows)
EXPECT_EQ(1, DownloadService::NonMaliciousDownloadCountAllProfiles());
else
@@ -857,7 +857,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestBrowserCloseManager::USER_CHOICE_USER_ALLOWS_CLOSE);
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_EQ(0, DownloadService::NonMaliciousDownloadCountAllProfiles());
}
@@ -907,7 +907,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestBrowserCloseManager::USER_CHOICE_USER_ALLOWS_CLOSE);
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
if (browser_defaults::kBrowserAliveWithNoWindows)
EXPECT_EQ(1, DownloadService::NonMaliciousDownloadCountAllProfiles());
else
@@ -940,7 +940,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
ASSERT_NO_FATAL_FAILURE(AcceptClose());
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
}
#endif // defined(OS_MACOSX)
@@ -985,7 +985,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
close_observer.Wait();
}
EXPECT_FALSE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_TRUE(IsBackgroundModeSuspended());
// Background mode should be resumed when a new browser window is opened.
@@ -1001,7 +1001,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
chrome::CloseAllBrowsersAndQuit();
close_observer.Wait();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_FALSE(IsBackgroundModeSuspended());
}
@@ -1016,7 +1016,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
browser()->window()->Close();
close_observer.Wait();
EXPECT_FALSE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_FALSE(IsBackgroundModeSuspended());
}
@@ -1031,12 +1031,12 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
browser()->window()->Close();
close_observer.Wait();
EXPECT_FALSE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_FALSE(IsBackgroundModeSuspended());
chrome::CloseAllBrowsers();
EXPECT_FALSE(browser_shutdown::IsTryingToQuit());
- EXPECT_TRUE(chrome::BrowserIterator().done());
+ EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_TRUE(IsBackgroundModeSuspended());
}
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager.cc ('k') | chrome/browser/memory/tab_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698