Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/chromeos/login/managed/supervised_user_creation_browsertest.cc

Issue 23691045: Update managed user registration to allow updating the avatar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ... Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698