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

Side by Side Diff: services/preferences/pref_store_consistency_unittest.cc

Issue 2905903002: Delete the PreferenceMACs on profile deletion. (Closed)
Patch Set: Update comments Created 3 years, 4 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 <utility> 5 #include <utility>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 const std::vector<std::string>& path) override { 149 const std::vector<std::string>& path) override {
150 writes_.push_back({std::vector<mojom::PrefUpdatePtr>(), {key, path}}); 150 writes_.push_back({std::vector<mojom::PrefUpdatePtr>(), {key, path}});
151 if (writes_.size() == expected_writes_) { 151 if (writes_.size() == expected_writes_) {
152 expected_writes_ = 0; 152 expected_writes_ = 0;
153 std::move(stop_).Run(); 153 std::move(stop_).Run();
154 } 154 }
155 } 155 }
156 void CommitPendingWrite(base::OnceClosure) override {} 156 void CommitPendingWrite(base::OnceClosure) override {}
157 void SchedulePendingLossyWrites() override {} 157 void SchedulePendingLossyWrites() override {}
158 void ClearMutableValues() override {} 158 void ClearMutableValues() override {}
159 void OnStoreDeletionFromDisk() override {}
159 160
160 // mojom::PrefStoreObserver 161 // mojom::PrefStoreObserver
161 void OnPrefsChanged(std::vector<mojom::PrefUpdatePtr> updates) override { 162 void OnPrefsChanged(std::vector<mojom::PrefUpdatePtr> updates) override {
162 updates_.push_back({std::move(updates), false}); 163 updates_.push_back({std::move(updates), false});
163 if (updates_.size() == expected_updates_) { 164 if (updates_.size() == expected_updates_) {
164 expected_updates_ = 0; 165 expected_updates_ = 0;
165 std::move(stop_).Run(); 166 std::move(stop_).Run();
166 } 167 }
167 } 168 }
168 void OnInitializationCompleted(bool succeeded) override { NOTREACHED(); } 169 void OnInitializationCompleted(bool succeeded) override { NOTREACHED(); }
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 908
908 connection2->ForwardUpdates(1); 909 connection2->ForwardUpdates(1);
909 EXPECT_EQ(empty_dict, *pref_service2.GetDictionary(kDictionaryKey)); 910 EXPECT_EQ(empty_dict, *pref_service2.GetDictionary(kDictionaryKey));
910 911
911 connection2->ForwardUpdates(1); 912 connection2->ForwardUpdates(1);
912 EXPECT_EQ(empty_dict, *pref_service2.GetDictionary(kDictionaryKey)); 913 EXPECT_EQ(empty_dict, *pref_service2.GetDictionary(kDictionaryKey));
913 } 914 }
914 915
915 } // namespace 916 } // namespace
916 } // namespace prefs 917 } // namespace prefs
OLDNEW
« no previous file with comments | « services/preferences/persistent_pref_store_impl.cc ('k') | services/preferences/public/cpp/persistent_pref_store_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698