OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_writer.h" | 5 #include "base/json/json_writer.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 7 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
8 #include "chrome/browser/sync/test/integration/password_manager_setting_migrator
_helper.h" | 8 #include "chrome/browser/sync/test/integration/password_manager_setting_migrator
_helper.h" |
9 #include "chrome/browser/sync/test/integration/preferences_helper.h" | 9 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 using preferences_helper::GetPrefs; | 30 using preferences_helper::GetPrefs; |
31 using password_manager::prefs::kCredentialsEnableService; | 31 using password_manager::prefs::kCredentialsEnableService; |
32 using password_manager::prefs::kPasswordManagerSavingEnabled; | 32 using password_manager::prefs::kPasswordManagerSavingEnabled; |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 void InjectPreferenceValueToFakeServer(fake_server::FakeServer* fake_server, | 36 void InjectPreferenceValueToFakeServer(fake_server::FakeServer* fake_server, |
37 const std::string& name, | 37 const std::string& name, |
38 bool value) { | 38 bool value) { |
39 std::string serialized; | 39 std::string serialized; |
40 base::FundamentalValue bool_value(value); | 40 base::Value bool_value(value); |
41 base::JSONWriter::Write(bool_value, &serialized); | 41 base::JSONWriter::Write(bool_value, &serialized); |
42 sync_pb::EntitySpecifics specifics; | 42 sync_pb::EntitySpecifics specifics; |
43 sync_pb::PreferenceSpecifics* pref = nullptr; | 43 sync_pb::PreferenceSpecifics* pref = nullptr; |
44 if (name == kPasswordManagerSavingEnabled) { | 44 if (name == kPasswordManagerSavingEnabled) { |
45 pref = specifics.mutable_preference(); | 45 pref = specifics.mutable_preference(); |
46 } else if (name == kCredentialsEnableService) { | 46 } else if (name == kCredentialsEnableService) { |
47 pref = specifics.mutable_priority_preference()->mutable_preference(); | 47 pref = specifics.mutable_priority_preference()->mutable_preference(); |
48 } else { | 48 } else { |
49 NOTREACHED() << "Wrong preference name: " << name; | 49 NOTREACHED() << "Wrong preference name: " << name; |
50 } | 50 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 ASSERT_TRUE(SetupClients()); | 251 ASSERT_TRUE(SetupClients()); |
252 SetLocalPrefValues(true /* kCredentialsEnableService */, | 252 SetLocalPrefValues(true /* kCredentialsEnableService */, |
253 true /* kPasswordManagerSavingEnabled */); | 253 true /* kPasswordManagerSavingEnabled */); |
254 InjectNewValues(true /* kCredentialsEnableService */, | 254 InjectNewValues(true /* kCredentialsEnableService */, |
255 true /* kPasswordManagerSavingEnabled */); | 255 true /* kPasswordManagerSavingEnabled */); |
256 InitMigrationServiceAndSync(); | 256 InitMigrationServiceAndSync(); |
257 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); | 257 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
258 AssertPrefValues(true /* kCredentialsEnableService */, | 258 AssertPrefValues(true /* kCredentialsEnableService */, |
259 true /* kPasswordManagerSavingEnabled */); | 259 true /* kPasswordManagerSavingEnabled */); |
260 } | 260 } |
OLD | NEW |