| 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 "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/browser_shutdown.h" | 8 #include "chrome/browser/browser_shutdown.h" |
| 9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/printing/background_printing_manager.h" | 11 #include "chrome/browser/printing/background_printing_manager.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "chrome/test/base/browser_with_test_window_test.h" | 16 #include "chrome/test/base/browser_with_test_window_test.h" |
| 17 #include "chrome/test/base/testing_browser_process.h" | 17 #include "chrome/test/base/testing_browser_process.h" |
| 18 #include "chrome/test/base/testing_pref_service.h" | 18 #include "chrome/test/base/testing_pref_service.h" |
| 19 #include "chrome/test/base/testing_profile_manager.h" | 19 #include "chrome/test/base/testing_profile_manager.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "content/test/test_renderer_host.h" | 21 #include "content/public/test/test_renderer_host.h" |
| 22 | 22 |
| 23 typedef BrowserWithTestWindowTest BrowserListTest; | 23 typedef BrowserWithTestWindowTest BrowserListTest; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Helper function to iterate and count all the tabs. | 27 // Helper function to iterate and count all the tabs. |
| 28 size_t CountAllTabs() { | 28 size_t CountAllTabs() { |
| 29 size_t count = 0; | 29 size_t count = 0; |
| 30 for (TabContentsIterator iterator; !iterator.done(); ++iterator) | 30 for (TabContentsIterator iterator; !iterator.done(); ++iterator) |
| 31 ++count; | 31 ++count; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 testing_browser_process->SetProfileManager(profile_manager); | 265 testing_browser_process->SetProfileManager(profile_manager); |
| 266 | 266 |
| 267 browser::AttemptRestart(); | 267 browser::AttemptRestart(); |
| 268 // Cancel the effects of us calling browser::AttemptRestart. Otherwise tests | 268 // Cancel the effects of us calling browser::AttemptRestart. Otherwise tests |
| 269 // ran after this one will fail. | 269 // ran after this one will fail. |
| 270 browser_shutdown::SetTryingToQuit(false); | 270 browser_shutdown::SetTryingToQuit(false); |
| 271 | 271 |
| 272 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); | 272 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); |
| 273 testing_browser_process->SetLocalState(NULL); | 273 testing_browser_process->SetLocalState(NULL); |
| 274 } | 274 } |
| OLD | NEW |