| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "chrome/browser/managed_mode/managed_user_refresh_token_fetcher.h" | 10 #include "chrome/browser/managed_mode/managed_user_refresh_token_fetcher.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class MockChangeProcessor : public SyncChangeProcessor { | 40 class MockChangeProcessor : public SyncChangeProcessor { |
| 41 public: | 41 public: |
| 42 MockChangeProcessor() {} | 42 MockChangeProcessor() {} |
| 43 virtual ~MockChangeProcessor() {} | 43 virtual ~MockChangeProcessor() {} |
| 44 | 44 |
| 45 // SyncChangeProcessor implementation: | 45 // SyncChangeProcessor implementation: |
| 46 virtual SyncError ProcessSyncChanges( | 46 virtual SyncError ProcessSyncChanges( |
| 47 const tracked_objects::Location& from_here, | 47 const tracked_objects::Location& from_here, |
| 48 const SyncChangeList& change_list) OVERRIDE; | 48 const SyncChangeList& change_list) OVERRIDE; |
| 49 | 49 |
| 50 virtual SyncDataList GetAllSyncData(syncer::ModelType type) const { |
| 51 return SyncDataList(); |
| 52 } |
| 53 |
| 50 const SyncChangeList& changes() const { return change_list_; } | 54 const SyncChangeList& changes() const { return change_list_; } |
| 51 | 55 |
| 52 private: | 56 private: |
| 53 SyncChangeList change_list_; | 57 SyncChangeList change_list_; |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 SyncError MockChangeProcessor::ProcessSyncChanges( | 60 SyncError MockChangeProcessor::ProcessSyncChanges( |
| 57 const tracked_objects::Location& from_here, | 61 const tracked_objects::Location& from_here, |
| 58 const SyncChangeList& change_list) { | 62 const SyncChangeList& change_list) { |
| 59 change_list_ = change_list; | 63 change_list_ = change_list; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 ManagedUserRegistrationUtility::GenerateNewManagedUserId(), | 277 ManagedUserRegistrationUtility::GenerateNewManagedUserId(), |
| 274 ManagedUserRegistrationInfo(ASCIIToUTF16("Mike")), | 278 ManagedUserRegistrationInfo(ASCIIToUTF16("Mike")), |
| 275 GetRegistrationCallback()); | 279 GetRegistrationCallback()); |
| 276 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); | 280 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); |
| 277 service()->StopSyncing(MANAGED_USERS); | 281 service()->StopSyncing(MANAGED_USERS); |
| 278 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); | 282 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); |
| 279 EXPECT_TRUE(received_callback()); | 283 EXPECT_TRUE(received_callback()); |
| 280 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); | 284 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); |
| 281 EXPECT_EQ(std::string(), token()); | 285 EXPECT_EQ(std::string(), token()); |
| 282 } | 286 } |
| OLD | NEW |