| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 void TearDown() override { | 84 void TearDown() override { |
| 85 ResetController(); | 85 ResetController(); |
| 86 MessageCenterSettingsControllerBaseTest::TearDown(); | 86 MessageCenterSettingsControllerBaseTest::TearDown(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 TestingProfile* CreateProfile(const std::string& name) override { | 89 TestingProfile* CreateProfile(const std::string& name) override { |
| 90 TestingProfile* profile = | 90 TestingProfile* profile = |
| 91 MessageCenterSettingsControllerBaseTest::CreateProfile(name); | 91 MessageCenterSettingsControllerBaseTest::CreateProfile(name); |
| 92 | 92 |
| 93 GetFakeUserManager()->AddUser(name); | 93 GetFakeUserManager()->AddUser(AccountId::FromUserEmail(name)); |
| 94 GetFakeUserManager()->LoginUser(name); | 94 GetFakeUserManager()->LoginUser(AccountId::FromUserEmail(name)); |
| 95 return profile; | 95 return profile; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void SwitchActiveUser(const std::string& name) { | 98 void SwitchActiveUser(const std::string& name) { |
| 99 GetFakeUserManager()->SwitchActiveUser(name); | 99 GetFakeUserManager()->SwitchActiveUser(AccountId::FromUserEmail(name)); |
| 100 controller()->ActiveUserChanged(GetFakeUserManager()->GetActiveUser()); | 100 controller()->ActiveUserChanged(GetFakeUserManager()->GetActiveUser()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 chromeos::FakeChromeUserManager* GetFakeUserManager() { | 104 chromeos::FakeChromeUserManager* GetFakeUserManager() { |
| 105 return static_cast<chromeos::FakeChromeUserManager*>( | 105 return static_cast<chromeos::FakeChromeUserManager*>( |
| 106 user_manager::UserManager::Get()); | 106 user_manager::UserManager::Get()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 109 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 // (5) Enable the permission when the default is blocked (expected to set). | 334 // (5) Enable the permission when the default is blocked (expected to set). |
| 335 controller()->SetNotifierEnabled(disabled_notifier, true); | 335 controller()->SetNotifierEnabled(disabled_notifier, true); |
| 336 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 336 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 337 DesktopNotificationProfileUtil::GetContentSetting(profile, origin)); | 337 DesktopNotificationProfileUtil::GetContentSetting(profile, origin)); |
| 338 | 338 |
| 339 // (6) Disable the permission when the default is blocked (expected to clear). | 339 // (6) Disable the permission when the default is blocked (expected to clear). |
| 340 controller()->SetNotifierEnabled(enabled_notifier, false); | 340 controller()->SetNotifierEnabled(enabled_notifier, false); |
| 341 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 341 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 342 DesktopNotificationProfileUtil::GetContentSetting(profile, origin)); | 342 DesktopNotificationProfileUtil::GetContentSetting(profile, origin)); |
| 343 } | 343 } |
| OLD | NEW |