Chromium Code Reviews| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/power_monitor/power_monitor.h" | |
| 11 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
| 12 #include "base/system_monitor/system_monitor.h" | 13 #include "base/system_monitor/system_monitor.h" |
| 13 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 14 #include "base/values.h" | 15 #include "base/values.h" |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 17 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/extensions/event_router_forwarder.h" | 19 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 19 #include "chrome/browser/history/history.h" | 20 #include "chrome/browser/history/history.h" |
| 20 #include "chrome/browser/history/history_service_factory.h" | 21 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 92 |
| 92 ProfileManagerTest() | 93 ProfileManagerTest() |
| 93 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), | 94 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), |
| 94 extension_event_router_forwarder_(new extensions::EventRouterForwarder), | 95 extension_event_router_forwarder_(new extensions::EventRouterForwarder), |
| 95 ui_thread_(BrowserThread::UI, &message_loop_), | 96 ui_thread_(BrowserThread::UI, &message_loop_), |
| 96 db_thread_(BrowserThread::DB, &message_loop_), | 97 db_thread_(BrowserThread::DB, &message_loop_), |
| 97 file_thread_(BrowserThread::FILE, &message_loop_), | 98 file_thread_(BrowserThread::FILE, &message_loop_), |
| 98 io_thread_(local_state_.Get(), NULL, | 99 io_thread_(local_state_.Get(), NULL, |
| 99 extension_event_router_forwarder_) { | 100 extension_event_router_forwarder_) { |
| 100 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 101 base::SystemMonitor::AllocateSystemIOPorts(); | 102 base::PowerMonitor::AllocateSystemIOPorts(); |
| 102 #endif | 103 #endif |
| 103 system_monitor_dummy_.reset(new base::SystemMonitor); | 104 system_monitor_dummy_.reset(new base::SystemMonitor); |
|
vandebo (ex-Chrome)
2012/10/11 20:49:57
I don't think this line is needed. Please remove
Hongbo Min
2012/10/12 14:43:53
Done.
| |
| 104 static_cast<TestingBrowserProcess*>(g_browser_process)->SetIOThread( | 105 static_cast<TestingBrowserProcess*>(g_browser_process)->SetIOThread( |
| 105 &io_thread_); | 106 &io_thread_); |
| 106 } | 107 } |
| 107 | 108 |
| 108 virtual void SetUp() { | 109 virtual void SetUp() { |
| 109 // Create a new temporary directory, and store the path | 110 // Create a new temporary directory, and store the path |
| 110 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 111 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 111 static_cast<TestingBrowserProcess*>(g_browser_process)->SetProfileManager( | 112 static_cast<TestingBrowserProcess*>(g_browser_process)->SetProfileManager( |
| 112 new testing::ProfileManager(temp_dir_.path())); | 113 new testing::ProfileManager(temp_dir_.path())); |
| 113 | 114 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 browser2b.reset(); | 560 browser2b.reset(); |
| 560 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 561 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 561 ASSERT_EQ(1U, last_opened_profiles.size()); | 562 ASSERT_EQ(1U, last_opened_profiles.size()); |
| 562 EXPECT_EQ(profile1, last_opened_profiles[0]); | 563 EXPECT_EQ(profile1, last_opened_profiles[0]); |
| 563 | 564 |
| 564 browser1.reset(); | 565 browser1.reset(); |
| 565 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); | 566 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); |
| 566 ASSERT_EQ(0U, last_opened_profiles.size()); | 567 ASSERT_EQ(0U, last_opened_profiles.size()); |
| 567 } | 568 } |
| 568 #endif // !defined(OS_ANDROID) | 569 #endif // !defined(OS_ANDROID) |
| OLD | NEW |