Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: chrome/test/base/scoped_testing_local_state.h

Issue 12253004: Moving last generic Prefs implementation files to base/prefs/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/base/testing_pref_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_ 5 #ifndef CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
6 #define CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_ 6 #define CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/test/base/testing_pref_service.h" 9 #include "base/prefs/testing_pref_service.h"
10 10
11 class TestingBrowserProcess; 11 class TestingBrowserProcess;
12 12
13 // Helper class to temporarily set up a |local_state| in the global 13 // Helper class to temporarily set up a |local_state| in the global
14 // TestingBrowserProcess (for most unit tests it's NULL). 14 // TestingBrowserProcess (for most unit tests it's NULL).
15 class ScopedTestingLocalState { 15 class ScopedTestingLocalState {
16 public: 16 public:
17 explicit ScopedTestingLocalState(TestingBrowserProcess* browser_process); 17 explicit ScopedTestingLocalState(TestingBrowserProcess* browser_process);
18 ~ScopedTestingLocalState(); 18 ~ScopedTestingLocalState();
19 19
20 TestingPrefServiceSimple* Get() { 20 TestingPrefServiceSimple* Get() {
21 return &local_state_; 21 return &local_state_;
22 } 22 }
23 23
24 private: 24 private:
25 TestingBrowserProcess* browser_process_; 25 TestingBrowserProcess* browser_process_;
26 TestingPrefServiceSimple local_state_; 26 TestingPrefServiceSimple local_state_;
27 27
28 DISALLOW_COPY_AND_ASSIGN(ScopedTestingLocalState); 28 DISALLOW_COPY_AND_ASSIGN(ScopedTestingLocalState);
29 }; 29 };
30 30
31 #endif // CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_ 31 #endif // CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/base/testing_pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698