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

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

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2010->2011 Created 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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, NULL)); 33 local_state_.reset(
34 PrefService::CreatePrefService(temp_file, NULL, NULL, false));
34 ASSERT_TRUE(NULL != local_state_.get()); 35 ASSERT_TRUE(NULL != local_state_.get());
35 SignedSettingsTempStorage::RegisterPrefs(local_state_.get()); 36 SignedSettingsTempStorage::RegisterPrefs(local_state_.get());
36 } 37 }
37 38
38 std::map<std::string, std::string> ref_map_; 39 std::map<std::string, std::string> ref_map_;
39 ScopedTempDir temp_dir_; 40 ScopedTempDir temp_dir_;
40 scoped_ptr<PrefService> local_state_; 41 scoped_ptr<PrefService> local_state_;
41 }; 42 };
42 43
43 TEST_F(SignedSettingsTempStorageTest, Basic) { 44 TEST_F(SignedSettingsTempStorageTest, Basic) {
(...skipping 23 matching lines...) Expand all
67 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value, 68 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value,
68 local_state_.get())); 69 local_state_.get()));
69 EXPECT_EQ(b_list[i]->second, value); 70 EXPECT_EQ(b_list[i]->second, value);
70 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series", 71 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series",
71 &value, 72 &value,
72 local_state_.get())); 73 local_state_.get()));
73 } 74 }
74 } 75 }
75 76
76 } // namespace chromeos 77 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/content_settings/content_settings_pref_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698