| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/policy/device_local_account.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "chrome/browser/chrome_notification_types.h" | 44 #include "chrome/browser/chrome_notification_types.h" |
| 45 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic
y_loader.h" | 45 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic
y_loader.h" |
| 46 #include "chrome/browser/chromeos/extensions/external_cache.h" | 46 #include "chrome/browser/chromeos/extensions/external_cache.h" |
| 47 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 47 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 48 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 48 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 49 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 49 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| 50 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 50 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 51 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h" | 51 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h" |
| 52 #include "chrome/browser/chromeos/login/signin_specifics.h" | 52 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 53 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 53 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 54 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | |
| 55 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 54 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 56 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" | 55 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" |
| 57 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" | 56 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
| 58 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_test_uti
l.h" | 57 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_test_uti
l.h" |
| 59 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" | 58 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
| 60 #include "chrome/browser/chromeos/login/wizard_controller.h" | 59 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 61 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 60 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 62 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u
til.h" | 61 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u
til.h" |
| 63 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 62 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 64 #include "chrome/browser/chromeos/policy/device_policy_builder.h" | 63 #include "chrome/browser/chromeos/policy/device_policy_builder.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 void SetUpOnMainThread() override { | 469 void SetUpOnMainThread() override { |
| 471 DevicePolicyCrosBrowserTest::SetUpOnMainThread(); | 470 DevicePolicyCrosBrowserTest::SetUpOnMainThread(); |
| 472 | 471 |
| 473 initial_locale_ = g_browser_process->GetApplicationLocale(); | 472 initial_locale_ = g_browser_process->GetApplicationLocale(); |
| 474 initial_language_ = l10n_util::GetLanguage(initial_locale_); | 473 initial_language_ = l10n_util::GetLanguage(initial_locale_); |
| 475 | 474 |
| 476 content::WindowedNotificationObserver( | 475 content::WindowedNotificationObserver( |
| 477 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 476 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
| 478 content::NotificationService::AllSources()).Wait(); | 477 content::NotificationService::AllSources()).Wait(); |
| 479 | 478 |
| 480 chromeos::LoginDisplayHostImpl* host = | 479 chromeos::LoginDisplayHost* host = |
| 481 reinterpret_cast<chromeos::LoginDisplayHostImpl*>( | 480 chromeos::LoginDisplayHost::default_host(); |
| 482 chromeos::LoginDisplayHostImpl::default_host()); | |
| 483 ASSERT_TRUE(host); | 481 ASSERT_TRUE(host); |
| 484 chromeos::WebUILoginView* web_ui_login_view = host->GetWebUILoginView(); | 482 chromeos::WebUILoginView* web_ui_login_view = host->GetWebUILoginView(); |
| 485 ASSERT_TRUE(web_ui_login_view); | 483 ASSERT_TRUE(web_ui_login_view); |
| 486 content::WebUI* web_ui = web_ui_login_view->GetWebUI(); | 484 content::WebUI* web_ui = web_ui_login_view->GetWebUI(); |
| 487 ASSERT_TRUE(web_ui); | 485 ASSERT_TRUE(web_ui); |
| 488 contents_ = web_ui->GetWebContents(); | 486 contents_ = web_ui->GetWebContents(); |
| 489 ASSERT_TRUE(contents_); | 487 ASSERT_TRUE(contents_); |
| 490 | 488 |
| 491 // Wait for the login UI to be ready. | 489 // Wait for the login UI to be ready. |
| 492 chromeos::OobeUI* oobe_ui = host->GetOobeUI(); | 490 chromeos::OobeUI* oobe_ui = host->GetOobeUI(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 base::RunLoop().RunUntilIdle(); | 715 base::RunLoop().RunUntilIdle(); |
| 718 | 716 |
| 719 // Verify that the construction of the keyboard layout list did not affect | 717 // Verify that the construction of the keyboard layout list did not affect |
| 720 // the current ICU locale. | 718 // the current ICU locale. |
| 721 EXPECT_EQ(initial_language_, icu::Locale::getDefault().getLanguage()); | 719 EXPECT_EQ(initial_language_, icu::Locale::getDefault().getLanguage()); |
| 722 } | 720 } |
| 723 | 721 |
| 724 void StartLogin(const std::string& locale, | 722 void StartLogin(const std::string& locale, |
| 725 const std::string& input_method) { | 723 const std::string& input_method) { |
| 726 // Start login into the device-local account. | 724 // Start login into the device-local account. |
| 727 chromeos::LoginDisplayHostImpl* host = | 725 chromeos::LoginDisplayHost* host = |
| 728 reinterpret_cast<chromeos::LoginDisplayHostImpl*>( | 726 chromeos::LoginDisplayHost::default_host(); |
| 729 chromeos::LoginDisplayHostImpl::default_host()); | |
| 730 ASSERT_TRUE(host); | 727 ASSERT_TRUE(host); |
| 731 host->StartSignInScreen(LoginScreenContext()); | 728 host->StartSignInScreen(LoginScreenContext()); |
| 732 chromeos::ExistingUserController* controller = | 729 chromeos::ExistingUserController* controller = |
| 733 chromeos::ExistingUserController::current_controller(); | 730 chromeos::ExistingUserController::current_controller(); |
| 734 ASSERT_TRUE(controller); | 731 ASSERT_TRUE(controller); |
| 735 | 732 |
| 736 chromeos::UserContext user_context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, | 733 chromeos::UserContext user_context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, |
| 737 account_id_1_.GetUserEmail()); | 734 account_id_1_.GetUserEmail()); |
| 738 user_context.SetPublicSessionLocale(locale); | 735 user_context.SetPublicSessionLocale(locale); |
| 739 user_context.SetPublicSessionInputMethod(input_method); | 736 user_context.SetPublicSessionInputMethod(input_method); |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 ASSERT_TRUE(content::ExecuteScript(contents_, | 2434 ASSERT_TRUE(content::ExecuteScript(contents_, |
| 2438 "$('tos-accept-button').click();")); | 2435 "$('tos-accept-button').click();")); |
| 2439 | 2436 |
| 2440 WaitForSessionStart(); | 2437 WaitForSessionStart(); |
| 2441 } | 2438 } |
| 2442 | 2439 |
| 2443 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, | 2440 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, |
| 2444 TermsOfServiceDownloadTest, testing::Bool()); | 2441 TermsOfServiceDownloadTest, testing::Bool()); |
| 2445 | 2442 |
| 2446 } // namespace policy | 2443 } // namespace policy |
| OLD | NEW |