| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/ui/browser_iterator.h" | 5 #include "chrome/browser/ui/browser_iterator.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
| 9 #include "chrome/browser/ui/host_desktop.h" | |
| 10 #include "chrome/test/base/browser_with_test_window_test.h" | 9 #include "chrome/test/base/browser_with_test_window_test.h" |
| 10 #include "ui/gfx/host_desktop_type.h" |
| 11 | 11 |
| 12 typedef BrowserWithTestWindowTest BrowserIteratorTest; | 12 typedef BrowserWithTestWindowTest BrowserIteratorTest; |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // BrowserWithTestWindowTest's default window is on the native desktop by | 16 // BrowserWithTestWindowTest's default window is on the native desktop by |
| 17 // default. Force it to be on the Ash desktop to be able to test the iterator | 17 // default. Force it to be on the Ash desktop to be able to test the iterator |
| 18 // in a situation with no browsers on the native desktop. | 18 // in a situation with no browsers on the native desktop. |
| 19 class BrowserIteratorTestWithInitialWindowInAsh | 19 class BrowserIteratorTestWithInitialWindowInAsh |
| 20 : public BrowserWithTestWindowTest { | 20 : public BrowserWithTestWindowTest { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Make sure the iterator finds all 3 browsers on the ash desktop and | 110 // Make sure the iterator finds all 3 browsers on the ash desktop and |
| 111 // doesn't trip over the empty native desktop list. | 111 // doesn't trip over the empty native desktop list. |
| 112 EXPECT_EQ(3U, CountAllBrowsers()); | 112 EXPECT_EQ(3U, CountAllBrowsers()); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Verify that the iterator still behaves if there are no browsers at all. | 115 // Verify that the iterator still behaves if there are no browsers at all. |
| 116 TEST(BrowserIteratorTestWithNoTestWindow, NoBrowser) { | 116 TEST(BrowserIteratorTestWithNoTestWindow, NoBrowser) { |
| 117 EXPECT_EQ(0U, CountAllBrowsers()); | 117 EXPECT_EQ(0U, CountAllBrowsers()); |
| 118 } | 118 } |
| OLD | NEW |