| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/json/json_string_value_serializer.h" | 6 #include "base/json/json_string_value_serializer.h" |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 bool fail_next_; | 66 bool fail_next_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class PrefsSyncableServiceTest : public testing::Test { | 69 class PrefsSyncableServiceTest : public testing::Test { |
| 70 public: | 70 public: |
| 71 PrefsSyncableServiceTest() : | 71 PrefsSyncableServiceTest() : |
| 72 pref_sync_service_(NULL), | 72 pref_sync_service_(NULL), |
| 73 test_processor_(NULL), | 73 test_processor_(NULL), |
| 74 next_pref_remote_sync_node_id_(0) {} | 74 next_pref_remote_sync_node_id_(0) {} |
| 75 | 75 |
| 76 virtual void SetUp() { | 76 void SetUp() override { |
| 77 prefs_.registry()->RegisterStringPref( | 77 prefs_.registry()->RegisterStringPref( |
| 78 kUnsyncedPreferenceName, | 78 kUnsyncedPreferenceName, |
| 79 kUnsyncedPreferenceDefaultValue, | 79 kUnsyncedPreferenceDefaultValue, |
| 80 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 80 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 81 prefs_.registry()->RegisterStringPref( | 81 prefs_.registry()->RegisterStringPref( |
| 82 prefs::kHomePage, | 82 prefs::kHomePage, |
| 83 std::string(), | 83 std::string(), |
| 84 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 84 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 85 prefs_.registry()->RegisterListPref( | 85 prefs_.registry()->RegisterListPref( |
| 86 prefs::kURLsToRestoreOnStartup, | 86 prefs::kURLsToRestoreOnStartup, |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 714 |
| 715 InitWithNoSyncData(); | 715 InitWithNoSyncData(); |
| 716 | 716 |
| 717 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); | 717 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); |
| 718 syncer::SyncChangeList list; | 718 syncer::SyncChangeList list; |
| 719 list.push_back(MakeRemoteChange( | 719 list.push_back(MakeRemoteChange( |
| 720 1, prefs::kHomePage, *null_value, SyncChange::ACTION_DELETE)); | 720 1, prefs::kHomePage, *null_value, SyncChange::ACTION_DELETE)); |
| 721 pref_sync_service_->ProcessSyncChanges(FROM_HERE, list); | 721 pref_sync_service_->ProcessSyncChanges(FROM_HERE, list); |
| 722 EXPECT_TRUE(pref->IsDefaultValue()); | 722 EXPECT_TRUE(pref->IsDefaultValue()); |
| 723 } | 723 } |
| OLD | NEW |