| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 SyncError MockChangeProcessor::ProcessSyncChanges( | 63 SyncError MockChangeProcessor::ProcessSyncChanges( |
| 64 const tracked_objects::Location& from_here, | 64 const tracked_objects::Location& from_here, |
| 65 const SyncChangeList& change_list) { | 65 const SyncChangeList& change_list) { |
| 66 change_list_ = change_list; | 66 change_list_ = change_list; |
| 67 return SyncError(); | 67 return SyncError(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 SyncChange MockChangeProcessor::GetChange(const std::string& id) const { | 70 SyncChange MockChangeProcessor::GetChange(const std::string& id) const { |
| 71 for (SyncChangeList::const_iterator it = change_list_.begin(); | 71 for (const auto& sync_change : change_list_) { |
| 72 it != change_list_.end(); ++it) { | 72 if (sync_change.sync_data().GetSpecifics().managed_user().id() == id) |
| 73 if (it->sync_data().GetSpecifics().managed_user().id() == id) | 73 return sync_change; |
| 74 return *it; | |
| 75 } | 74 } |
| 76 return SyncChange(); | 75 return SyncChange(); |
| 77 } | 76 } |
| 78 | 77 |
| 79 // Callback for SupervisedUserSyncService::GetSupervisedUsersAsync(). | 78 // Callback for SupervisedUserSyncService::GetSupervisedUsersAsync(). |
| 80 void GetSupervisedUsersCallback(const base::DictionaryValue** dict, | 79 void GetSupervisedUsersCallback(const base::DictionaryValue** dict, |
| 81 const base::DictionaryValue* supervised_users) { | 80 const base::DictionaryValue* supervised_users) { |
| 82 *dict = supervised_users; | 81 *dict = supervised_users; |
| 83 } | 82 } |
| 84 | 83 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 360 |
| 362 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( | 361 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( |
| 363 "chrome-avatar-index:x", | 362 "chrome-avatar-index:x", |
| 364 &avatar)); | 363 &avatar)); |
| 365 | 364 |
| 366 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( | 365 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( |
| 367 "chromeos-avatar-index:5", | 366 "chromeos-avatar-index:5", |
| 368 &avatar)); | 367 &avatar)); |
| 369 #endif | 368 #endif |
| 370 } | 369 } |
| OLD | NEW |