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

Side by Side Diff: chrome/browser/chromeos/login/login_screen_policy_browsertest.cc

Issue 2816543004: Login screen IME policy does not apply in user session (Closed)
Patch Set: Improved browser tests further. Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/chromeos/login/startup_utils.h" 10 #include "chrome/browser/chromeos/login/startup_utils.h"
10 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 11 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
11 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 12 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
12 #include "chrome/browser/chromeos/settings/cros_settings.h" 13 #include "chrome/browser/chromeos/settings/cros_settings.h"
13 #include "chrome/browser/lifetime/application_lifetime.h" 14 #include "chrome/browser/lifetime/application_lifetime.h"
14 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
15 #include "chrome/test/base/ui_test_utils.h" 16 #include "chrome/test/base/ui_test_utils.h"
16 #include "chromeos/chromeos_switches.h" 17 #include "chromeos/chromeos_switches.h"
17 #include "chromeos/settings/cros_settings_names.h" 18 #include "chromeos/settings/cros_settings_names.h"
18 #include "components/user_manager/user_manager.h" 19 #include "components/user_manager/user_manager.h"
20 #include "content/public/browser/notification_service.h"
19 #include "testing/gmock/include/gmock/gmock.h" 21 #include "testing/gmock/include/gmock/gmock.h"
20 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/base/ime/chromeos/input_method_manager.h" 23 #include "ui/base/ime/chromeos/input_method_manager.h"
22 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
24 26
25 namespace em = enterprise_management; 27 namespace em = enterprise_management;
26 28
27 namespace chromeos { 29 namespace chromeos {
28 30
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 70
69 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 71 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
70 proto.mutable_supervised_users_settings()->set_supervised_users_enabled(true); 72 proto.mutable_supervised_users_settings()->set_supervised_users_enabled(true);
71 RefreshDevicePolicyAndWaitForSettingChange( 73 RefreshDevicePolicyAndWaitForSettingChange(
72 chromeos::kAccountsPrefSupervisedUsersEnabled); 74 chromeos::kAccountsPrefSupervisedUsersEnabled);
73 75
74 EXPECT_TRUE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed()); 76 EXPECT_TRUE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed());
75 } 77 }
76 78
77 IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, RestrictInputMethods) { 79 IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, RestrictInputMethods) {
80 content::WindowedNotificationObserver(
81 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
82 content::NotificationService::AllSources())
83 .Wait();
84
78 input_method::InputMethodManager* imm = 85 input_method::InputMethodManager* imm =
79 input_method::InputMethodManager::Get(); 86 input_method::InputMethodManager::Get();
80 ASSERT_TRUE(imm); 87 ASSERT_TRUE(imm);
81 88
82 ASSERT_EQ(0U, imm->GetActiveIMEState()->GetAllowedInputMethods().size()); 89 ASSERT_EQ(0U, imm->GetActiveIMEState()->GetAllowedInputMethods().size());
83 90
84 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 91 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
85 proto.mutable_login_screen_input_methods()->add_login_screen_input_methods( 92 proto.mutable_login_screen_input_methods()->add_login_screen_input_methods(
86 "xkb:de::ger"); 93 "xkb:de::ger");
87 RefreshDevicePolicyAndWaitForSettingChange( 94 RefreshDevicePolicyAndWaitForSettingChange(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Make sure this is really French and differs from the English title. 133 // Make sure this is really French and differs from the English title.
127 std::string loaded = 134 std::string loaded =
128 ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources("en-US"); 135 ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources("en-US");
129 EXPECT_EQ("en-US", loaded); 136 EXPECT_EQ("en-US", loaded);
130 base::string16 english_title = 137 base::string16 english_title =
131 l10n_util::GetStringUTF16(IDS_LOGIN_POD_SIGNING_IN); 138 l10n_util::GetStringUTF16(IDS_LOGIN_POD_SIGNING_IN);
132 EXPECT_NE(french_title, english_title); 139 EXPECT_NE(french_title, english_title);
133 } 140 }
134 141
135 } // namespace chromeos 142 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698