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_database.h" | 5 #include "chrome/browser/chromeos/contacts/contact_database.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void OnContactsLoaded(bool success, | 122 void OnContactsLoaded(bool success, |
123 scoped_ptr<ScopedVector<Contact> > contacts, | 123 scoped_ptr<ScopedVector<Contact> > contacts, |
124 scoped_ptr<UpdateMetadata> metadata) { | 124 scoped_ptr<UpdateMetadata> metadata) { |
125 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 125 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
126 CHECK(success); | 126 CHECK(success); |
127 loaded_contacts_.swap(contacts); | 127 loaded_contacts_.swap(contacts); |
128 loaded_metadata_.swap(metadata); | 128 loaded_metadata_.swap(metadata); |
129 message_loop_.Quit(); | 129 message_loop_.Quit(); |
130 } | 130 } |
131 | 131 |
132 MessageLoopForUI message_loop_; | 132 base::MessageLoopForUI message_loop_; |
133 content::TestBrowserThread ui_thread_; | 133 content::TestBrowserThread ui_thread_; |
134 | 134 |
135 // Temporary directory where the database is saved. | 135 // Temporary directory where the database is saved. |
136 base::ScopedTempDir temp_dir_; | 136 base::ScopedTempDir temp_dir_; |
137 | 137 |
138 // This class retains ownership of this object. | 138 // This class retains ownership of this object. |
139 ContactDatabase* db_; | 139 ContactDatabase* db_; |
140 | 140 |
141 // Contacts and metadata returned by the most-recent | 141 // Contacts and metadata returned by the most-recent |
142 // ContactDatabase::LoadContacts() call. Used to pass returned values from | 142 // ContactDatabase::LoadContacts() call. Used to pass returned values from |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 contact_ids_to_delete.Pass(), | 407 contact_ids_to_delete.Pass(), |
408 metadata_to_save.Pass(), | 408 metadata_to_save.Pass(), |
409 false); | 409 false); |
410 LoadContacts(&loaded_contacts, &loaded_metadata); | 410 LoadContacts(&loaded_contacts, &loaded_metadata); |
411 EXPECT_EQ(VarContactsToString(1, contact3.get()), | 411 EXPECT_EQ(VarContactsToString(1, contact3.get()), |
412 ContactsToString(*loaded_contacts)); | 412 ContactsToString(*loaded_contacts)); |
413 } | 413 } |
414 | 414 |
415 } // namespace test | 415 } // namespace test |
416 } // namespace contacts | 416 } // namespace contacts |
OLD | NEW |