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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_temp_storage_unittest.cc

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/login/signed_settings_temp_storage.h" 5 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 virtual void SetUp() { 23 virtual void SetUp() {
24 ref_map_["some_stuff"] = "a=35;code=64"; 24 ref_map_["some_stuff"] = "a=35;code=64";
25 ref_map_["another_stuff"] = ""; 25 ref_map_["another_stuff"] = "";
26 ref_map_["name"] = "value"; 26 ref_map_["name"] = "value";
27 ref_map_["2bc6aa16-e0ea-11df-b13d-18a90520e2e5"] = "512"; 27 ref_map_["2bc6aa16-e0ea-11df-b13d-18a90520e2e5"] = "512";
28 28
29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
30 FilePath temp_file; 30 FilePath temp_file;
31 ASSERT_TRUE( 31 ASSERT_TRUE(
32 file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); 32 file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file));
33 local_state_.reset(PrefService::CreatePrefService(temp_file, NULL)); 33 local_state_.reset(PrefService::CreatePrefService(temp_file, NULL, NULL));
34 ASSERT_TRUE(NULL != local_state_.get()); 34 ASSERT_TRUE(NULL != local_state_.get());
35 SignedSettingsTempStorage::RegisterPrefs(local_state_.get()); 35 SignedSettingsTempStorage::RegisterPrefs(local_state_.get());
36 } 36 }
37 37
38 std::map<std::string, std::string> ref_map_; 38 std::map<std::string, std::string> ref_map_;
39 ScopedTempDir temp_dir_; 39 ScopedTempDir temp_dir_;
40 scoped_ptr<PrefService> local_state_; 40 scoped_ptr<PrefService> local_state_;
41 }; 41 };
42 42
43 TEST_F(SignedSettingsTempStorageTest, Basic) { 43 TEST_F(SignedSettingsTempStorageTest, Basic) {
(...skipping 23 matching lines...) Expand all
67 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value, 67 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value,
68 local_state_.get())); 68 local_state_.get()));
69 EXPECT_EQ(b_list[i]->second, value); 69 EXPECT_EQ(b_list[i]->second, value);
70 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series", 70 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series",
71 &value, 71 &value,
72 local_state_.get())); 72 local_state_.get()));
73 } 73 }
74 } 74 }
75 75
76 } // namespace chromeos 76 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/extensions/extension_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698