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 "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 "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 7 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
8 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 8 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
9 #include "chrome/browser/chromeos/settings/cros_settings.h" | 9 #include "chrome/browser/chromeos/settings/cros_settings.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 MarkAsEnterpriseOwned(); | 28 MarkAsEnterpriseOwned(); |
29 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); | 29 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); |
30 } | 30 } |
31 }; | 31 }; |
32 | 32 |
33 IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, DisableSupervisedUsers) { | 33 IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, DisableSupervisedUsers) { |
34 EXPECT_FALSE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed()); | 34 EXPECT_FALSE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed()); |
35 | 35 |
36 scoped_refptr<content::MessageLoopRunner> runner( | 36 scoped_refptr<content::MessageLoopRunner> runner( |
37 new content::MessageLoopRunner); | 37 new content::MessageLoopRunner); |
38 scoped_ptr<CrosSettings::ObserverSubscription> subscription( | 38 std::unique_ptr<CrosSettings::ObserverSubscription> subscription( |
39 chromeos::CrosSettings::Get()->AddSettingsObserver( | 39 chromeos::CrosSettings::Get()->AddSettingsObserver( |
40 chromeos::kAccountsPrefSupervisedUsersEnabled, | 40 chromeos::kAccountsPrefSupervisedUsersEnabled, |
41 runner->QuitClosure())); | 41 runner->QuitClosure())); |
42 | 42 |
43 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | 43 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); |
44 proto.mutable_supervised_users_settings()->set_supervised_users_enabled(true); | 44 proto.mutable_supervised_users_settings()->set_supervised_users_enabled(true); |
45 RefreshDevicePolicy(); | 45 RefreshDevicePolicy(); |
46 | 46 |
47 runner->Run(); | 47 runner->Run(); |
48 | 48 |
49 EXPECT_TRUE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed()); | 49 EXPECT_TRUE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed()); |
50 } | 50 } |
51 | 51 |
52 } // namespace chromeos | 52 } // namespace chromeos |
OLD | NEW |