| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 17 #include "chrome/browser/extensions/event_router_forwarder.h" | 18 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 18 #include "chrome/browser/history/history_service.h" | 19 #include "chrome/browser/history/history_service.h" |
| 19 #include "chrome/browser/history/history_service_factory.h" | 20 #include "chrome/browser/history/history_service_factory.h" |
| 20 #include "chrome/browser/io_thread.h" | 21 #include "chrome/browser/io_thread.h" |
| 21 #include "chrome/browser/prefs/browser_prefs.h" | 22 #include "chrome/browser/prefs/browser_prefs.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/profiles/profile_info_cache.h" | 24 #include "chrome/browser/profiles/profile_info_cache.h" |
| 24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 virtual void TearDown() { | 117 virtual void TearDown() { |
| 117 TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL); | 118 TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL); |
| 118 message_loop_.RunUntilIdle(); | 119 message_loop_.RunUntilIdle(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
| 122 // Do not change order of stub_cros_enabler_, which needs to be constructed | 123 // Do not change order of stub_cros_enabler_, which needs to be constructed |
| 123 // before io_thread_ which requires CrosLibrary to be initialized to construct | 124 // before io_thread_ which requires CrosLibrary to be initialized to construct |
| 124 // its data member pref_proxy_config_tracker_ on ChromeOS. | 125 // its data member pref_proxy_config_tracker_ on ChromeOS. |
| 125 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; | 126 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; |
| 127 chromeos::ScopedTestCrosSettings test_cros_settings_; |
| 126 #endif | 128 #endif |
| 127 | 129 |
| 128 // The path to temporary directory used to contain the test operations. | 130 // The path to temporary directory used to contain the test operations. |
| 129 base::ScopedTempDir temp_dir_; | 131 base::ScopedTempDir temp_dir_; |
| 130 ScopedTestingLocalState local_state_; | 132 ScopedTestingLocalState local_state_; |
| 131 scoped_refptr<extensions::EventRouterForwarder> | 133 scoped_refptr<extensions::EventRouterForwarder> |
| 132 extension_event_router_forwarder_; | 134 extension_event_router_forwarder_; |
| 133 | 135 |
| 134 MessageLoopForUI message_loop_; | 136 MessageLoopForUI message_loop_; |
| 135 content::TestBrowserThread ui_thread_; | 137 content::TestBrowserThread ui_thread_; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 browser2b.reset(); | 598 browser2b.reset(); |
| 597 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 599 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 598 ASSERT_EQ(1U, last_opened_profiles.size()); | 600 ASSERT_EQ(1U, last_opened_profiles.size()); |
| 599 EXPECT_EQ(profile1, last_opened_profiles[0]); | 601 EXPECT_EQ(profile1, last_opened_profiles[0]); |
| 600 | 602 |
| 601 browser1.reset(); | 603 browser1.reset(); |
| 602 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 604 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 603 ASSERT_EQ(0U, last_opened_profiles.size()); | 605 ASSERT_EQ(0U, last_opened_profiles.size()); |
| 604 } | 606 } |
| 605 #endif // !defined(OS_ANDROID) | 607 #endif // !defined(OS_ANDROID) |
| OLD | NEW |