OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ | 5 #ifndef IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ |
6 #define IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ | 6 #define IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
10 | 10 |
11 // Helper class to temporarily set up a |local_state| in the global | 11 // Helper class to temporarily set up a |local_state| in the global |
12 // TestingApplicationContext. | 12 // TestingApplicationContext. |
13 class IOSChromeScopedTestingLocalState { | 13 class IOSChromeScopedTestingLocalState { |
14 public: | 14 public: |
15 IOSChromeScopedTestingLocalState(); | 15 IOSChromeScopedTestingLocalState(); |
16 ~IOSChromeScopedTestingLocalState(); | 16 ~IOSChromeScopedTestingLocalState(); |
17 | 17 |
18 TestingPrefServiceSimple* Get(); | 18 TestingPrefServiceSimple* Get(); |
19 | 19 |
20 private: | 20 private: |
21 TestingPrefServiceSimple local_state_; | 21 TestingPrefServiceSimple local_state_; |
22 | 22 |
23 DISALLOW_COPY_AND_ASSIGN(IOSChromeScopedTestingLocalState); | 23 DISALLOW_COPY_AND_ASSIGN(IOSChromeScopedTestingLocalState); |
24 }; | 24 }; |
25 | 25 |
26 #endif // IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ | 26 #endif // IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_ |
OLD | NEW |