OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 | 10 |
| 11 #include <stdint.h> |
| 12 |
11 #include <string> | 13 #include <string> |
12 | 14 |
13 class PrefService; | 15 class PrefService; |
14 | 16 |
15 namespace preferences_helper { | 17 namespace preferences_helper { |
16 | 18 |
17 // Used to access the preferences within a particular sync profile. | 19 // Used to access the preferences within a particular sync profile. |
18 PrefService* GetPrefs(int index); | 20 PrefService* GetPrefs(int index); |
19 | 21 |
20 // Used to access the preferences within the verifier sync profile. | 22 // Used to access the preferences within the verifier sync profile. |
21 PrefService* GetVerifierPrefs(); | 23 PrefService* GetVerifierPrefs(); |
22 | 24 |
23 // Inverts the value of the boolean preference with name |pref_name| in the | 25 // 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 | 26 // profile with index |index|. Also inverts its value in |verifier| if |
25 // DisableVerifier() hasn't been called. | 27 // DisableVerifier() hasn't been called. |
26 void ChangeBooleanPref(int index, const char* pref_name); | 28 void ChangeBooleanPref(int index, const char* pref_name); |
27 | 29 |
28 // Changes the value of the integer preference with name |pref_name| in the | 30 // 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 | 31 // profile with index |index| to |new_value|. Also changes its value in |
30 // |verifier| if DisableVerifier() hasn't been called. | 32 // |verifier| if DisableVerifier() hasn't been called. |
31 void ChangeIntegerPref(int index, const char* pref_name, int new_value); | 33 void ChangeIntegerPref(int index, const char* pref_name, int new_value); |
32 | 34 |
33 // Changes the value of the int64 preference with name |pref_name| in the | 35 // Changes the value of the int64_t preference with name |pref_name| in the |
34 // profile with index |index| to |new_value|. Also changes its value in | 36 // profile with index |index| to |new_value|. Also changes its value in |
35 // |verifier| if DisableVerifier() hasn't been called. | 37 // |verifier| if DisableVerifier() hasn't been called. |
36 void ChangeInt64Pref(int index, const char* pref_name, int64 new_value); | 38 void ChangeInt64Pref(int index, const char* pref_name, int64_t new_value); |
37 | 39 |
38 // Changes the value of the double preference with name |pref_name| in the | 40 // 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 | 41 // profile with index |index| to |new_value|. Also changes its value in |
40 // |verifier| if DisableVerifier() hasn't been called. | 42 // |verifier| if DisableVerifier() hasn't been called. |
41 void ChangeDoublePref(int index, const char* pref_name, double new_value); | 43 void ChangeDoublePref(int index, const char* pref_name, double new_value); |
42 | 44 |
43 // Changes the value of the string preference with name |pref_name| in the | 45 // 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 | 46 // profile with index |index| to |new_value|. Also changes its value in |
45 // |verifier| if DisableVerifier() hasn't been called. | 47 // |verifier| if DisableVerifier() hasn't been called. |
46 void ChangeStringPref(int index, | 48 void ChangeStringPref(int index, |
(...skipping 17 matching lines...) Expand all Loading... |
64 // Used to verify that the boolean preference with name |pref_name| has the | 66 // Used to verify that the boolean preference with name |pref_name| has the |
65 // same value across all profiles. Also checks |verifier| if DisableVerifier() | 67 // same value across all profiles. Also checks |verifier| if DisableVerifier() |
66 // hasn't been called. | 68 // hasn't been called. |
67 bool BooleanPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 69 bool BooleanPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
68 | 70 |
69 // Used to verify that the integer preference with name |pref_name| has the | 71 // Used to verify that the integer preference with name |pref_name| has the |
70 // same value across all profiles. Also checks |verifier| if DisableVerifier() | 72 // same value across all profiles. Also checks |verifier| if DisableVerifier() |
71 // hasn't been called. | 73 // hasn't been called. |
72 bool IntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 74 bool IntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
73 | 75 |
74 // Used to verify that the int64 preference with name |pref_name| has the | 76 // Used to verify that the int64_t preference with name |pref_name| has the |
75 // same value across all profiles. Also checks |verifier| if DisableVerifier() | 77 // same value across all profiles. Also checks |verifier| if DisableVerifier() |
76 // hasn't been called. | 78 // hasn't been called. |
77 bool Int64PrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 79 bool Int64PrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
78 | 80 |
79 // Used to verify that the double preference with name |pref_name| has the | 81 // Used to verify that the double preference with name |pref_name| has the |
80 // same value across all profiles. Also checks |verifier| if DisableVerifier() | 82 // same value across all profiles. Also checks |verifier| if DisableVerifier() |
81 // hasn't been called. | 83 // hasn't been called. |
82 bool DoublePrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 84 bool DoublePrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
83 | 85 |
84 // Used to verify that the string preference with name |pref_name| has the | 86 // Used to verify that the string preference with name |pref_name| has the |
(...skipping 23 matching lines...) Expand all Loading... |
108 // a timeout occurs. Returns false if it returns because of a timeout. | 110 // a timeout occurs. Returns false if it returns because of a timeout. |
109 bool AwaitIntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 111 bool AwaitIntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
110 | 112 |
111 // Blocks the test until the specified pref matches on all relevant clients or | 113 // Blocks the test until the specified pref matches on all relevant clients or |
112 // a timeout occurs. Returns false if it returns because of a timeout. | 114 // a timeout occurs. Returns false if it returns because of a timeout. |
113 bool AwaitStringPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | 115 bool AwaitStringPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; |
114 | 116 |
115 } // namespace preferences_helper | 117 } // namespace preferences_helper |
116 | 118 |
117 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ | 119 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PREFERENCES_HELPER_H_ |
OLD | NEW |