OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/settings/device_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 class DeviceSettingsProviderTest : public DeviceSettingsTestBase { | 37 class DeviceSettingsProviderTest : public DeviceSettingsTestBase { |
38 public: | 38 public: |
39 MOCK_METHOD1(SettingChanged, void(const std::string&)); | 39 MOCK_METHOD1(SettingChanged, void(const std::string&)); |
40 MOCK_METHOD0(GetTrustedCallback, void(void)); | 40 MOCK_METHOD0(GetTrustedCallback, void(void)); |
41 | 41 |
42 protected: | 42 protected: |
43 DeviceSettingsProviderTest() | 43 DeviceSettingsProviderTest() |
44 : local_state_(TestingBrowserProcess::GetGlobal()), | 44 : local_state_(TestingBrowserProcess::GetGlobal()), |
45 user_data_dir_override_(chrome::DIR_USER_DATA) {} | 45 user_data_dir_override_(chrome::DIR_USER_DATA) {} |
46 | 46 |
47 virtual void SetUp() OVERRIDE { | 47 virtual void SetUp() override { |
48 DeviceSettingsTestBase::SetUp(); | 48 DeviceSettingsTestBase::SetUp(); |
49 | 49 |
50 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber()); | 50 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber()); |
51 provider_.reset( | 51 provider_.reset( |
52 new DeviceSettingsProvider( | 52 new DeviceSettingsProvider( |
53 base::Bind(&DeviceSettingsProviderTest::SettingChanged, | 53 base::Bind(&DeviceSettingsProviderTest::SettingChanged, |
54 base::Unretained(this)), | 54 base::Unretained(this)), |
55 &device_settings_service_)); | 55 &device_settings_service_)); |
56 Mock::VerifyAndClearExpectations(this); | 56 Mock::VerifyAndClearExpectations(this); |
57 } | 57 } |
58 | 58 |
59 virtual void TearDown() OVERRIDE { | 59 virtual void TearDown() override { |
60 DeviceSettingsTestBase::TearDown(); | 60 DeviceSettingsTestBase::TearDown(); |
61 } | 61 } |
62 | 62 |
63 ScopedTestingLocalState local_state_; | 63 ScopedTestingLocalState local_state_; |
64 | 64 |
65 scoped_ptr<DeviceSettingsProvider> provider_; | 65 scoped_ptr<DeviceSettingsProvider> provider_; |
66 | 66 |
67 base::ScopedPathOverride user_data_dir_override_; | 67 base::ScopedPathOverride user_data_dir_override_; |
68 | 68 |
69 private: | 69 private: |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 policy::PolicyBuilder::kFakeUsername); | 282 policy::PolicyBuilder::kFakeUsername); |
283 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType, | 283 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType, |
284 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); | 284 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); |
285 expected_accounts.Append(entry_dict.release()); | 285 expected_accounts.Append(entry_dict.release()); |
286 const base::Value* actual_accounts = | 286 const base::Value* actual_accounts = |
287 provider_->Get(kAccountsPrefDeviceLocalAccounts); | 287 provider_->Get(kAccountsPrefDeviceLocalAccounts); |
288 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts)); | 288 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts)); |
289 } | 289 } |
290 | 290 |
291 } // namespace chromeos | 291 } // namespace chromeos |
OLD | NEW |