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

Unified Diff: chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc

Issue 326403003: Remove all traces of pref hash stores after last store reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc
diff --git a/chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc b/chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc
index 789fd1a24a27bae5bfbea88d1f6040f2cdd9bbf1..324a5a0c69f710b14827a6bae3ea060d06e1ec28 100644
--- a/chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc
+++ b/chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc
@@ -9,6 +9,7 @@
#include "base/prefs/pref_service.h"
#include "base/prefs/testing_pref_service.h"
#include "base/values.h"
+#include "chrome/common/pref_names.h"
#include "testing/gtest/include/gtest/gtest.h"
class PrefServiceHashStoreContentsTest : public testing::Test {
@@ -43,6 +44,8 @@ TEST_F(PrefServiceHashStoreContentsTest, IsInitialized) {
}
TEST_F(PrefServiceHashStoreContentsTest, Reset) {
+ ASSERT_FALSE(local_state_.GetUserPrefValue(prefs::kProfilePreferenceHashes));
+
{
PrefServiceHashStoreContents contents("store_id", &local_state_);
ASSERT_FALSE(contents.IsInitialized());
@@ -53,12 +56,18 @@ TEST_F(PrefServiceHashStoreContentsTest, Reset) {
(*other_contents.GetMutableContents())
->Set("foo", new base::StringValue("bar"));
}
+
+ ASSERT_TRUE(local_state_.GetUserPrefValue(prefs::kProfilePreferenceHashes));
+
{
PrefServiceHashStoreContents contents("store_id", &local_state_);
ASSERT_TRUE(contents.IsInitialized());
contents.Reset();
ASSERT_FALSE(contents.IsInitialized());
}
+
+ ASSERT_TRUE(local_state_.GetUserPrefValue(prefs::kProfilePreferenceHashes));
+
{
PrefServiceHashStoreContents contents("store_id", &local_state_);
ASSERT_FALSE(contents.IsInitialized());
@@ -66,6 +75,14 @@ TEST_F(PrefServiceHashStoreContentsTest, Reset) {
&local_state_);
ASSERT_TRUE(other_contents.IsInitialized());
}
+
+ {
+ PrefServiceHashStoreContents other_contents("other_store_id",
+ &local_state_);
+ other_contents.Reset();
+ }
+
+ ASSERT_FALSE(local_state_.GetUserPrefValue(prefs::kProfilePreferenceHashes));
}
TEST_F(PrefServiceHashStoreContentsTest, GetAndSetContents) {
« no previous file with comments | « chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698