| 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" | |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" | 12 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
| 14 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" | 13 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" |
| 15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 16 #include "content/public/test/test_browser_thread_bundle.h" |
| 17 #include "sync/api/attachments/attachment_id.h" | 17 #include "sync/api/attachments/attachment_id.h" |
| 18 #include "sync/api/sync_change.h" | 18 #include "sync/api/sync_change.h" |
| 19 #include "sync/api/sync_error_factory_mock.h" | 19 #include "sync/api/sync_error_factory_mock.h" |
| 20 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" | 20 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" |
| 21 #include "sync/protocol/sync.pb.h" | 21 #include "sync/protocol/sync.pb.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
| 25 #include "components/user_manager/user_image/default_user_images.h" | 25 #include "components/user_manager/user_image/default_user_images.h" |
| 26 #endif | 26 #endif |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 scoped_ptr<SyncErrorFactory> CreateErrorFactory(); | 91 scoped_ptr<SyncErrorFactory> CreateErrorFactory(); |
| 92 SyncData CreateRemoteData(const std::string& id, | 92 SyncData CreateRemoteData(const std::string& id, |
| 93 const std::string& name, | 93 const std::string& name, |
| 94 const std::string& avatar); | 94 const std::string& avatar); |
| 95 | 95 |
| 96 PrefService* prefs() { return profile_.GetPrefs(); } | 96 PrefService* prefs() { return profile_.GetPrefs(); } |
| 97 SupervisedUserSyncService* service() { return service_; } | 97 SupervisedUserSyncService* service() { return service_; } |
| 98 MockChangeProcessor* change_processor() { return change_processor_; } | 98 MockChangeProcessor* change_processor() { return change_processor_; } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 base::MessageLoop message_loop; | 101 content::TestBrowserThreadBundle thread_bundle_; |
| 102 TestingProfile profile_; | 102 TestingProfile profile_; |
| 103 SupervisedUserSyncService* service_; | 103 SupervisedUserSyncService* service_; |
| 104 | 104 |
| 105 // Owned by the SupervisedUserSyncService. | 105 // Owned by the SupervisedUserSyncService. |
| 106 MockChangeProcessor* change_processor_; | 106 MockChangeProcessor* change_processor_; |
| 107 | 107 |
| 108 // A unique ID for creating "remote" Sync data. | 108 // A unique ID for creating "remote" Sync data. |
| 109 int64 sync_data_id_; | 109 int64 sync_data_id_; |
| 110 }; | 110 }; |
| 111 | 111 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( | 359 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( |
| 360 "chrome-avatar-index:x", | 360 "chrome-avatar-index:x", |
| 361 &avatar)); | 361 &avatar)); |
| 362 | 362 |
| 363 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( | 363 EXPECT_FALSE(SupervisedUserSyncService::GetAvatarIndex( |
| 364 "chromeos-avatar-index:5", | 364 "chromeos-avatar-index:5", |
| 365 &avatar)); | 365 &avatar)); |
| 366 #endif | 366 #endif |
| 367 } | 367 } |
| OLD | NEW |