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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const AccountId test_account_id_ = AccountId::FromUserEmail(kTestUser); | 51 const AccountId test_account_id_ = AccountId::FromUserEmail(kTestUser); |
52 | 52 |
53 TestingPrefServiceSimple* GetTestingLocalState(); | 53 TestingPrefServiceSimple* GetTestingLocalState(); |
54 | 54 |
55 scoped_refptr<base::TestSimpleTaskRunner> runner_; | 55 scoped_refptr<base::TestSimpleTaskRunner> runner_; |
56 base::ThreadTaskRunnerHandle runner_handle_; | 56 base::ThreadTaskRunnerHandle runner_handle_; |
57 | 57 |
58 MockUserManager* user_manager_; // Not owned. | 58 MockUserManager* user_manager_; // Not owned. |
59 ScopedUserManagerEnabler user_manager_enabler_; | 59 ScopedUserManagerEnabler user_manager_enabler_; |
60 | 60 |
61 scoped_ptr<TestingProfile> profile_; | 61 std::unique_ptr<TestingProfile> profile_; |
62 base::SimpleTestClock clock_; | 62 base::SimpleTestClock clock_; |
63 | 63 |
64 SAMLOfflineSigninLimiter* limiter_; // Owned. | 64 SAMLOfflineSigninLimiter* limiter_; // Owned. |
65 | 65 |
66 TestingPrefServiceSimple testing_local_state_; | 66 TestingPrefServiceSimple testing_local_state_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(SAMLOfflineSigninLimiterTest); | 68 DISALLOW_COPY_AND_ASSIGN(SAMLOfflineSigninLimiterTest); |
69 }; | 69 }; |
70 | 70 |
71 SAMLOfflineSigninLimiterTest::SAMLOfflineSigninLimiterTest() | 71 SAMLOfflineSigninLimiterTest::SAMLOfflineSigninLimiterTest() |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(test_account_id_, true)) | 648 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(test_account_id_, true)) |
649 .Times(1); | 649 .Times(1); |
650 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); | 650 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); |
651 | 651 |
652 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( | 652 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( |
653 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); | 653 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); |
654 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); | 654 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); |
655 } | 655 } |
656 | 656 |
657 } // namespace chromeos | 657 } // namespace chromeos |
OLD | NEW |