Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: components/prefs/json_pref_store_unittest.cc

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply fixes from #10 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/prefs/json_pref_store.h" 5 #include "components/prefs/json_pref_store.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 class InterceptingPrefFilter : public PrefFilter { 69 class InterceptingPrefFilter : public PrefFilter {
70 public: 70 public:
71 InterceptingPrefFilter(); 71 InterceptingPrefFilter();
72 ~InterceptingPrefFilter() override; 72 ~InterceptingPrefFilter() override;
73 73
74 // PrefFilter implementation: 74 // PrefFilter implementation:
75 void FilterOnLoad( 75 void FilterOnLoad(
76 const PostFilterOnLoadCallback& post_filter_on_load_callback, 76 const PostFilterOnLoadCallback& post_filter_on_load_callback,
77 std::unique_ptr<base::DictionaryValue> pref_store_contents) override; 77 std::unique_ptr<base::DictionaryValue> pref_store_contents) override;
78 void FilterUpdate(const std::string& path) override {} 78 void FilterUpdate(const std::string& path) override {}
79 void FilterSerializeData( 79 base::Callback<void(bool)> FilterSerializeData(
80 base::DictionaryValue* pref_store_contents) override {} 80 base::DictionaryValue* pref_store_contents) override {
81 return base::Callback<void(bool)>();
82 }
81 83
82 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; } 84 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; }
83 85
84 // Finalize an intercepted read, handing |intercepted_prefs_| back to its 86 // Finalize an intercepted read, handing |intercepted_prefs_| back to its
85 // JsonPrefStore. 87 // JsonPrefStore.
86 void ReleasePrefs(); 88 void ReleasePrefs();
87 89
88 private: 90 private:
89 PostFilterOnLoadCallback post_filter_on_load_callback_; 91 PostFilterOnLoadCallback post_filter_on_load_callback_;
90 std::unique_ptr<base::DictionaryValue> intercepted_prefs_; 92 std::unique_ptr<base::DictionaryValue> intercepted_prefs_;
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 write_callback_observer_.ObserveNextWriteCallback( 1171 write_callback_observer_.ObserveNextWriteCallback(
1170 soon_out_of_scope_pref_store.get()); 1172 soon_out_of_scope_pref_store.get());
1171 file_writer->WriteNow(MakeUnique<std::string>("foo")); 1173 file_writer->WriteNow(MakeUnique<std::string>("foo"));
1172 } 1174 }
1173 RunLoop().RunUntilIdle(); 1175 RunLoop().RunUntilIdle();
1174 EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState()); 1176 EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState());
1175 EXPECT_EQ(CALLED_WITH_SUCCESS, 1177 EXPECT_EQ(CALLED_WITH_SUCCESS,
1176 write_callback_observer_.GetAndResetObservationState()); 1178 write_callback_observer_.GetAndResetObservationState());
1177 } 1179 }
1178 1180
1179 } // namespace base 1181 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698