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 20 matching lines...) Expand all Loading... |
31 using ::testing::Mock; | 31 using ::testing::Mock; |
32 using ::testing::_; | 32 using ::testing::_; |
33 | 33 |
34 class DeviceSettingsProviderTest : public DeviceSettingsTestBase { | 34 class DeviceSettingsProviderTest : public DeviceSettingsTestBase { |
35 public: | 35 public: |
36 MOCK_METHOD1(SettingChanged, void(const std::string&)); | 36 MOCK_METHOD1(SettingChanged, void(const std::string&)); |
37 MOCK_METHOD0(GetTrustedCallback, void(void)); | 37 MOCK_METHOD0(GetTrustedCallback, void(void)); |
38 | 38 |
39 protected: | 39 protected: |
40 DeviceSettingsProviderTest() | 40 DeviceSettingsProviderTest() |
41 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), | 41 : local_state_(TestingBrowserProcess::GetGlobal()), |
42 user_data_dir_override_(chrome::DIR_USER_DATA) {} | 42 user_data_dir_override_(chrome::DIR_USER_DATA) {} |
43 | 43 |
44 virtual void SetUp() OVERRIDE { | 44 virtual void SetUp() OVERRIDE { |
45 DeviceSettingsTestBase::SetUp(); | 45 DeviceSettingsTestBase::SetUp(); |
46 | 46 |
47 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber()); | 47 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber()); |
48 provider_.reset( | 48 provider_.reset( |
49 new DeviceSettingsProvider( | 49 new DeviceSettingsProvider( |
50 base::Bind(&DeviceSettingsProviderTest::SettingChanged, | 50 base::Bind(&DeviceSettingsProviderTest::SettingChanged, |
51 base::Unretained(this)), | 51 base::Unretained(this)), |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 // Verify that migration has kicked in. | 258 // Verify that migration has kicked in. |
259 const base::Value* saved_value = provider_->Get(kStatsReportingPref); | 259 const base::Value* saved_value = provider_->Get(kStatsReportingPref); |
260 ASSERT_TRUE(saved_value); | 260 ASSERT_TRUE(saved_value); |
261 bool bool_value; | 261 bool bool_value; |
262 EXPECT_TRUE(saved_value->GetAsBoolean(&bool_value)); | 262 EXPECT_TRUE(saved_value->GetAsBoolean(&bool_value)); |
263 EXPECT_FALSE(bool_value); | 263 EXPECT_FALSE(bool_value); |
264 } | 264 } |
265 | 265 |
266 } // namespace chromeos | 266 } // namespace chromeos |
OLD | NEW |