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

Side by Side Diff: components/user_prefs/tracked/tracked_preferences_migration_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 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 "components/user_prefs/tracked/tracked_preferences_migration.h" 5 #include "components/user_prefs/tracked/tracked_preferences_migration.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 29 matching lines...) Expand all
40 const char kProtectedPrefValue[] = "protected_value"; 40 const char kProtectedPrefValue[] = "protected_value";
41 const char kPreviouslyUnprotectedPrefValue[] = "previously_unprotected_value"; 41 const char kPreviouslyUnprotectedPrefValue[] = "previously_unprotected_value";
42 const char kPreviouslyProtectedPrefValue[] = "previously_protected_value"; 42 const char kPreviouslyProtectedPrefValue[] = "previously_protected_value";
43 43
44 // A simple InterceptablePrefFilter which doesn't do anything but hand the prefs 44 // A simple InterceptablePrefFilter which doesn't do anything but hand the prefs
45 // back downstream in FinalizeFilterOnLoad. 45 // back downstream in FinalizeFilterOnLoad.
46 class SimpleInterceptablePrefFilter : public InterceptablePrefFilter { 46 class SimpleInterceptablePrefFilter : public InterceptablePrefFilter {
47 public: 47 public:
48 // PrefFilter remaining implementation. 48 // PrefFilter remaining implementation.
49 void FilterUpdate(const std::string& path) override { ADD_FAILURE(); } 49 void FilterUpdate(const std::string& path) override { ADD_FAILURE(); }
50 void FilterSerializeData( 50 base::Callback<void(bool)> FilterSerializeData(
51 base::DictionaryValue* pref_store_contents) override { 51 base::DictionaryValue* pref_store_contents) override {
52 ADD_FAILURE(); 52 ADD_FAILURE();
53 return base::Callback<void(bool)>();
53 } 54 }
54 55
55 private: 56 private:
56 // InterceptablePrefFilter implementation. 57 // InterceptablePrefFilter implementation.
57 void FinalizeFilterOnLoad( 58 void FinalizeFilterOnLoad(
58 const PostFilterOnLoadCallback& post_filter_on_load_callback, 59 const PostFilterOnLoadCallback& post_filter_on_load_callback,
59 std::unique_ptr<base::DictionaryValue> pref_store_contents, 60 std::unique_ptr<base::DictionaryValue> pref_store_contents,
60 bool prefs_altered) override { 61 bool prefs_altered) override {
61 post_filter_on_load_callback.Run(std::move(pref_store_contents), 62 post_filter_on_load_callback.Run(std::move(pref_store_contents),
62 prefs_altered); 63 prefs_altered);
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 expected_unprotected_values); 645 expected_unprotected_values);
645 646
646 base::StringPairs expected_protected_values; 647 base::StringPairs expected_protected_values;
647 expected_protected_values.push_back(std::make_pair( 648 expected_protected_values.push_back(std::make_pair(
648 kProtectedPref, kProtectedPrefValue)); 649 kProtectedPref, kProtectedPrefValue));
649 expected_protected_values.push_back(std::make_pair( 650 expected_protected_values.push_back(std::make_pair(
650 kPreviouslyUnprotectedPref, kPreviouslyUnprotectedPrefValue)); 651 kPreviouslyUnprotectedPref, kPreviouslyUnprotectedPrefValue));
651 VerifyValuesStored(MOCK_PROTECTED_PREF_STORE, expected_protected_values); 652 VerifyValuesStored(MOCK_PROTECTED_PREF_STORE, expected_protected_values);
652 } 653 }
653 } 654 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698