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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 class ContactManagerTest : public testing::Test { | 64 class ContactManagerTest : public testing::Test { |
65 public: | 65 public: |
66 ContactManagerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} | 66 ContactManagerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} |
67 virtual ~ContactManagerTest() {} | 67 virtual ~ContactManagerTest() {} |
68 | 68 |
69 protected: | 69 protected: |
70 // testing::Test implementation. | 70 // testing::Test implementation. |
71 virtual void SetUp() OVERRIDE { | 71 virtual void SetUp() OVERRIDE { |
72 profile_manager_.reset( | 72 profile_manager_.reset( |
73 new TestingProfileManager( | 73 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
74 static_cast<TestingBrowserProcess*>(g_browser_process))); | |
75 ASSERT_TRUE(profile_manager_->SetUp()); | 74 ASSERT_TRUE(profile_manager_->SetUp()); |
76 | 75 |
77 contact_manager_.reset(new ContactManager); | 76 contact_manager_.reset(new ContactManager); |
78 store_factory_ = new FakeContactStoreFactory; | 77 store_factory_ = new FakeContactStoreFactory; |
79 contact_manager_->SetContactStoreForTesting( | 78 contact_manager_->SetContactStoreForTesting( |
80 scoped_ptr<ContactStoreFactory>(store_factory_).Pass()); | 79 scoped_ptr<ContactStoreFactory>(store_factory_).Pass()); |
81 contact_manager_->Init(); | 80 contact_manager_->Init(); |
82 } | 81 } |
83 | 82 |
84 MessageLoopForUI message_loop_; | 83 MessageLoopForUI message_loop_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 store_factory_->set_permit_store_creation(false); | 162 store_factory_->set_permit_store_creation(false); |
164 const std::string kProfileName = "test_profile"; | 163 const std::string kProfileName = "test_profile"; |
165 TestingProfile* profile = | 164 TestingProfile* profile = |
166 profile_manager_->CreateTestingProfile(kProfileName); | 165 profile_manager_->CreateTestingProfile(kProfileName); |
167 EXPECT_FALSE(store_factory_->GetContactStoreForProfile(profile)); | 166 EXPECT_FALSE(store_factory_->GetContactStoreForProfile(profile)); |
168 profile_manager_->DeleteTestingProfile(kProfileName); | 167 profile_manager_->DeleteTestingProfile(kProfileName); |
169 } | 168 } |
170 | 169 |
171 } // namespace test | 170 } // namespace test |
172 } // namespace contacts | 171 } // namespace contacts |
OLD | NEW |