| 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 "chrome/browser/supervised_user/legacy/supervised_user_registration_uti
lity.h" | 5 #include "chrome/browser/supervised_user/legacy/supervised_user_registration_uti
lity.h" |
| 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/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fe
tcher.h" | 13 #include "chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fe
tcher.h" |
| 14 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 14 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
| 15 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" | 15 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" |
| 16 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" | 16 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
| 17 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" | 17 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/test/base/testing_pref_service_syncable.h" | |
| 20 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "components/syncable_prefs/testing_pref_service_syncable.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/test/test_utils.h" | 22 #include "content/public/test/test_utils.h" |
| 23 #include "google_apis/gaia/google_service_auth_error.h" | 23 #include "google_apis/gaia/google_service_auth_error.h" |
| 24 #include "sync/api/attachments/attachment_id.h" | 24 #include "sync/api/attachments/attachment_id.h" |
| 25 #include "sync/api/sync_change.h" | 25 #include "sync/api/sync_change.h" |
| 26 #include "sync/api/sync_error_factory_mock.h" | 26 #include "sync/api/sync_error_factory_mock.h" |
| 27 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" | 27 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" |
| 28 #include "sync/protocol/sync.pb.h" | 28 #include "sync/protocol/sync.pb.h" |
| 29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
| 30 | 30 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(), | 292 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(), |
| 293 SupervisedUserRegistrationInfo(base::ASCIIToUTF16("Mike"), 17), | 293 SupervisedUserRegistrationInfo(base::ASCIIToUTF16("Mike"), 17), |
| 294 GetRegistrationCallback()); | 294 GetRegistrationCallback()); |
| 295 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); | 295 EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); |
| 296 service()->StopSyncing(SUPERVISED_USERS); | 296 service()->StopSyncing(SUPERVISED_USERS); |
| 297 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); | 297 EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); |
| 298 EXPECT_TRUE(received_callback()); | 298 EXPECT_TRUE(received_callback()); |
| 299 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); | 299 EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); |
| 300 EXPECT_EQ(std::string(), token()); | 300 EXPECT_EQ(std::string(), token()); |
| 301 } | 301 } |
| OLD | NEW |