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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 GoogleServiceAuthError error_; | 138 GoogleServiceAuthError error_; |
139 std::string token_; | 139 std::string token_; |
140 }; | 140 }; |
141 | 141 |
142 ManagedUserRegistrationServiceTest::ManagedUserRegistrationServiceTest() | 142 ManagedUserRegistrationServiceTest::ManagedUserRegistrationServiceTest() |
143 : weak_ptr_factory_(this), | 143 : weak_ptr_factory_(this), |
144 change_processor_(NULL), | 144 change_processor_(NULL), |
145 sync_data_id_(0), | 145 sync_data_id_(0), |
146 received_callback_(false), | 146 received_callback_(false), |
147 error_(GoogleServiceAuthError::NUM_STATES) { | 147 error_(GoogleServiceAuthError::NUM_STATES) { |
148 ManagedUserRegistrationService::RegisterUserPrefs(prefs_.registry()); | 148 ManagedUserRegistrationService::RegisterProfilePrefs(prefs_.registry()); |
149 scoped_ptr<ManagedUserRefreshTokenFetcher> token_fetcher( | 149 scoped_ptr<ManagedUserRefreshTokenFetcher> token_fetcher( |
150 new MockManagedUserRefreshTokenFetcher); | 150 new MockManagedUserRefreshTokenFetcher); |
151 service_.reset( | 151 service_.reset( |
152 new ManagedUserRegistrationService(&prefs_, token_fetcher.Pass())); | 152 new ManagedUserRegistrationService(&prefs_, token_fetcher.Pass())); |
153 } | 153 } |
154 | 154 |
155 ManagedUserRegistrationServiceTest::~ManagedUserRegistrationServiceTest() { | 155 ManagedUserRegistrationServiceTest::~ManagedUserRegistrationServiceTest() { |
156 EXPECT_FALSE(weak_ptr_factory_.HasWeakPtrs()); | 156 EXPECT_FALSE(weak_ptr_factory_.HasWeakPtrs()); |
157 } | 157 } |
158 | 158 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 StartInitialSync(); | 377 StartInitialSync(); |
378 service()->Register(ManagedUserRegistrationInfo(ASCIIToUTF16("Mike")), | 378 service()->Register(ManagedUserRegistrationInfo(ASCIIToUTF16("Mike")), |
379 GetRegistrationCallback()); | 379 GetRegistrationCallback()); |
380 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); | 380 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); |
381 service()->StopSyncing(MANAGED_USERS); | 381 service()->StopSyncing(MANAGED_USERS); |
382 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); | 382 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); |
383 EXPECT_TRUE(received_callback()); | 383 EXPECT_TRUE(received_callback()); |
384 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); | 384 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); |
385 EXPECT_EQ(std::string(), token()); | 385 EXPECT_EQ(std::string(), token()); |
386 } | 386 } |
OLD | NEW |