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 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // const Contact* arguments. | 30 // const Contact* arguments. |
31 std::string VarContactsToString(int num_contacts, ...); | 31 std::string VarContactsToString(int num_contacts, ...); |
32 | 32 |
33 // Saves copies of all contacts in |source| to |dest|. | 33 // Saves copies of all contacts in |source| to |dest|. |
34 void CopyContacts(const ContactPointers& source, | 34 void CopyContacts(const ContactPointers& source, |
35 ScopedVector<Contact>* dest); | 35 ScopedVector<Contact>* dest); |
36 void CopyContacts(const ScopedVector<Contact>& source, | 36 void CopyContacts(const ScopedVector<Contact>& source, |
37 ScopedVector<Contact>* dest); | 37 ScopedVector<Contact>* dest); |
38 | 38 |
39 // Initializes |contact| with the passed-in data. The photo and all address | 39 // Initializes |contact| with the passed-in data. The photo and all address |
40 // fields are cleared. |provider_id| corresponds to Contact::provider_id, | 40 // fields are cleared. |contact_id| corresponds to Contact::contact_id, |
41 // |deleted| to Contact::deleted, and a unique string should be passed to | 41 // |deleted| to Contact::deleted, and a unique string should be passed to |
42 // |name_suffix| to make the name-related fields be distinct from those in other | 42 // |name_suffix| to make the name-related fields be distinct from those in other |
43 // contacts. | 43 // contacts. |
44 void InitContact(const std::string& provider_id, | 44 void InitContact(const std::string& contact_id, |
45 const std::string& name_suffix, | 45 const std::string& name_suffix, |
46 bool deleted, | 46 bool deleted, |
47 Contact* contact); | 47 Contact* contact); |
48 | 48 |
49 // Adds an email address to |contact|. | 49 // Adds an email address to |contact|. |
50 void AddEmailAddress(const std::string& address, | 50 void AddEmailAddress(const std::string& address, |
51 Contact_AddressType_Relation relation, | 51 Contact_AddressType_Relation relation, |
52 const std::string& label, | 52 const std::string& label, |
53 bool primary, | 53 bool primary, |
54 Contact* contact); | 54 Contact* contact); |
(...skipping 25 matching lines...) Expand all Loading... |
80 // ContactToString() includes the photo's dimensions in its output, so tests can | 80 // ContactToString() includes the photo's dimensions in its output, so tests can |
81 // call this method to set the photo to a given size and then check that the | 81 // call this method to set the photo to a given size and then check that the |
82 // size matches later (e.g. after loading the contact from a server or from | 82 // size matches later (e.g. after loading the contact from a server or from |
83 // disk) to confirm that the photo was loaded correctly. | 83 // disk) to confirm that the photo was loaded correctly. |
84 void SetPhoto(const gfx::Size& size, Contact* contact); | 84 void SetPhoto(const gfx::Size& size, Contact* contact); |
85 | 85 |
86 } // namespace test | 86 } // namespace test |
87 } // namespace contacts | 87 } // namespace contacts |
88 | 88 |
89 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_TEST_UTIL_H_ |
OLD | NEW |