Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: base/prefs/json_pref_store_unittest.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | base/prefs/pref_service_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/json_pref_store_unittest.cc
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc
index 72b9ba4ae0c69e510cab7865f5567dd82783b544..63b9e0231c78ab95bb184dea1059341d334753f9 100644
--- a/base/prefs/json_pref_store_unittest.cc
+++ b/base/prefs/json_pref_store_unittest.cc
@@ -59,9 +59,8 @@ class JsonPrefStoreTest : public testing::Test {
TEST_F(JsonPrefStoreTest, NonExistentFile) {
base::FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
ASSERT_FALSE(file_util::PathExists(bogus_input_file));
- scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- bogus_input_file, message_loop_.message_loop_proxy());
+ scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+ bogus_input_file, message_loop_.message_loop_proxy().get());
EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_NO_FILE,
pref_store->ReadPrefs());
EXPECT_FALSE(pref_store->ReadOnly());
@@ -73,8 +72,7 @@ TEST_F(JsonPrefStoreTest, InvalidFile) {
base::FilePath invalid_file = temp_dir_.path().AppendASCII("invalid.json");
ASSERT_TRUE(file_util::CopyFile(invalid_file_original, invalid_file));
scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- invalid_file, message_loop_.message_loop_proxy());
+ new JsonPrefStore(invalid_file, message_loop_.message_loop_proxy().get());
EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE,
pref_store->ReadPrefs());
EXPECT_FALSE(pref_store->ReadOnly());
@@ -161,8 +159,7 @@ TEST_F(JsonPrefStoreTest, Basic) {
base::FilePath input_file = temp_dir_.path().AppendASCII("write.json");
ASSERT_TRUE(file_util::PathExists(input_file));
scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- input_file, message_loop_.message_loop_proxy());
+ new JsonPrefStore(input_file, message_loop_.message_loop_proxy().get());
ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
ASSERT_FALSE(pref_store->ReadOnly());
@@ -188,8 +185,7 @@ TEST_F(JsonPrefStoreTest, BasicAsync) {
base::FilePath input_file = temp_dir_.path().AppendASCII("write.json");
ASSERT_TRUE(file_util::PathExists(input_file));
scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- input_file, message_loop_.message_loop_proxy());
+ new JsonPrefStore(input_file, message_loop_.message_loop_proxy().get());
{
MockPrefStoreObserver mock_observer;
@@ -225,9 +221,8 @@ TEST_F(JsonPrefStoreTest, BasicAsync) {
TEST_F(JsonPrefStoreTest, AsyncNonExistingFile) {
base::FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
ASSERT_FALSE(file_util::PathExists(bogus_input_file));
- scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- bogus_input_file, message_loop_.message_loop_proxy());
+ scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+ bogus_input_file, message_loop_.message_loop_proxy().get());
MockPrefStoreObserver mock_observer;
pref_store->AddObserver(&mock_observer);
@@ -253,8 +248,7 @@ TEST_F(JsonPrefStoreTest, NeedsEmptyValue) {
// Test that the persistent value can be loaded.
ASSERT_TRUE(file_util::PathExists(pref_file));
scoped_refptr<JsonPrefStore> pref_store =
- new JsonPrefStore(
- pref_file, message_loop_.message_loop_proxy());
+ new JsonPrefStore(pref_file, message_loop_.message_loop_proxy().get());
ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
ASSERT_FALSE(pref_store->ReadOnly());
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | base/prefs/pref_service_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698