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

Unified Diff: chrome/test/base/scoped_testing_local_state.h

Issue 12223091: Split testing_pref_service.h/.cc into two parts, generic vs. Chrome-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/base/scoped_testing_local_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/scoped_testing_local_state.h
diff --git a/chrome/test/base/scoped_testing_local_state.h b/chrome/test/base/scoped_testing_local_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c1cddaf5d9ae70fe3d21a765588313c66b6a5b7
--- /dev/null
+++ b/chrome/test/base/scoped_testing_local_state.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
+#define CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
+
+#include "base/basictypes.h"
+#include "chrome/test/base/testing_pref_service.h"
+
+class TestingBrowserProcess;
+
+// Helper class to temporarily set up a |local_state| in the global
+// TestingBrowserProcess (for most unit tests it's NULL).
+class ScopedTestingLocalState {
+ public:
+ explicit ScopedTestingLocalState(TestingBrowserProcess* browser_process);
+ ~ScopedTestingLocalState();
+
+ TestingPrefServiceSimple* Get() {
+ return &local_state_;
+ }
+
+ private:
+ TestingBrowserProcess* browser_process_;
+ TestingPrefServiceSimple local_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedTestingLocalState);
+};
+
+#endif // CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/base/scoped_testing_local_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698