| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_process.h" | 5 #include "chrome/browser/browser_process.h" |
| 6 #include "chrome/browser/browser_shutdown.h" | 6 #include "chrome/browser/browser_shutdown.h" |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/browser/printing/background_printing_manager.h" | 8 #include "chrome/browser/printing/background_printing_manager.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Helper function to iterate and count all the tabs. | 24 // Helper function to iterate and count all the tabs. |
| 25 size_t CountAllTabs() { | 25 size_t CountAllTabs() { |
| 26 size_t count = 0; | 26 size_t count = 0; |
| 27 for (TabContentsIterator iterator; !iterator.done(); ++iterator) | 27 for (TabContentsIterator iterator; !iterator.done(); ++iterator) |
| 28 ++count; | 28 ++count; |
| 29 return count; | 29 return count; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Helper function to navigate to the print preview page. | 32 // Helper function to navigate to the print preview page. |
| 33 void NavigateToPrintUrl(TabContentsWrapper* tab, int page_id) { | 33 void NavigateToPrintUrl(TabContentsWrapper* tab, int page_id) { |
| 34 static_cast<TestRenderViewHost*>( | 34 static_cast<content::TestRenderViewHost*>( |
| 35 tab->web_contents()->GetRenderViewHost())->SendNavigate( | 35 tab->web_contents()->GetRenderViewHost())->SendNavigate( |
| 36 page_id, GURL(chrome::kChromeUIPrintURL)); | 36 page_id, GURL(chrome::kChromeUIPrintURL)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { | 41 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { |
| 42 // Make sure we have 1 window to start with. | 42 // Make sure we have 1 window to start with. |
| 43 EXPECT_EQ(1U, BrowserList::size()); | 43 EXPECT_EQ(1U, BrowserList::size()); |
| 44 | 44 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 testing_browser_process->SetProfileManager(profile_manager); | 262 testing_browser_process->SetProfileManager(profile_manager); |
| 263 | 263 |
| 264 BrowserList::AttemptRestart(); | 264 BrowserList::AttemptRestart(); |
| 265 // Cancel the effects of us calling BrowserList::AttemptRestart. Otherwise | 265 // Cancel the effects of us calling BrowserList::AttemptRestart. Otherwise |
| 266 // tests ran after this one will fail. | 266 // tests ran after this one will fail. |
| 267 browser_shutdown::SetTryingToQuit(false); | 267 browser_shutdown::SetTryingToQuit(false); |
| 268 | 268 |
| 269 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); | 269 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); |
| 270 testing_browser_process->SetLocalState(NULL); | 270 testing_browser_process->SetLocalState(NULL); |
| 271 } | 271 } |
| OLD | NEW |