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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/prefs/pref_registry_simple.h" | |
10 #include "base/prefs/testing_pref_service.h" | |
11 #include "build/build_config.h" | 9 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browser_shutdown.h" | 11 #include "chrome/browser/browser_shutdown.h" |
14 #include "chrome/browser/lifetime/application_lifetime.h" | 12 #include "chrome/browser/lifetime/application_lifetime.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_commands.h" | 15 #include "chrome/browser/ui/browser_commands.h" |
18 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
19 #include "chrome/browser/ui/host_desktop.h" | 17 #include "chrome/browser/ui/host_desktop.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
21 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
22 #include "chrome/test/base/browser_with_test_window_test.h" | 20 #include "chrome/test/base/browser_with_test_window_test.h" |
23 #include "chrome/test/base/test_browser_window.h" | 21 #include "chrome/test/base/test_browser_window.h" |
24 #include "chrome/test/base/testing_browser_process.h" | 22 #include "chrome/test/base/testing_browser_process.h" |
| 23 #include "components/prefs/pref_registry_simple.h" |
| 24 #include "components/prefs/testing_pref_service.h" |
25 | 25 |
26 typedef BrowserWithTestWindowTest BrowserListTest; | 26 typedef BrowserWithTestWindowTest BrowserListTest; |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Helper function to iterate and count all the tabs. | 30 // Helper function to iterate and count all the tabs. |
31 size_t CountAllTabs() { | 31 size_t CountAllTabs() { |
32 size_t count = 0; | 32 size_t count = 0; |
33 for (TabContentsIterator iterator; !iterator.done(); iterator.Next()) | 33 for (TabContentsIterator iterator; !iterator.done(); iterator.Next()) |
34 ++count; | 34 ++count; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 testing_browser_process->SetProfileManager(profile_manager); | 187 testing_browser_process->SetProfileManager(profile_manager); |
188 | 188 |
189 chrome::AttemptRestart(); | 189 chrome::AttemptRestart(); |
190 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests | 190 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests |
191 // ran after this one will fail. | 191 // ran after this one will fail. |
192 browser_shutdown::SetTryingToQuit(false); | 192 browser_shutdown::SetTryingToQuit(false); |
193 | 193 |
194 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); | 194 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); |
195 testing_browser_process->SetLocalState(NULL); | 195 testing_browser_process->SetLocalState(NULL); |
196 } | 196 } |
OLD | NEW |