| Index: chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
|
| index 8467736feb80f2ab41fc0a3fedb099c6b429d5d2..2829d21af8113585b63e15bc8223b3687f026e45 100644
|
| --- a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
|
| +++ b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
|
| @@ -3,7 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/command_line.h"
|
| -#include "chrome/browser/chrome_notification_types.h"
|
| +#include "base/memory/ref_counted.h"
|
| #include "chrome/browser/chromeos/login/user_manager.h"
|
| #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
|
| #include "chrome/browser/chromeos/settings/cros_settings.h"
|
| @@ -11,8 +11,6 @@
|
| #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chromeos/chromeos_switches.h"
|
| -#include "content/public/browser/notification_service.h"
|
| -#include "content/public/test/mock_notification_observer.h"
|
| #include "content/public/test/test_utils.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -37,20 +35,20 @@ class LoginScreenPolicyTest : public policy::DevicePolicyCrosBrowserTest {
|
| IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, DisableSupervisedUsers) {
|
| EXPECT_FALSE(chromeos::UserManager::Get()->AreLocallyManagedUsersAllowed());
|
|
|
| - content::WindowedNotificationObserver windowed_observer(
|
| - chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED,
|
| - content::NotificationService::AllSources());
|
| - chromeos::CrosSettings::Get()->AddSettingsObserver(
|
| - chromeos::kAccountsPrefSupervisedUsersEnabled, &windowed_observer);
|
| + scoped_refptr<content::MessageLoopRunner> runner(
|
| + new content::MessageLoopRunner);
|
| + scoped_ptr<CrosSettings::ObserverSubscription> subscription(
|
| + chromeos::CrosSettings::Get()->AddSettingsObserver(
|
| + chromeos::kAccountsPrefSupervisedUsersEnabled,
|
| + runner->QuitClosure()));
|
| +
|
| em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
|
| proto.mutable_supervised_users_settings()->set_supervised_users_enabled(true);
|
| RefreshDevicePolicy();
|
| - windowed_observer.Wait();
|
|
|
| - EXPECT_TRUE(chromeos::UserManager::Get()->AreLocallyManagedUsersAllowed());
|
| + runner->Run();
|
|
|
| - chromeos::CrosSettings::Get()->RemoveSettingsObserver(
|
| - chromeos::kAccountsPrefSupervisedUsersEnabled, &windowed_observer);
|
| + EXPECT_TRUE(chromeos::UserManager::Get()->AreLocallyManagedUsersAllowed());
|
| }
|
|
|
| } // namespace chromeos
|
|
|