diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 15:27:12 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 15:27:12 +0000 |
commit | 9c42a481ed4ef654568785145e143cb172f3e935 (patch) | |
tree | 256b1a49b0fbb46aa3b6b1741237b42ae1624bde | |
parent | 6eb495cff353d0fcc43eeac5a0e91237dfabec0c (diff) | |
download | chromium_src-9c42a481ed4ef654568785145e143cb172f3e935.zip chromium_src-9c42a481ed4ef654568785145e143cb172f3e935.tar.gz chromium_src-9c42a481ed4ef654568785145e143cb172f3e935.tar.bz2 |
Revert 45029 - Fix JsonPrefStoreTest.NonExistentFile.
For a nonexistent file, the PrefStore is *not* readonly, and writing would create the pref file.
I'm going to add a second test for reading a broken file afterwards.
TBR=pam@chromium.org
TEST=JsonPrefStoreTest.NonExistentFile
Review URL: http://codereview.chromium.org/1521041
TBR=bauerb@chromium.org
Review URL: http://codereview.chromium.org/1525041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45037 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/json_pref_store_unittest.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/json_pref_store_unittest.cc b/chrome/browser/json_pref_store_unittest.cc index 01f7c7c..37bd44e 100644 --- a/chrome/browser/json_pref_store_unittest.cc +++ b/chrome/browser/json_pref_store_unittest.cc @@ -49,8 +49,11 @@ TEST_F(JsonPrefStoreTest, NonExistentFile) { FilePath bogus_input_file = data_dir_.AppendASCII("read.txt"); JsonPrefStore pref_store(bogus_input_file); EXPECT_EQ(PrefStore::PREF_READ_ERROR_NO_FILE, pref_store.ReadPrefs()); - EXPECT_FALSE(pref_store.ReadOnly()); + EXPECT_TRUE(pref_store.ReadOnly()); EXPECT_TRUE(pref_store.Prefs()->empty()); + // Writing to a read-only store should return true, but do nothing. + EXPECT_TRUE(pref_store.WritePrefs()); + EXPECT_FALSE(file_util::PathExists(bogus_input_file)); } TEST_F(JsonPrefStoreTest, Basic) { |