| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/prefs/testing_pref_store.h" | 9 #include "base/prefs/testing_pref_store.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 EXPECT_FALSE(initialization_completed_); | 65 EXPECT_FALSE(initialization_completed_); |
| 66 EXPECT_TRUE(succeeded); | 66 EXPECT_TRUE(succeeded); |
| 67 EXPECT_TRUE(pref_store_->IsInitializationComplete()); | 67 EXPECT_TRUE(pref_store_->IsInitializationComplete()); |
| 68 initialization_completed_ = true; | 68 initialization_completed_ = true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace | 71 } // namespace |
| 72 | 72 |
| 73 class SupervisedUserPrefStoreTest : public ::testing::Test { | 73 class SupervisedUserPrefStoreTest : public ::testing::Test { |
| 74 public: | 74 public: |
| 75 virtual void SetUp() override; | 75 void SetUp() override; |
| 76 virtual void TearDown() override; | 76 void TearDown() override; |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 SupervisedUserSettingsService service_; | 79 SupervisedUserSettingsService service_; |
| 80 scoped_refptr<TestingPrefStore> pref_store_; | 80 scoped_refptr<TestingPrefStore> pref_store_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 void SupervisedUserPrefStoreTest::SetUp() { | 83 void SupervisedUserPrefStoreTest::SetUp() { |
| 84 pref_store_ = new TestingPrefStore(); | 84 pref_store_ = new TestingPrefStore(); |
| 85 service_.Init(pref_store_); | 85 service_.Init(pref_store_); |
| 86 } | 86 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 TEST_F(SupervisedUserPrefStoreTest, CreatePrefStoreAfterInitialization) { | 163 TEST_F(SupervisedUserPrefStoreTest, CreatePrefStoreAfterInitialization) { |
| 164 pref_store_->SetInitializationCompleted(); | 164 pref_store_->SetInitializationCompleted(); |
| 165 service_.SetActive(true); | 165 service_.SetActive(true); |
| 166 | 166 |
| 167 SupervisedUserPrefStoreFixture fixture(&service_); | 167 SupervisedUserPrefStoreFixture fixture(&service_); |
| 168 EXPECT_TRUE(fixture.initialization_completed()); | 168 EXPECT_TRUE(fixture.initialization_completed()); |
| 169 EXPECT_EQ(0u, fixture.changed_prefs()->size()); | 169 EXPECT_EQ(0u, fixture.changed_prefs()->size()); |
| 170 } | 170 } |
| 171 | 171 |
| OLD | NEW |