| Index: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
|
| diff --git a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
|
| index c3dcd6efa41dae8ac656587166be77daf17e635f..b4994732910c39b7ce7f9a953efbc169fe51d559 100644
|
| --- a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
|
| +++ b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
|
| @@ -17,6 +17,7 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
| +#include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h"
|
| #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
|
| #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h"
|
| #include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| @@ -149,6 +150,9 @@ class CryptohomeAuthenticatorTest : public testing::Test {
|
| CreateTransformedKey(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF,
|
| SystemSaltGetter::ConvertRawSaltToHexString(
|
| FakeCryptohomeClient::GetStubSystemSalt()));
|
| +
|
| + owner_settings_service_.reset(
|
| + new chromeos::FakeOwnerSettingsService(&profile_, owner_key_util_));
|
| }
|
|
|
| ~CryptohomeAuthenticatorTest() override {}
|
| @@ -338,6 +342,7 @@ class CryptohomeAuthenticatorTest : public testing::Test {
|
| FakeCryptohomeClient* fake_cryptohome_client_;
|
|
|
| scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_;
|
| + scoped_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_;
|
|
|
| private:
|
| void InvokeGetDataExCallback(
|
| @@ -436,13 +441,13 @@ TEST_F(CryptohomeAuthenticatorTest, ResolveOwnerNeededFailedMount) {
|
| SetOwnerState(false, false);
|
| // Remove the real DeviceSettingsProvider and replace it with a stub.
|
| CrosSettingsProvider* device_settings_provider =
|
| - CrosSettings::Get()->GetProvider(chromeos::kReportDeviceVersionInfo);
|
| + CrosSettings::Get()->GetProvider(kPolicyMissingMitigationMode);
|
| EXPECT_TRUE(device_settings_provider != NULL);
|
| EXPECT_TRUE(
|
| CrosSettings::Get()->RemoveSettingsProvider(device_settings_provider));
|
| StubCrosSettingsProvider stub_settings_provider;
|
| CrosSettings::Get()->AddSettingsProvider(&stub_settings_provider);
|
| - CrosSettings::Get()->SetBoolean(kPolicyMissingMitigationMode, true);
|
| + owner_settings_service_->SetBoolean(kPolicyMissingMitigationMode, true);
|
|
|
| // Initialize login state for this test to verify the login state is changed
|
| // to SAFE_MODE.
|
| @@ -495,13 +500,13 @@ TEST_F(CryptohomeAuthenticatorTest, ResolveOwnerNeededSuccess) {
|
| SetOwnerState(false, false);
|
| // Remove the real DeviceSettingsProvider and replace it with a stub.
|
| CrosSettingsProvider* device_settings_provider =
|
| - CrosSettings::Get()->GetProvider(chromeos::kReportDeviceVersionInfo);
|
| + CrosSettings::Get()->GetProvider(kPolicyMissingMitigationMode);
|
| EXPECT_TRUE(device_settings_provider != NULL);
|
| EXPECT_TRUE(
|
| CrosSettings::Get()->RemoveSettingsProvider(device_settings_provider));
|
| StubCrosSettingsProvider stub_settings_provider;
|
| CrosSettings::Get()->AddSettingsProvider(&stub_settings_provider);
|
| - CrosSettings::Get()->SetBoolean(kPolicyMissingMitigationMode, true);
|
| + owner_settings_service_->SetBoolean(kPolicyMissingMitigationMode, true);
|
|
|
| // Initialize login state for this test to verify the login state is changed
|
| // to SAFE_MODE.
|
|
|