OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" | 5 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/test/simple_test_clock.h" | 9 #include "base/test/simple_test_clock.h" |
10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace { | 29 namespace { |
30 const char kTestUser[] = "user@example.com"; | 30 const char kTestUser[] = "user@example.com"; |
31 } | 31 } |
32 | 32 |
33 class SAMLOfflineSigninLimiterTest : public testing::Test { | 33 class SAMLOfflineSigninLimiterTest : public testing::Test { |
34 protected: | 34 protected: |
35 SAMLOfflineSigninLimiterTest(); | 35 SAMLOfflineSigninLimiterTest(); |
36 virtual ~SAMLOfflineSigninLimiterTest(); | 36 virtual ~SAMLOfflineSigninLimiterTest(); |
37 | 37 |
38 // testing::Test: | 38 // testing::Test: |
39 virtual void SetUp() OVERRIDE; | 39 virtual void SetUp() override; |
40 virtual void TearDown() OVERRIDE; | 40 virtual void TearDown() override; |
41 | 41 |
42 void DestroyLimiter(); | 42 void DestroyLimiter(); |
43 void CreateLimiter(); | 43 void CreateLimiter(); |
44 | 44 |
45 scoped_refptr<base::TestSimpleTaskRunner> runner_; | 45 scoped_refptr<base::TestSimpleTaskRunner> runner_; |
46 base::ThreadTaskRunnerHandle runner_handle_; | 46 base::ThreadTaskRunnerHandle runner_handle_; |
47 | 47 |
48 MockUserManager* user_manager_; // Not owned. | 48 MockUserManager* user_manager_; // Not owned. |
49 ScopedUserManagerEnabler user_manager_enabler_; | 49 ScopedUserManagerEnabler user_manager_enabler_; |
50 | 50 |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, false)).Times(0); | 568 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, false)).Times(0); |
569 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, true)).Times(1); | 569 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, true)).Times(1); |
570 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); | 570 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); |
571 | 571 |
572 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( | 572 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( |
573 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); | 573 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); |
574 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); | 574 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); |
575 } | 575 } |
576 | 576 |
577 } // namespace chromeos | 577 } // namespace chromeos |
OLD | NEW |