summaryrefslogtreecommitdiffstats
path: root/ios/chrome/test/ios_chrome_scoped_testing_local_state.h
blob: 77fe3167521a1aac4f2cd62b432b2e66a4859979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2015 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 IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_
#define IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_

#include "base/macros.h"
#include "components/prefs/testing_pref_service.h"

// Helper class to temporarily set up a |local_state| in the global
// TestingApplicationContext.
class IOSChromeScopedTestingLocalState {
 public:
  IOSChromeScopedTestingLocalState();
  ~IOSChromeScopedTestingLocalState();

  TestingPrefServiceSimple* Get();

 private:
  TestingPrefServiceSimple local_state_;

  DISALLOW_COPY_AND_ASSIGN(IOSChromeScopedTestingLocalState);
};

#endif  // IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_LOCAL_STATE_H_