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

Side by Side Diff: chromeos/login/login_state_unittest.cc

Issue 628883002: replace OVERRIDE and FINAL with override and final in chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « chromeos/login/auth/test_attempt_state.h ('k') | chromeos/network/client_cert_resolver.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chromeos/login/login_state.h" 5 #include "chromeos/login/login_state.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chromeos/chromeos_switches.h" 9 #include "chromeos/chromeos_switches.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace { 12 namespace {
13 const char kTestUserHash[] = "testuserhash"; 13 const char kTestUserHash[] = "testuserhash";
14 } // namespace 14 } // namespace
15 15
16 namespace chromeos { 16 namespace chromeos {
17 17
18 class LoginStateTest : public testing::Test, 18 class LoginStateTest : public testing::Test,
19 public LoginState::Observer { 19 public LoginState::Observer {
20 public: 20 public:
21 LoginStateTest() : logged_in_user_type_(LoginState::LOGGED_IN_USER_NONE), 21 LoginStateTest() : logged_in_user_type_(LoginState::LOGGED_IN_USER_NONE),
22 login_state_changes_count_(0) { 22 login_state_changes_count_(0) {
23 } 23 }
24 virtual ~LoginStateTest() { 24 virtual ~LoginStateTest() {
25 } 25 }
26 26
27 // testing::Test 27 // testing::Test
28 virtual void SetUp() OVERRIDE { 28 virtual void SetUp() override {
29 LoginState::Initialize(); 29 LoginState::Initialize();
30 LoginState::Get()->set_always_logged_in(false); 30 LoginState::Get()->set_always_logged_in(false);
31 LoginState::Get()->AddObserver(this); 31 LoginState::Get()->AddObserver(this);
32 } 32 }
33 33
34 virtual void TearDown() OVERRIDE { 34 virtual void TearDown() override {
35 LoginState::Get()->RemoveObserver(this); 35 LoginState::Get()->RemoveObserver(this);
36 LoginState::Shutdown(); 36 LoginState::Shutdown();
37 } 37 }
38 38
39 // LoginState::Observer 39 // LoginState::Observer
40 virtual void LoggedInStateChanged() OVERRIDE { 40 virtual void LoggedInStateChanged() override {
41 ++login_state_changes_count_; 41 ++login_state_changes_count_;
42 logged_in_user_type_ = LoginState::Get()->GetLoggedInUserType(); 42 logged_in_user_type_ = LoginState::Get()->GetLoggedInUserType();
43 } 43 }
44 44
45 protected: 45 protected:
46 // Returns number of times the login state changed since the last call to 46 // Returns number of times the login state changed since the last call to
47 // this method. 47 // this method.
48 unsigned int GetNewLoginStateChangesCount() { 48 unsigned int GetNewLoginStateChangesCount() {
49 unsigned int result = login_state_changes_count_; 49 unsigned int result = login_state_changes_count_;
50 login_state_changes_count_ = 0; 50 login_state_changes_count_ = 0;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 LoginState::Get()->GetLoggedInUserType()); 144 LoginState::Get()->GetLoggedInUserType());
145 EXPECT_TRUE(LoginState::Get()->IsUserLoggedIn()); 145 EXPECT_TRUE(LoginState::Get()->IsUserLoggedIn());
146 EXPECT_FALSE(LoginState::Get()->IsInSafeMode()); 146 EXPECT_FALSE(LoginState::Get()->IsInSafeMode());
147 EXPECT_EQ(kTestUserHash, LoginState::Get()->primary_user_hash()); 147 EXPECT_EQ(kTestUserHash, LoginState::Get()->primary_user_hash());
148 148
149 EXPECT_EQ(1U, GetNewLoginStateChangesCount()); 149 EXPECT_EQ(1U, GetNewLoginStateChangesCount());
150 EXPECT_EQ(LoginState::LOGGED_IN_USER_REGULAR, logged_in_user_type_); 150 EXPECT_EQ(LoginState::LOGGED_IN_USER_REGULAR, logged_in_user_type_);
151 } 151 }
152 152
153 } // namespace chromeos 153 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/auth/test_attempt_state.h ('k') | chromeos/network/client_cert_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698