Lines Matching refs:kKey

36 const char kKey[] = "test-key";  variable
81 ASSERT_TRUE(SetValue(kKey, test_data)); in TEST_F()
83 EXPECT_TRUE(prefs_.GetString(kKey, &value)); in TEST_F()
99 EXPECT_TRUE(prefs_.SetString(kKey, kValue)); in TEST_F()
101 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
115 EXPECT_TRUE(prefs_.SetString(kKey, kValue)); in TEST_F()
117 EXPECT_TRUE(base::ReadFileToString(subdir.Append(kKey), &value)); in TEST_F()
123 EXPECT_FALSE(prefs_.SetString(kKey, "test value")); in TEST_F()
127 base::CreateDirectory(prefs_dir_.Append(kKey)); in TEST_F()
128 EXPECT_FALSE(prefs_.SetString(kKey, "test value")); in TEST_F()
129 EXPECT_TRUE(base::DirectoryExists(prefs_dir_.Append(kKey))); in TEST_F()
133 ASSERT_TRUE(SetValue(kKey, " \n 25 \t ")); in TEST_F()
135 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
140 ASSERT_TRUE(SetValue(kKey, "30a")); in TEST_F()
142 EXPECT_FALSE(prefs_.GetInt64(kKey, &value)); in TEST_F()
146 ASSERT_TRUE(SetValue(kKey, base::StringPrintf( in TEST_F()
149 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
154 ASSERT_TRUE(SetValue(kKey, base::StringPrintf( in TEST_F()
157 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
162 ASSERT_TRUE(SetValue(kKey, " \t -100 \n ")); in TEST_F()
164 EXPECT_TRUE(prefs_.GetInt64(kKey, &value)); in TEST_F()
174 EXPECT_TRUE(prefs_.SetInt64(kKey, -123)); in TEST_F()
176 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
187 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::max())); in TEST_F()
189 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
195 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::min())); in TEST_F()
197 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
203 ASSERT_TRUE(SetValue(kKey, " \n false \t ")); in TEST_F()
205 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
210 const char kKey[] = "test-key"; in TEST_F() local
211 ASSERT_TRUE(SetValue(kKey, " \t true \n ")); in TEST_F()
213 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
218 const char kKey[] = "test-key"; in TEST_F() local
219 ASSERT_TRUE(SetValue(kKey, "1")); in TEST_F()
221 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
225 const char kKey[] = "test-key"; in TEST_F() local
226 ASSERT_TRUE(SetValue(kKey, "")); in TEST_F()
228 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value)); in TEST_F()
237 const char kKey[] = "test-bool"; in TEST_F() local
238 EXPECT_TRUE(prefs_.SetBoolean(kKey, true)); in TEST_F()
240 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
245 const char kKey[] = "test-bool"; in TEST_F() local
246 EXPECT_TRUE(prefs_.SetBoolean(kKey, false)); in TEST_F()
248 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value)); in TEST_F()
253 const char kKey[] = "s p a c e s"; in TEST_F() local
254 EXPECT_FALSE(prefs_.SetBoolean(kKey, true)); in TEST_F()
255 EXPECT_FALSE(base::PathExists(prefs_dir_.Append(kKey))); in TEST_F()
260 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
263 ASSERT_TRUE(prefs_.SetInt64(kKey, 8)); in TEST_F()
264 EXPECT_TRUE(prefs_.Exists(kKey)); in TEST_F()
269 EXPECT_TRUE(prefs_.Delete(kKey)); in TEST_F()
272 ASSERT_TRUE(prefs_.SetInt64(kKey, 0)); in TEST_F()
273 EXPECT_TRUE(prefs_.Delete(kKey)); in TEST_F()
276 EXPECT_FALSE(prefs_.Exists(kKey)); in TEST_F()
287 prefs_.AddObserver(kKey, &mock_obserser); in TEST_F()
289 EXPECT_CALL(mock_obserser, OnPrefSet(Eq(kKey))); in TEST_F()
291 prefs_.SetString(kKey, "value"); in TEST_F()
295 EXPECT_CALL(mock_obserser, OnPrefDeleted(Eq(kKey))); in TEST_F()
296 prefs_.Delete(kKey); in TEST_F()
299 prefs_.RemoveObserver(kKey, &mock_obserser); in TEST_F()
309 prefs_.SetString(kKey, "value"); in TEST_F()
310 prefs_.Delete(kKey); in TEST_F()
317 prefs_.AddObserver(kKey, &mock_obserser_a); in TEST_F()
318 prefs_.AddObserver(kKey, &mock_obserser_b); in TEST_F()
321 EXPECT_TRUE(prefs_.SetString(kKey, "value")); in TEST_F()
322 prefs_.RemoveObserver(kKey, &mock_obserser_b); in TEST_F()
323 EXPECT_TRUE(prefs_.SetString(kKey, "other value")); in TEST_F()
324 prefs_.RemoveObserver(kKey, &mock_obserser_a); in TEST_F()
325 EXPECT_TRUE(prefs_.SetString(kKey, "yet another value")); in TEST_F()