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/chromeos/contacts/contact_manager.h" | 5 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/test/base/testing_browser_process.h" | 9 #include "chrome/test/base/testing_browser_process.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 73 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
74 ASSERT_TRUE(profile_manager_->SetUp()); | 74 ASSERT_TRUE(profile_manager_->SetUp()); |
75 | 75 |
76 contact_manager_.reset(new ContactManager); | 76 contact_manager_.reset(new ContactManager); |
77 store_factory_ = new FakeContactStoreFactory; | 77 store_factory_ = new FakeContactStoreFactory; |
78 contact_manager_->SetContactStoreForTesting( | 78 contact_manager_->SetContactStoreForTesting( |
79 scoped_ptr<ContactStoreFactory>(store_factory_).Pass()); | 79 scoped_ptr<ContactStoreFactory>(store_factory_).Pass()); |
80 contact_manager_->Init(); | 80 contact_manager_->Init(); |
81 } | 81 } |
82 | 82 |
83 MessageLoopForUI message_loop_; | 83 base::MessageLoopForUI message_loop_; |
84 content::TestBrowserThread ui_thread_; | 84 content::TestBrowserThread ui_thread_; |
85 | 85 |
86 scoped_ptr<TestingProfileManager> profile_manager_; | 86 scoped_ptr<TestingProfileManager> profile_manager_; |
87 scoped_ptr<ContactManager> contact_manager_; | 87 scoped_ptr<ContactManager> contact_manager_; |
88 FakeContactStoreFactory* store_factory_; // not owned | 88 FakeContactStoreFactory* store_factory_; // not owned |
89 | 89 |
90 private: | 90 private: |
91 DISALLOW_COPY_AND_ASSIGN(ContactManagerTest); | 91 DISALLOW_COPY_AND_ASSIGN(ContactManagerTest); |
92 }; | 92 }; |
93 | 93 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 store_factory_->set_permit_store_creation(false); | 162 store_factory_->set_permit_store_creation(false); |
163 const std::string kProfileName = "test_profile"; | 163 const std::string kProfileName = "test_profile"; |
164 TestingProfile* profile = | 164 TestingProfile* profile = |
165 profile_manager_->CreateTestingProfile(kProfileName); | 165 profile_manager_->CreateTestingProfile(kProfileName); |
166 EXPECT_FALSE(store_factory_->GetContactStoreForProfile(profile)); | 166 EXPECT_FALSE(store_factory_->GetContactStoreForProfile(profile)); |
167 profile_manager_->DeleteTestingProfile(kProfileName); | 167 profile_manager_->DeleteTestingProfile(kProfileName); |
168 } | 168 } |
169 | 169 |
170 } // namespace test | 170 } // namespace test |
171 } // namespace contacts | 171 } // namespace contacts |
OLD | NEW |