Lines Matching defs:prefs_
45 ASSERT_TRUE(prefs_.Init(prefs_dir_));
58 Prefs prefs_;
65 EXPECT_TRUE(prefs_.GetFileNameForKey(kAllvalidCharsKey, &path));
71 EXPECT_FALSE(prefs_.GetFileNameForKey("ABC abc", &path));
76 EXPECT_FALSE(prefs_.GetFileNameForKey("", &path));
83 EXPECT_TRUE(prefs_.GetString(kKey, &value));
89 EXPECT_FALSE(prefs_.GetString(",bad", &value));
94 EXPECT_FALSE(prefs_.GetString("non-existent-key", &value));
99 EXPECT_TRUE(prefs_.SetString(kKey, kValue));
107 EXPECT_FALSE(prefs_.SetString(kKeyWithDots, "some value"));
114 EXPECT_TRUE(prefs_.Init(subdir));
115 EXPECT_TRUE(prefs_.SetString(kKey, kValue));
122 EXPECT_TRUE(prefs_.Init(base::FilePath("/dev/null")));
123 EXPECT_FALSE(prefs_.SetString(kKey, "test value"));
128 EXPECT_FALSE(prefs_.SetString(kKey, "test value"));
135 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
142 EXPECT_FALSE(prefs_.GetInt64(kKey, &value));
149 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
157 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
164 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
170 EXPECT_FALSE(prefs_.GetInt64("random-key", &value));
174 EXPECT_TRUE(prefs_.SetInt64(kKey, -123));
182 EXPECT_FALSE(prefs_.SetInt64(kKeyWithSpaces, 20));
187 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::max()));
195 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::min()));
205 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value));
213 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value));
221 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value));
228 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value));
233 EXPECT_FALSE(prefs_.GetBoolean("random-key", &value));
238 EXPECT_TRUE(prefs_.SetBoolean(kKey, true));
246 EXPECT_TRUE(prefs_.SetBoolean(kKey, false));
254 EXPECT_FALSE(prefs_.SetBoolean(kKey, true));
260 EXPECT_FALSE(prefs_.Exists(kKey));
263 ASSERT_TRUE(prefs_.SetInt64(kKey, 8));
264 EXPECT_TRUE(prefs_.Exists(kKey));
269 EXPECT_TRUE(prefs_.Delete(kKey));
272 ASSERT_TRUE(prefs_.SetInt64(kKey, 0));
273 EXPECT_TRUE(prefs_.Delete(kKey));
276 EXPECT_FALSE(prefs_.Exists(kKey));
287 prefs_.AddObserver(kKey, &mock_obserser);
291 prefs_.SetString(kKey, "value");
296 prefs_.Delete(kKey);
299 prefs_.RemoveObserver(kKey, &mock_obserser);
305 prefs_.AddObserver(kUnusedKey, &mock_obserser);
309 prefs_.SetString(kKey, "value");
310 prefs_.Delete(kKey);
312 prefs_.RemoveObserver(kUnusedKey, &mock_obserser);
317 prefs_.AddObserver(kKey, &mock_obserser_a);
318 prefs_.AddObserver(kKey, &mock_obserser_b);
321 EXPECT_TRUE(prefs_.SetString(kKey, "value"));
322 prefs_.RemoveObserver(kKey, &mock_obserser_b);
323 EXPECT_TRUE(prefs_.SetString(kKey, "other value"));
324 prefs_.RemoveObserver(kKey, &mock_obserser_a);
325 EXPECT_TRUE(prefs_.SetString(kKey, "yet another value"));
331 prefs_.AddObserver(kInvalidKey, &mock_obserser);
335 EXPECT_FALSE(prefs_.SetString(kInvalidKey, "value"));
336 EXPECT_FALSE(prefs_.Delete(kInvalidKey));
338 prefs_.RemoveObserver(kInvalidKey, &mock_obserser);