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

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

Issue 2905903002: Delete the PreferenceMACs on profile deletion. (Closed)
Patch Set: Fix to get OSX-only ActiveProfileDeletedNextProfileDeletedToo test to pass Created 3 years, 5 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // PrefFilter implementation: 76 // PrefFilter implementation:
77 void FilterOnLoad( 77 void FilterOnLoad(
78 const PostFilterOnLoadCallback& post_filter_on_load_callback, 78 const PostFilterOnLoadCallback& post_filter_on_load_callback,
79 std::unique_ptr<base::DictionaryValue> pref_store_contents) override; 79 std::unique_ptr<base::DictionaryValue> pref_store_contents) override;
80 void FilterUpdate(const std::string& path) override {} 80 void FilterUpdate(const std::string& path) override {}
81 OnWriteCallbackPair FilterSerializeData( 81 OnWriteCallbackPair FilterSerializeData(
82 base::DictionaryValue* pref_store_contents) override { 82 base::DictionaryValue* pref_store_contents) override {
83 return on_write_callback_pair_; 83 return on_write_callback_pair_;
84 } 84 }
85 void OnStoreDeletionFromDisk() override {}
85 86
86 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; } 87 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; }
87 88
88 // Finalize an intercepted read, handing |intercepted_prefs_| back to its 89 // Finalize an intercepted read, handing |intercepted_prefs_| back to its
89 // JsonPrefStore. 90 // JsonPrefStore.
90 void ReleasePrefs(); 91 void ReleasePrefs();
91 92
92 private: 93 private:
93 PostFilterOnLoadCallback post_filter_on_load_callback_; 94 PostFilterOnLoadCallback post_filter_on_load_callback_;
94 std::unique_ptr<base::DictionaryValue> intercepted_prefs_; 95 std::unique_ptr<base::DictionaryValue> intercepted_prefs_;
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 file_writer->WriteNow(MakeUnique<std::string>("foo")); 1081 file_writer->WriteNow(MakeUnique<std::string>("foo"));
1081 } 1082 }
1082 scoped_task_environment_.RunUntilIdle(); 1083 scoped_task_environment_.RunUntilIdle();
1083 EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState()); 1084 EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState());
1084 EXPECT_TRUE(write_callback_observer_.GetAndResetPreWriteObservationState()); 1085 EXPECT_TRUE(write_callback_observer_.GetAndResetPreWriteObservationState());
1085 EXPECT_EQ(CALLED_WITH_SUCCESS, 1086 EXPECT_EQ(CALLED_WITH_SUCCESS,
1086 write_callback_observer_.GetAndResetPostWriteObservationState()); 1087 write_callback_observer_.GetAndResetPostWriteObservationState());
1087 } 1088 }
1088 1089
1089 } // namespace base 1090 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698