| 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" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 MOCK_METHOD2(OnProfileCreated, | 95 MOCK_METHOD2(OnProfileCreated, |
| 96 void(Profile* profile, Profile::CreateStatus status)); | 96 void(Profile* profile, Profile::CreateStatus status)); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 ProfileManagerTest() | 99 ProfileManagerTest() |
| 100 : local_state_(TestingBrowserProcess::GetGlobal()), | 100 : local_state_(TestingBrowserProcess::GetGlobal()), |
| 101 extension_event_router_forwarder_(new extensions::EventRouterForwarder), | 101 extension_event_router_forwarder_(new extensions::EventRouterForwarder), |
| 102 ui_thread_(BrowserThread::UI, &message_loop_), | 102 ui_thread_(BrowserThread::UI, &message_loop_), |
| 103 db_thread_(BrowserThread::DB, &message_loop_), | 103 db_thread_(BrowserThread::DB, &message_loop_), |
| 104 file_thread_(BrowserThread::FILE, &message_loop_), | 104 file_thread_(BrowserThread::FILE, &message_loop_), |
| 105 io_thread_(local_state_.Get(), g_browser_process->policy_service(), | 105 io_thread_(local_state_.Get(), |
| 106 NULL, extension_event_router_forwarder_) { | 106 g_browser_process->policy_service(), |
| 107 NULL, |
| 108 extension_event_router_forwarder_.get()) { |
| 107 TestingBrowserProcess::GetGlobal()->SetIOThread(&io_thread_); | 109 TestingBrowserProcess::GetGlobal()->SetIOThread(&io_thread_); |
| 108 } | 110 } |
| 109 | 111 |
| 110 virtual void SetUp() { | 112 virtual void SetUp() { |
| 111 // Create a new temporary directory, and store the path | 113 // Create a new temporary directory, and store the path |
| 112 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 114 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 113 TestingBrowserProcess::GetGlobal()->SetProfileManager( | 115 TestingBrowserProcess::GetGlobal()->SetProfileManager( |
| 114 new testing::ProfileManager(temp_dir_.path())); | 116 new testing::ProfileManager(temp_dir_.path())); |
| 115 | 117 |
| 116 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 browser2b.reset(); | 645 browser2b.reset(); |
| 644 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 646 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 645 ASSERT_EQ(1U, last_opened_profiles.size()); | 647 ASSERT_EQ(1U, last_opened_profiles.size()); |
| 646 EXPECT_EQ(profile1, last_opened_profiles[0]); | 648 EXPECT_EQ(profile1, last_opened_profiles[0]); |
| 647 | 649 |
| 648 browser1.reset(); | 650 browser1.reset(); |
| 649 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 651 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 650 ASSERT_EQ(0U, last_opened_profiles.size()); | 652 ASSERT_EQ(0U, last_opened_profiles.size()); |
| 651 } | 653 } |
| 652 #endif // !defined(OS_ANDROID) | 654 #endif // !defined(OS_ANDROID) |
| OLD | NEW |