| 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 StartUserCreation("managed-user-creation-next-button", | 71 StartUserCreation("managed-user-creation-next-button", |
| 72 kTestSupervisedUserDisplayName); | 72 kTestSupervisedUserDisplayName); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Supervised user signs in, get sync notification about password update, and | 75 // Supervised user signs in, get sync notification about password update, and |
| 76 // schedules password migration. | 76 // schedules password migration. |
| 77 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, | 77 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, |
| 78 DISABLED_PRE_PasswordChangeFromUserTest) { | 78 DISABLED_PRE_PasswordChangeFromUserTest) { |
| 79 SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); | 79 SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); |
| 80 | 80 |
| 81 const User* user = UserManager::Get()->GetUsers().at(0); | 81 const user_manager::User* user = UserManager::Get()->GetUsers().at(0); |
| 82 std::string sync_id = | 82 std::string sync_id = |
| 83 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 83 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
| 84 user->email()); | 84 user->email()); |
| 85 base::DictionaryValue password; | 85 base::DictionaryValue password; |
| 86 password.SetIntegerWithoutPathExpansion( | 86 password.SetIntegerWithoutPathExpansion( |
| 87 kSchemaVersion, SupervisedUserAuthentication::SCHEMA_SALT_HASHED); | 87 kSchemaVersion, SupervisedUserAuthentication::SCHEMA_SALT_HASHED); |
| 88 password.SetIntegerWithoutPathExpansion(kPasswordRevision, 2); | 88 password.SetIntegerWithoutPathExpansion(kPasswordRevision, 2); |
| 89 | 89 |
| 90 password.SetStringWithoutPathExpansion(kPasswordSignature, "signature"); | 90 password.SetStringWithoutPathExpansion(kPasswordSignature, "signature"); |
| 91 password.SetStringWithoutPathExpansion(kEncryptedPassword, | 91 password.SetStringWithoutPathExpansion(kEncryptedPassword, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 StartFlowLoginAsManager(); | 116 StartFlowLoginAsManager(); |
| 117 FillNewUserData(kTestSupervisedUserDisplayName); | 117 FillNewUserData(kTestSupervisedUserDisplayName); |
| 118 StartUserCreation("managed-user-creation-next-button", | 118 StartUserCreation("managed-user-creation-next-button", |
| 119 kTestSupervisedUserDisplayName); | 119 kTestSupervisedUserDisplayName); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Manager signs in, gets sync notification about supervised user password | 122 // Manager signs in, gets sync notification about supervised user password |
| 123 // update, and performs migration. | 123 // update, and performs migration. |
| 124 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, | 124 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, |
| 125 DISABLED_PRE_PasswordChangeFromManagerTest) { | 125 DISABLED_PRE_PasswordChangeFromManagerTest) { |
| 126 const User* supervised_user = UserManager::Get()->GetUsers().at(0); | 126 const user_manager::User* supervised_user = |
| 127 UserManager::Get()->GetUsers().at(0); |
| 127 | 128 |
| 128 SigninAsManager(1); | 129 SigninAsManager(1); |
| 129 | 130 |
| 130 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); | 131 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); |
| 131 | 132 |
| 132 std::string sync_id = | 133 std::string sync_id = |
| 133 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 134 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
| 134 supervised_user->email()); | 135 supervised_user->email()); |
| 135 | 136 |
| 136 ::sync_pb::ManagedUserSpecifics managed_user_proto; | 137 ::sync_pb::ManagedUserSpecifics managed_user_proto; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 StartUserCreation("managed-user-creation-next-button", | 183 StartUserCreation("managed-user-creation-next-button", |
| 183 kTestSupervisedUserDisplayName); | 184 kTestSupervisedUserDisplayName); |
| 184 } | 185 } |
| 185 | 186 |
| 186 // Supervised user signs in, get sync notification about password update, and | 187 // Supervised user signs in, get sync notification about password update, and |
| 187 // schedules password migration. | 188 // schedules password migration. |
| 188 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, | 189 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, |
| 189 DISABLED_PRE_PRE_PasswordChangeUserAndManagerTest) { | 190 DISABLED_PRE_PRE_PasswordChangeUserAndManagerTest) { |
| 190 SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); | 191 SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); |
| 191 | 192 |
| 192 const User* user = UserManager::Get()->GetUsers().at(0); | 193 const user_manager::User* user = UserManager::Get()->GetUsers().at(0); |
| 193 std::string sync_id = | 194 std::string sync_id = |
| 194 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 195 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
| 195 user->email()); | 196 user->email()); |
| 196 base::DictionaryValue password; | 197 base::DictionaryValue password; |
| 197 password.SetIntegerWithoutPathExpansion( | 198 password.SetIntegerWithoutPathExpansion( |
| 198 kSchemaVersion, SupervisedUserAuthentication::SCHEMA_SALT_HASHED); | 199 kSchemaVersion, SupervisedUserAuthentication::SCHEMA_SALT_HASHED); |
| 199 password.SetIntegerWithoutPathExpansion(kPasswordRevision, 2); | 200 password.SetIntegerWithoutPathExpansion(kPasswordRevision, 2); |
| 200 | 201 |
| 201 password.SetStringWithoutPathExpansion(kPasswordSignature, "signature"); | 202 password.SetStringWithoutPathExpansion(kPasswordSignature, "signature"); |
| 202 password.SetStringWithoutPathExpansion(kEncryptedPassword, | 203 password.SetStringWithoutPathExpansion(kEncryptedPassword, |
| 203 "new-encrypted-password"); | 204 "new-encrypted-password"); |
| 204 | 205 |
| 205 shared_settings_adapter_->AddChange( | 206 shared_settings_adapter_->AddChange( |
| 206 sync_id, supervised_users::kChromeOSPasswordData, password, true, false); | 207 sync_id, supervised_users::kChromeOSPasswordData, password, true, false); |
| 207 content::RunAllPendingInMessageLoop(); | 208 content::RunAllPendingInMessageLoop(); |
| 208 } | 209 } |
| 209 | 210 |
| 210 // After that manager signs in, and also detects password change. Manager | 211 // After that manager signs in, and also detects password change. Manager |
| 211 // performs the migration. | 212 // performs the migration. |
| 212 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, | 213 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, |
| 213 DISABLED_PRE_PasswordChangeUserAndManagerTest) { | 214 DISABLED_PRE_PasswordChangeUserAndManagerTest) { |
| 214 const User* supervised_user = UserManager::Get()->GetUsers().at(0); | 215 const user_manager::User* supervised_user = |
| 216 UserManager::Get()->GetUsers().at(0); |
| 215 | 217 |
| 216 SigninAsManager(1); | 218 SigninAsManager(1); |
| 217 | 219 |
| 218 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); | 220 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); |
| 219 | 221 |
| 220 std::string sync_id = | 222 std::string sync_id = |
| 221 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 223 UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
| 222 supervised_user->email()); | 224 supervised_user->email()); |
| 223 | 225 |
| 224 ::sync_pb::ManagedUserSpecifics managed_user_proto; | 226 ::sync_pb::ManagedUserSpecifics managed_user_proto; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 252 // should be attempted. | 254 // should be attempted. |
| 253 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, | 255 IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, |
| 254 DISABLED_PasswordChangeUserAndManagerTest) { | 256 DISABLED_PasswordChangeUserAndManagerTest) { |
| 255 EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); | 257 EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); |
| 256 EXPECT_CALL(*mock_homedir_methods_, UpdateKeyEx(_, _, _, _, _)).Times(0); | 258 EXPECT_CALL(*mock_homedir_methods_, UpdateKeyEx(_, _, _, _, _)).Times(0); |
| 257 SigninAsSupervisedUser(false, 1, kTestSupervisedUserDisplayName); | 259 SigninAsSupervisedUser(false, 1, kTestSupervisedUserDisplayName); |
| 258 testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); | 260 testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); |
| 259 } | 261 } |
| 260 | 262 |
| 261 } // namespace chromeos | 263 } // namespace chromeos |
| OLD | NEW |