Do not announce robot account token before account ID is available
[chromium-blink-merge.git] / chrome / test / base / scoped_testing_local_state.h
blob033075396f544c3ca71576481a614ff65d15e408
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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
6 #define CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_
8 #include "base/basictypes.h"
9 #include "base/prefs/testing_pref_service.h"
11 class TestingBrowserProcess;
13 // Helper class to temporarily set up a |local_state| in the global
14 // TestingBrowserProcess (for most unit tests it's NULL).
15 class ScopedTestingLocalState {
16 public:
17 explicit ScopedTestingLocalState(TestingBrowserProcess* browser_process);
18 ~ScopedTestingLocalState();
20 TestingPrefServiceSimple* Get() {
21 return &local_state_;
24 private:
25 TestingBrowserProcess* browser_process_;
26 TestingPrefServiceSimple local_state_;
28 DISALLOW_COPY_AND_ASSIGN(ScopedTestingLocalState);
31 #endif // CHROME_TEST_BASE_SCOPED_TESTING_LOCAL_STATE_H_