Lines Matching refs:prefs_
46 ASSERT_TRUE(prefs_.Init(prefs_dir_)); in SetUp()
59 Prefs prefs_; member in chromeos_update_engine::PrefsTest
66 EXPECT_TRUE(prefs_.file_storage_.GetFileNameForKey(kAllvalidCharsKey, &path)); in TEST_F()
72 EXPECT_FALSE(prefs_.file_storage_.GetFileNameForKey("ABC abc", &path)); in TEST_F()
77 EXPECT_FALSE(prefs_.file_storage_.GetFileNameForKey("", &path)); in TEST_F()
84 EXPECT_TRUE(prefs_.GetString(kKey, &value)); in TEST_F()
90 EXPECT_FALSE(prefs_.GetString(",bad", &value)); in TEST_F()
95 EXPECT_FALSE(prefs_.GetString("non-existent-key", &value)); in TEST_F()
100 EXPECT_TRUE(prefs_.SetString(kKey, kValue)); in TEST_F()
108 EXPECT_FALSE(prefs_.SetString(kKeyWithDots, "some value")); in TEST_F()
115 EXPECT_TRUE(prefs_.Init(subdir)); in TEST_F()
116 EXPECT_TRUE(prefs_.SetString(kKey, kValue)); in TEST_F()
123 EXPECT_TRUE(prefs_.Init(base::FilePath("/dev/null"))); in TEST_F()
124 EXPECT_FALSE(prefs_.SetString(kKey, "test value")); in TEST_F()
129 EXPECT_FALSE(prefs_.SetString(kKey, "test value")); in TEST_F()
136 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
143 EXPECT_FALSE(prefs_.GetInt64(kKey, &value)); in TEST_F()
150 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
158 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
165 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
171 EXPECT_FALSE(prefs_.GetInt64("random-key", &value)); in TEST_F()
175 EXPECT_TRUE(prefs_.SetInt64(kKey, -123)); in TEST_F()
183 EXPECT_FALSE(prefs_.SetInt64(kKeyWithSpaces, 20)); in TEST_F()
188 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::max())); in TEST_F()
196 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::min())); in TEST_F()
206 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
214 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
222 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
229 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
234 EXPECT_FALSE(prefs_.GetBoolean("random-key", &value)); in TEST_F()
239 EXPECT_TRUE(prefs_.SetBoolean(kKey, true)); in TEST_F()
247 EXPECT_TRUE(prefs_.SetBoolean(kKey, false)); in TEST_F()
255 EXPECT_FALSE(prefs_.SetBoolean(kKey, true)); in TEST_F()
261 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
264 ASSERT_TRUE(prefs_.SetInt64(kKey, 8)); in TEST_F()
265 EXPECT_TRUE(prefs_.Exists(kKey)); in TEST_F()
270 EXPECT_TRUE(prefs_.Delete(kKey)); in TEST_F()
273 ASSERT_TRUE(prefs_.SetInt64(kKey, 0)); in TEST_F()
274 EXPECT_TRUE(prefs_.Delete(kKey)); in TEST_F()
277 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
288 prefs_.AddObserver(kKey, &mock_obserser); in TEST_F()
292 prefs_.SetString(kKey, "value"); in TEST_F()
297 prefs_.Delete(kKey); in TEST_F()
300 prefs_.RemoveObserver(kKey, &mock_obserser); in TEST_F()
306 prefs_.AddObserver(kUnusedKey, &mock_obserser); in TEST_F()
310 prefs_.SetString(kKey, "value"); in TEST_F()
311 prefs_.Delete(kKey); in TEST_F()
313 prefs_.RemoveObserver(kUnusedKey, &mock_obserser); in TEST_F()
318 prefs_.AddObserver(kKey, &mock_obserser_a); in TEST_F()
319 prefs_.AddObserver(kKey, &mock_obserser_b); in TEST_F()
322 EXPECT_TRUE(prefs_.SetString(kKey, "value")); in TEST_F()
323 prefs_.RemoveObserver(kKey, &mock_obserser_b); in TEST_F()
324 EXPECT_TRUE(prefs_.SetString(kKey, "other value")); in TEST_F()
325 prefs_.RemoveObserver(kKey, &mock_obserser_a); in TEST_F()
326 EXPECT_TRUE(prefs_.SetString(kKey, "yet another value")); in TEST_F()
332 prefs_.AddObserver(kInvalidKey, &mock_obserser); in TEST_F()
336 EXPECT_FALSE(prefs_.SetString(kInvalidKey, "value")); in TEST_F()
337 EXPECT_FALSE(prefs_.Delete(kInvalidKey)); in TEST_F()
339 prefs_.RemoveObserver(kInvalidKey, &mock_obserser); in TEST_F()
344 MemoryPrefs prefs_; member in chromeos_update_engine::MemoryPrefsTest
348 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
350 EXPECT_FALSE(prefs_.GetInt64(kKey, &value)); in TEST_F()
352 EXPECT_TRUE(prefs_.SetInt64(kKey, 1234)); in TEST_F()
353 EXPECT_TRUE(prefs_.Exists(kKey)); in TEST_F()
354 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
357 EXPECT_TRUE(prefs_.Delete(kKey)); in TEST_F()
358 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
359 EXPECT_FALSE(prefs_.Delete(kKey)); in TEST_F()