| 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 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 EXPECT_CALL(*mock_async_method_caller_, AsyncAddKey(_, _, _, _)) | 215 EXPECT_CALL(*mock_async_method_caller_, AsyncAddKey(_, _, _, _)) |
| 216 .Times(1); | 216 .Times(1); |
| 217 | 217 |
| 218 JSEval("$('managed-user-creation-next-button').click()"); | 218 JSEval("$('managed-user-creation-next-button').click()"); |
| 219 | 219 |
| 220 testing::Mock::VerifyAndClearExpectations(mock_async_method_caller_); | 220 testing::Mock::VerifyAndClearExpectations(mock_async_method_caller_); |
| 221 | 221 |
| 222 EXPECT_TRUE(registration_utility_stub_->register_was_called()); | 222 EXPECT_TRUE(registration_utility_stub_->register_was_called()); |
| 223 EXPECT_EQ(registration_utility_stub_->display_name(), | 223 EXPECT_EQ(registration_utility_stub_->display_name(), |
| 224 UTF8ToUTF16(kSupervisedUserDisplayName)); | 224 UTF8ToUTF16(kSupervisedUserDisplayName)); |
| 225 EXPECT_FALSE(registration_utility_stub_->update_avatar()); |
| 225 | 226 |
| 226 registration_utility_stub_->RunSuccessCallback("token"); | 227 registration_utility_stub_->RunSuccessCallback("token"); |
| 227 | 228 |
| 228 // Token writing moves control to BlockingPool and back. | 229 // Token writing moves control to BlockingPool and back. |
| 229 base::RunLoop().RunUntilIdle(); | 230 base::RunLoop().RunUntilIdle(); |
| 230 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 231 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 231 base::RunLoop().RunUntilIdle(); | 232 base::RunLoop().RunUntilIdle(); |
| 232 | 233 |
| 233 JSExpect("$('managed-user-creation').currentPage_ == 'created'"); | 234 JSExpect("$('managed-user-creation').currentPage_ == 'created'"); |
| 234 JSEval("$('managed-user-creation-gotit-button').click()"); | 235 JSEval("$('managed-user-creation-gotit-button').click()"); |
| 235 } | 236 } |
| 236 | 237 |
| 237 IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, CreateSupervisedUser) { | 238 IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, CreateSupervisedUser) { |
| 238 // Log in as supervised user, make sure that everything works. | 239 // Log in as supervised user, make sure that everything works. |
| 239 ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size()); | 240 ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size()); |
| 240 // Created supervised user have to be first in a list. | 241 // Created supervised user have to be first in a list. |
| 241 const User* user = UserManager::Get()->GetUsers().at(0); | 242 const User* user = UserManager::Get()->GetUsers().at(0); |
| 242 ASSERT_EQ(UTF8ToUTF16(kSupervisedUserDisplayName), user->display_name()); | 243 ASSERT_EQ(UTF8ToUTF16(kSupervisedUserDisplayName), user->display_name()); |
| 243 LoginUser(user->email()); | 244 LoginUser(user->email()); |
| 244 } | 245 } |
| 245 | 246 |
| 246 } // namespace chromeos | 247 } // namespace chromeos |
| OLD | NEW |