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

Side by Side Diff: chrome/browser/prefs/profile_pref_store_manager_unittest.cc

Issue 271793003: components: Extract pref_registry component out of user_prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make translate_core_browser depends on pref_registry Created 6 years, 7 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 | Annotate | Revision Log
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 "chrome/browser/prefs/profile_pref_store_manager.h" 5 #include "chrome/browser/prefs/profile_pref_store_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/files/file_enumerator.h" 11 #include "base/files/file_enumerator.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/prefs/json_pref_store.h" 16 #include "base/prefs/json_pref_store.h"
17 #include "base/prefs/persistent_pref_store.h" 17 #include "base/prefs/persistent_pref_store.h"
18 #include "base/prefs/pref_service.h" 18 #include "base/prefs/pref_service.h"
19 #include "base/prefs/pref_service_factory.h" 19 #include "base/prefs/pref_service_factory.h"
20 #include "base/prefs/pref_store.h" 20 #include "base/prefs/pref_store.h"
21 #include "base/prefs/testing_pref_service.h" 21 #include "base/prefs/testing_pref_service.h"
22 #include "base/run_loop.h" 22 #include "base/run_loop.h"
23 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
24 #include "base/values.h" 24 #include "base/values.h"
25 #include "chrome/browser/prefs/pref_hash_filter.h" 25 #include "chrome/browser/prefs/pref_hash_filter.h"
26 #include "components/user_prefs/pref_registry_syncable.h" 26 #include "components/pref_registry/pref_registry_syncable.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 28
29 namespace { 29 namespace {
30 30
31 class FirstEqualsPredicate { 31 class FirstEqualsPredicate {
32 public: 32 public:
33 explicit FirstEqualsPredicate(const std::string& expected) 33 explicit FirstEqualsPredicate(const std::string& expected)
34 : expected_(expected) {} 34 : expected_(expected) {}
35 bool operator()(const std::pair<std::string, base::Value*>& pair) { 35 bool operator()(const std::pair<std::string, base::Value*>& pair) {
36 return pair.first == expected_; 36 return pair.first == expected_;
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 LoadExistingPrefs(); 458 LoadExistingPrefs();
459 ExpectStringValueEquals(kProtectedAtomic, kHelloWorld); 459 ExpectStringValueEquals(kProtectedAtomic, kHelloWorld);
460 460
461 // Trigger the logic that migrates it back to the unprotected preferences 461 // Trigger the logic that migrates it back to the unprotected preferences
462 // file. 462 // file.
463 pref_store_->SetValue(kProtectedAtomic, new base::StringValue(kGoodbyeWorld)); 463 pref_store_->SetValue(kProtectedAtomic, new base::StringValue(kGoodbyeWorld));
464 LoadExistingPrefs(); 464 LoadExistingPrefs();
465 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld); 465 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld);
466 EXPECT_FALSE(WasResetRecorded()); 466 EXPECT_FALSE(WasResetRecorded());
467 } 467 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698