Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / preferences_helper.h
blobda3689e74af0f8ea265b975b975fa0ed9d26006a
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_
8 #include "base/files/file_path.h"
9 #include "base/values.h"
11 #include <string>
13 class PrefService;
15 namespace preferences_helper {
17 // Used to access the preferences within a particular sync profile.
18 PrefService* GetPrefs(int index);
20 // Used to access the preferences within the verifier sync profile.
21 PrefService* GetVerifierPrefs();
23 // Inverts the value of the boolean preference with name |pref_name| in the
24 // profile with index |index|. Also inverts its value in |verifier| if
25 // DisableVerifier() hasn't been called.
26 void ChangeBooleanPref(int index, const char* pref_name);
28 // Changes the value of the integer preference with name |pref_name| in the
29 // profile with index |index| to |new_value|. Also changes its value in
30 // |verifier| if DisableVerifier() hasn't been called.
31 void ChangeIntegerPref(int index, const char* pref_name, int new_value);
33 // Changes the value of the int64 preference with name |pref_name| in the
34 // profile with index |index| to |new_value|. Also changes its value in
35 // |verifier| if DisableVerifier() hasn't been called.
36 void ChangeInt64Pref(int index, const char* pref_name, int64 new_value);
38 // Changes the value of the double preference with name |pref_name| in the
39 // profile with index |index| to |new_value|. Also changes its value in
40 // |verifier| if DisableVerifier() hasn't been called.
41 void ChangeDoublePref(int index, const char* pref_name, double new_value);
43 // Changes the value of the string preference with name |pref_name| in the
44 // profile with index |index| to |new_value|. Also changes its value in
45 // |verifier| if DisableVerifier() hasn't been called.
46 void ChangeStringPref(int index,
47 const char* pref_name,
48 const std::string& new_value);
50 // Modifies the value of the string preference with name |pref_name| in the
51 // profile with index |index| by appending |append_value| to its current
52 // value. Also changes its value in |verifier| if DisableVerifier() hasn't
53 // been called.
54 void AppendStringPref(int index,
55 const char* pref_name,
56 const std::string& append_value);
58 // Changes the value of the file path preference with name |pref_name| in the
59 // profile with index |index| to |new_value|. Also changes its value in
60 // |verifier| if DisableVerifier() hasn't been called.
61 void ChangeFilePathPref(int index,
62 const char* pref_name,
63 const base::FilePath& new_value);
65 // Changes the value of the list preference with name |pref_name| in the
66 // profile with index |index| to |new_value|. Also changes its value in
67 // |verifier| if DisableVerifier() hasn't been called.
68 void ChangeListPref(int index,
69 const char* pref_name,
70 const base::ListValue& new_value);
72 // Used to verify that the boolean preference with name |pref_name| has the
73 // same value across all profiles. Also checks |verifier| if DisableVerifier()
74 // hasn't been called.
75 bool BooleanPrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
77 // Used to verify that the integer preference with name |pref_name| has the
78 // same value across all profiles. Also checks |verifier| if DisableVerifier()
79 // hasn't been called.
80 bool IntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
82 // Used to verify that the int64 preference with name |pref_name| has the
83 // same value across all profiles. Also checks |verifier| if DisableVerifier()
84 // hasn't been called.
85 bool Int64PrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
87 // Used to verify that the double preference with name |pref_name| has the
88 // same value across all profiles. Also checks |verifier| if DisableVerifier()
89 // hasn't been called.
90 bool DoublePrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
92 // Used to verify that the string preference with name |pref_name| has the
93 // same value across all profiles. Also checks |verifier| if DisableVerifier()
94 // hasn't been called.
95 bool StringPrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
97 // Used to verify that the file path preference with name |pref_name| has the
98 // same value across all profiles. Also checks |verifier| if DisableVerifier()
99 // hasn't been called.
100 bool FilePathPrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
102 // Used to verify that the list preference with name |pref_name| has the
103 // same value across all profiles. Also checks |verifier| if DisableVerifier()
104 // hasn't been called.
105 bool ListPrefMatches(const char* pref_name) WARN_UNUSED_RESULT;
107 } // namespace preferences_helper
109 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_