| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_contents/tab_contents_iterator.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.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 26 matching lines...) Expand all Loading... |
| 37 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { | 37 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { |
| 38 // Make sure we have 1 window to start with. | 38 // Make sure we have 1 window to start with. |
| 39 EXPECT_EQ(1U, | 39 EXPECT_EQ(1U, |
| 40 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); | 40 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); |
| 41 | 41 |
| 42 EXPECT_EQ(0U, CountAllTabs()); | 42 EXPECT_EQ(0U, CountAllTabs()); |
| 43 | 43 |
| 44 // Create more browsers/windows. | 44 // Create more browsers/windows. |
| 45 Browser::CreateParams native_params(profile(), | 45 Browser::CreateParams native_params(profile(), |
| 46 chrome::HOST_DESKTOP_TYPE_NATIVE); | 46 chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 47 scoped_ptr<Browser> browser2( | 47 scoped_ptr<Browser> browser2 = |
| 48 chrome::CreateBrowserWithTestWindowForParams(&native_params)); | 48 chrome::CreateBrowserWithTestWindowForParams(&native_params); |
| 49 // Create browser 3 and 4 on the Ash desktop (the TabContentsIterator | 49 // Create browser 3 and 4 on the Ash desktop (the TabContentsIterator |
| 50 // shouldn't see the difference). | 50 // shouldn't see the difference). |
| 51 Browser::CreateParams ash_params(profile(), chrome::HOST_DESKTOP_TYPE_ASH); | 51 Browser::CreateParams ash_params(profile(), chrome::HOST_DESKTOP_TYPE_ASH); |
| 52 scoped_ptr<Browser> browser3( | 52 scoped_ptr<Browser> browser3 = |
| 53 chrome::CreateBrowserWithTestWindowForParams(&ash_params)); | 53 chrome::CreateBrowserWithTestWindowForParams(&ash_params); |
| 54 scoped_ptr<Browser> browser4( | 54 scoped_ptr<Browser> browser4 = |
| 55 chrome::CreateBrowserWithTestWindowForParams(&ash_params)); | 55 chrome::CreateBrowserWithTestWindowForParams(&ash_params); |
| 56 | 56 |
| 57 // Sanity checks. | 57 // Sanity checks. |
| 58 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 59 // The ash desktop is the native desktop on Chrome OS. | 59 // The ash desktop is the native desktop on Chrome OS. |
| 60 EXPECT_EQ(4U, | 60 EXPECT_EQ(4U, |
| 61 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); | 61 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); |
| 62 #else | 62 #else |
| 63 EXPECT_EQ(2U, | 63 EXPECT_EQ(2U, |
| 64 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); | 64 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); |
| 65 EXPECT_EQ(2U, | 65 EXPECT_EQ(2U, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 testing_browser_process->SetProfileManager(profile_manager); | 204 testing_browser_process->SetProfileManager(profile_manager); |
| 205 | 205 |
| 206 chrome::AttemptRestart(); | 206 chrome::AttemptRestart(); |
| 207 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests | 207 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests |
| 208 // ran after this one will fail. | 208 // ran after this one will fail. |
| 209 browser_shutdown::SetTryingToQuit(false); | 209 browser_shutdown::SetTryingToQuit(false); |
| 210 | 210 |
| 211 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); | 211 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); |
| 212 testing_browser_process->SetLocalState(NULL); | 212 testing_browser_process->SetLocalState(NULL); |
| 213 } | 213 } |
| OLD | NEW |