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

Unified Diff: chrome/test/base/in_process_browser_test.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 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/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/in_process_browser_test.cc
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index db081c2a728f315d229c9beb2c67e4e23466bc4e..1ddd6aa66cd88a53e71a8ff51cca35e67a53d7af 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -93,38 +93,6 @@ namespace {
// Passed as value of kTestType.
const char kBrowserTestType[] = "browser";
-// A BrowserListObserver that makes sure that all browsers created are on the
-// |allowed_desktop_|.
-class SingleDesktopTestObserver : public chrome::BrowserListObserver,
- public base::NonThreadSafe {
- public:
- explicit SingleDesktopTestObserver(chrome::HostDesktopType allowed_desktop);
- ~SingleDesktopTestObserver() override;
-
- // chrome::BrowserListObserver:
- void OnBrowserAdded(Browser* browser) override;
-
- private:
- chrome::HostDesktopType allowed_desktop_;
-
- DISALLOW_COPY_AND_ASSIGN(SingleDesktopTestObserver);
-};
-
-SingleDesktopTestObserver::SingleDesktopTestObserver(
- chrome::HostDesktopType allowed_desktop)
- : allowed_desktop_(allowed_desktop) {
- BrowserList::AddObserver(this);
-}
-
-SingleDesktopTestObserver::~SingleDesktopTestObserver() {
- BrowserList::RemoveObserver(this);
-}
-
-void SingleDesktopTestObserver::OnBrowserAdded(Browser* browser) {
- CHECK(CalledOnValidThread());
- CHECK_EQ(browser->host_desktop_type(), allowed_desktop_);
-}
-
} // namespace
// Library used for testing accessibility.
@@ -550,16 +518,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
// Pump startup related events.
content::RunAllPendingInMessageLoop();
- chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop();
- // Self-adds/removes itself from the BrowserList observers.
- scoped_ptr<SingleDesktopTestObserver> single_desktop_test_observer;
- if (!multi_desktop_test_) {
- single_desktop_test_observer.reset(
- new SingleDesktopTestObserver(active_desktop));
- }
-
- const BrowserList* active_browser_list =
- BrowserList::GetInstance(active_desktop);
+ const BrowserList* active_browser_list = BrowserList::GetInstance();
if (!active_browser_list->empty()) {
browser_ = active_browser_list->get(0);
#if defined(USE_ASH)
@@ -628,12 +587,8 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
content::RunAllPendingInMessageLoop();
QuitBrowsers();
- // All BrowserLists should be empty at this point.
- for (chrome::HostDesktopType t = chrome::HOST_DESKTOP_TYPE_FIRST;
- t < chrome::HOST_DESKTOP_TYPE_COUNT;
- t = static_cast<chrome::HostDesktopType>(t + 1)) {
- CHECK(BrowserList::GetInstance(t)->empty()) << t;
- }
+ // BrowserList should be empty at this point.
+ CHECK(BrowserList::GetInstance()->empty());
}
void InProcessBrowserTest::QuitBrowsers() {
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698