| 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/extensions/api/storage/policy_value_store.h" | 5 #include "chrome/browser/extensions/api/storage/policy_value_store.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 : file_thread_(content::BrowserThread::FILE, &loop_) {} | 97 : file_thread_(content::BrowserThread::FILE, &loop_) {} |
| 98 ~PolicyValueStoreTest() override {} | 98 ~PolicyValueStoreTest() override {} |
| 99 | 99 |
| 100 void SetUp() override { | 100 void SetUp() override { |
| 101 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 101 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 102 observers_ = new SettingsObserverList(); | 102 observers_ = new SettingsObserverList(); |
| 103 observers_->AddObserver(&observer_); | 103 observers_->AddObserver(&observer_); |
| 104 store_.reset(new PolicyValueStore( | 104 store_.reset(new PolicyValueStore( |
| 105 kTestExtensionId, observers_, | 105 kTestExtensionId, observers_, |
| 106 base::MakeUnique<LeveldbValueStore>(kDatabaseUMAClientName, | 106 base::MakeUnique<LeveldbValueStore>(kDatabaseUMAClientName, |
| 107 scoped_temp_dir_.path()))); | 107 scoped_temp_dir_.GetPath()))); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void TearDown() override { | 110 void TearDown() override { |
| 111 observers_->RemoveObserver(&observer_); | 111 observers_->RemoveObserver(&observer_); |
| 112 store_.reset(); | 112 store_.reset(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 base::ScopedTempDir scoped_temp_dir_; | 116 base::ScopedTempDir scoped_temp_dir_; |
| 117 base::MessageLoop loop_; | 117 base::MessageLoop loop_; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 Mock::VerifyAndClearExpectations(&observer_); | 228 Mock::VerifyAndClearExpectations(&observer_); |
| 229 | 229 |
| 230 // Don't notify when there aren't any changes. | 230 // Don't notify when there aren't any changes. |
| 231 EXPECT_CALL(observer_, OnSettingsChanged(_, _, _)).Times(0); | 231 EXPECT_CALL(observer_, OnSettingsChanged(_, _, _)).Times(0); |
| 232 store_->SetCurrentPolicy(policies); | 232 store_->SetCurrentPolicy(policies); |
| 233 base::RunLoop().RunUntilIdle(); | 233 base::RunLoop().RunUntilIdle(); |
| 234 Mock::VerifyAndClearExpectations(&observer_); | 234 Mock::VerifyAndClearExpectations(&observer_); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace extensions | 237 } // namespace extensions |
| OLD | NEW |