| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/test/integration/preferences_helper.h" | 5 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void ChangeListPref(int index, | 71 void ChangeListPref(int index, |
| 72 const char* pref_name, | 72 const char* pref_name, |
| 73 const base::ListValue& new_value) { | 73 const base::ListValue& new_value) { |
| 74 { | 74 { |
| 75 ListPrefUpdate update(GetPrefs(index), pref_name); | 75 ListPrefUpdate update(GetPrefs(index), pref_name); |
| 76 base::ListValue* list = update.Get(); | 76 base::ListValue* list = update.Get(); |
| 77 for (base::ListValue::const_iterator it = new_value.begin(); | 77 for (base::ListValue::const_iterator it = new_value.begin(); |
| 78 it != new_value.end(); | 78 it != new_value.end(); |
| 79 ++it) { | 79 ++it) { |
| 80 list->Append(it->CreateDeepCopy()); | 80 list->Append((*it)->CreateDeepCopy()); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (test()->use_verifier()) { | 84 if (test()->use_verifier()) { |
| 85 ListPrefUpdate update_verifier(GetVerifierPrefs(), pref_name); | 85 ListPrefUpdate update_verifier(GetVerifierPrefs(), pref_name); |
| 86 base::ListValue* list_verifier = update_verifier.Get(); | 86 base::ListValue* list_verifier = update_verifier.Get(); |
| 87 for (base::ListValue::const_iterator it = new_value.begin(); | 87 for (base::ListValue::const_iterator it = new_value.begin(); |
| 88 it != new_value.end(); | 88 it != new_value.end(); |
| 89 ++it) { | 89 ++it) { |
| 90 list_verifier->Append(it->CreateDeepCopy()); | 90 list_verifier->Append((*it)->CreateDeepCopy()); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool BooleanPrefMatches(const char* pref_name) { | 95 bool BooleanPrefMatches(const char* pref_name) { |
| 96 bool reference_value; | 96 bool reference_value; |
| 97 if (test()->use_verifier()) { | 97 if (test()->use_verifier()) { |
| 98 reference_value = GetVerifierPrefs()->GetBoolean(pref_name); | 98 reference_value = GetVerifierPrefs()->GetBoolean(pref_name); |
| 99 } else { | 99 } else { |
| 100 reference_value = GetPrefs(0)->GetBoolean(pref_name); | 100 reference_value = GetPrefs(0)->GetBoolean(pref_name); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 bool IntegerPrefMatchChecker::IsExitConditionSatisfied() { | 261 bool IntegerPrefMatchChecker::IsExitConditionSatisfied() { |
| 262 return preferences_helper::IntegerPrefMatches(GetPath()); | 262 return preferences_helper::IntegerPrefMatches(GetPath()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 StringPrefMatchChecker::StringPrefMatchChecker(const char* path) | 265 StringPrefMatchChecker::StringPrefMatchChecker(const char* path) |
| 266 : PrefMatchChecker(path) {} | 266 : PrefMatchChecker(path) {} |
| 267 | 267 |
| 268 bool StringPrefMatchChecker::IsExitConditionSatisfied() { | 268 bool StringPrefMatchChecker::IsExitConditionSatisfied() { |
| 269 return preferences_helper::StringPrefMatches(GetPath()); | 269 return preferences_helper::StringPrefMatches(GetPath()); |
| 270 } | 270 } |
| OLD | NEW |