| 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/stub_cros_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/stub_cros_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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 protected: | 27 protected: |
| 28 StubCrosSettingsProviderTest() | 28 StubCrosSettingsProviderTest() |
| 29 : provider_(new StubCrosSettingsProvider( | 29 : provider_(new StubCrosSettingsProvider( |
| 30 base::Bind(&StubCrosSettingsProviderTest::FireObservers, | 30 base::Bind(&StubCrosSettingsProviderTest::FireObservers, |
| 31 base::Unretained(this)))) { | 31 base::Unretained(this)))) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual ~StubCrosSettingsProviderTest() { | 34 virtual ~StubCrosSettingsProviderTest() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual void SetUp() OVERRIDE { | 37 virtual void SetUp() override { |
| 38 // Reset the observer notification count. | 38 // Reset the observer notification count. |
| 39 observer_count_.clear(); | 39 observer_count_.clear(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void AssertPref(const std::string& prefName, const base::Value* value) { | 42 void AssertPref(const std::string& prefName, const base::Value* value) { |
| 43 const base::Value* pref = provider_->Get(prefName); | 43 const base::Value* pref = provider_->Get(prefName); |
| 44 ASSERT_TRUE(pref); | 44 ASSERT_TRUE(pref); |
| 45 ASSERT_TRUE(pref->Equals(value)); | 45 ASSERT_TRUE(pref->Equals(value)); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 TEST_F(StubCrosSettingsProviderTest, PrepareTrustedValues) { | 92 TEST_F(StubCrosSettingsProviderTest, PrepareTrustedValues) { |
| 93 // Should return immediately without invoking the callback. | 93 // Should return immediately without invoking the callback. |
| 94 CrosSettingsProvider::TrustedStatus trusted = | 94 CrosSettingsProvider::TrustedStatus trusted = |
| 95 provider_->PrepareTrustedValues(base::Bind(&Fail)); | 95 provider_->PrepareTrustedValues(base::Bind(&Fail)); |
| 96 EXPECT_EQ(CrosSettingsProvider::TRUSTED, trusted); | 96 EXPECT_EQ(CrosSettingsProvider::TRUSTED, trusted); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace chromeos | 99 } // namespace chromeos |
| OLD | NEW |