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/chromeos/login/supervised/supervised_user_test_base.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_test_base.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 // Select the first user as manager, and enter password. | 288 // Select the first user as manager, and enter password. |
289 JSExpect("$('supervised-user-creation-next-button').disabled"); | 289 JSExpect("$('supervised-user-creation-next-button').disabled"); |
290 JSSetTextField("#supervised-user-creation .manager-pod.focused input", | 290 JSSetTextField("#supervised-user-creation .manager-pod.focused input", |
291 kTestManagerPassword); | 291 kTestManagerPassword); |
292 | 292 |
293 JSEval("$('supervised-user-creation').updateNextButtonForManager_()"); | 293 JSEval("$('supervised-user-creation').updateNextButtonForManager_()"); |
294 | 294 |
295 // Next button is now enabled. | 295 // Next button is now enabled. |
296 JSExpect("!$('supervised-user-creation-next-button').disabled"); | 296 JSExpect("!$('supervised-user-creation-next-button').disabled"); |
297 UserContext user_context(AccountId::FromUserEmail(kTestManager)); | 297 UserContext user_context(AccountId::FromUserEmailGaiaId( |
| 298 kTestManager, GetGaiaIDForUserID(kTestManager))); |
298 user_context.SetGaiaID(GetGaiaIDForUserID(kTestManager)); | 299 user_context.SetGaiaID(GetGaiaIDForUserID(kTestManager)); |
299 user_context.SetKey(Key(kTestManagerPassword)); | 300 user_context.SetKey(Key(kTestManagerPassword)); |
300 SetExpectedCredentials(user_context); | 301 SetExpectedCredentials(user_context); |
301 content::WindowedNotificationObserver login_observer( | 302 content::WindowedNotificationObserver login_observer( |
302 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 303 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
303 content::NotificationService::AllSources()); | 304 content::NotificationService::AllSources()); |
304 | 305 |
305 // Log in as manager. | 306 // Log in as manager. |
306 JSEval("$('supervised-user-creation-next-button').click()"); | 307 JSEval("$('supervised-user-creation-next-button').click()"); |
307 login_observer.Wait(); | 308 login_observer.Wait(); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 JSEval(StringPrintf( | 441 JSEval(StringPrintf( |
441 "$('pod-row').pods[%d].querySelector('.remove-warning-button').click()", | 442 "$('pod-row').pods[%d].querySelector('.remove-warning-button').click()", |
442 user_index)); | 443 user_index)); |
443 | 444 |
444 // Make sure there is no supervised user in list. | 445 // Make sure there is no supervised user in list. |
445 ASSERT_EQ(original_user_count - 1, | 446 ASSERT_EQ(original_user_count - 1, |
446 user_manager::UserManager::Get()->GetUsers().size()); | 447 user_manager::UserManager::Get()->GetUsers().size()); |
447 } | 448 } |
448 | 449 |
449 } // namespace chromeos | 450 } // namespace chromeos |
OLD | NEW |