Lines Matching full:kkey
38 const char kKey[] = "test-key";
81 ASSERT_TRUE(SetValue(kKey, test_data));
83 EXPECT_TRUE(prefs_.GetString(kKey, &value));
99 EXPECT_TRUE(prefs_.SetString(kKey, kValue));
101 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
115 EXPECT_TRUE(prefs_.SetString(kKey, kValue));
117 EXPECT_TRUE(base::ReadFileToString(subdir.Append(kKey), &value));
123 EXPECT_FALSE(prefs_.SetString(kKey, "test value"));
127 base::CreateDirectory(prefs_dir_.Append(kKey));
128 EXPECT_FALSE(prefs_.SetString(kKey, "test value"));
129 EXPECT_TRUE(base::DirectoryExists(prefs_dir_.Append(kKey)));
133 ASSERT_TRUE(SetValue(kKey, " \n 25 \t "));
135 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
140 ASSERT_TRUE(SetValue(kKey, "30a"));
142 EXPECT_FALSE(prefs_.GetInt64(kKey, &value));
146 ASSERT_TRUE(SetValue(kKey, base::StringPrintf(
149 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
154 ASSERT_TRUE(SetValue(kKey, base::StringPrintf(
157 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
162 ASSERT_TRUE(SetValue(kKey, " \t -100 \n "));
164 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
174 EXPECT_TRUE(prefs_.SetInt64(kKey, -123));
176 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
187 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::max()));
189 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
195 EXPECT_TRUE(prefs_.SetInt64(kKey, std::numeric_limits<int64_t>::min()));
197 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
203 ASSERT_TRUE(SetValue(kKey, " \n false \t "));
205 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value));
210 const char kKey[] = "test-key";
211 ASSERT_TRUE(SetValue(kKey, " \t true \n "));
213 EXPECT_TRUE(prefs_.GetBoolean(kKey, &value));
218 const char kKey[] = "test-key";
219 ASSERT_TRUE(SetValue(kKey, "1"));
221 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value));
225 const char kKey[] = "test-key";
226 ASSERT_TRUE(SetValue(kKey, ""));
228 EXPECT_FALSE(prefs_.GetBoolean(kKey, &value));
237 const char kKey[] = "test-bool";
238 EXPECT_TRUE(prefs_.SetBoolean(kKey, true));
240 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
245 const char kKey[] = "test-bool";
246 EXPECT_TRUE(prefs_.SetBoolean(kKey, false));
248 EXPECT_TRUE(base::ReadFileToString(prefs_dir_.Append(kKey), &value));
253 const char kKey[] = "s p a c e s";
254 EXPECT_FALSE(prefs_.SetBoolean(kKey, true));
255 EXPECT_FALSE(base::PathExists(prefs_dir_.Append(kKey)));
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);
289 EXPECT_CALL(mock_obserser, OnPrefSet(Eq(kKey)));
291 prefs_.SetString(kKey, "value");
295 EXPECT_CALL(mock_obserser, OnPrefDeleted(Eq(kKey)));
296 prefs_.Delete(kKey);
299 prefs_.RemoveObserver(kKey, &mock_obserser);
309 prefs_.SetString(kKey, "value");
310 prefs_.Delete(kKey);
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"));
347 EXPECT_FALSE(prefs_.Exists(kKey));
349 EXPECT_FALSE(prefs_.GetInt64(kKey, &value));
351 EXPECT_TRUE(prefs_.SetInt64(kKey, 1234));
352 EXPECT_TRUE(prefs_.Exists(kKey));
353 EXPECT_TRUE(prefs_.GetInt64(kKey, &value));
356 EXPECT_TRUE(prefs_.Delete(kKey));
357 EXPECT_FALSE(prefs_.Exists(kKey));
358 EXPECT_FALSE(prefs_.Delete(kKey));