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

Side by Side Diff: chrome/browser/signin/signin_util_unittest.cc

Issue 2712883005: Sign out profile when local_state file has been changed. (Closed)
Patch Set: Merge from master Created 3 years, 9 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
« no previous file with comments | « chrome/browser/signin/signin_util.cc ('k') | chrome/browser/signin/token_revoker_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #include "chrome/browser/signin/signin_util.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/prefs/browser_prefs.h"
9 #include "chrome/common/pref_names.h"
10 #include "chrome/test/base/browser_with_test_window_test.h"
11 #include "chrome/test/base/testing_browser_process.h"
12 #include "components/prefs/pref_service.h"
13 #include "components/prefs/testing_pref_service.h"
14
15 class SigninUtilTest : public BrowserWithTestWindowTest {
16 public:
17 void SetUp() override {
18 BrowserWithTestWindowTest::SetUp();
19
20 prefs_.reset(new TestingPrefServiceSimple());
21 }
22
23 void TearDown() override { BrowserWithTestWindowTest::TearDown(); }
24
25 std::unique_ptr<TestingPrefServiceSimple> prefs_;
26 };
27
28 TEST_F(SigninUtilTest, GetForceSigninPolicy) {
29 ASSERT_FALSE(signin_util::IsForceSigninEnabled());
30 chrome::RegisterLocalState(prefs_->registry());
31 TestingBrowserProcess::GetGlobal()->SetLocalState(prefs_.get());
32
33 g_browser_process->local_state()->SetBoolean(prefs::kForceBrowserSignin,
34 true);
35 ASSERT_TRUE(signin_util::IsForceSigninEnabled());
36 g_browser_process->local_state()->SetBoolean(prefs::kForceBrowserSignin,
37 false);
38 ASSERT_TRUE(signin_util::IsForceSigninEnabled());
39
40 TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr);
41 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_util.cc ('k') | chrome/browser/signin/token_revoker_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698