| 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" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 12 #include "base/time/clock.h" | 12 #include "base/time/clock.h" |
| 13 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" | 13 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" |
| 14 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/users/user_manager.h" | 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 19 #include "components/pref_registry/pref_registry_syncable.h" | 19 #include "components/pref_registry/pref_registry_syncable.h" |
| 20 #include "components/user_manager/user_manager.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 23 |
| 23 using testing::Mock; | 24 using testing::Mock; |
| 24 using testing::ReturnRef; | 25 using testing::ReturnRef; |
| 25 using testing::Sequence; | 26 using testing::Sequence; |
| 26 | 27 |
| 27 namespace chromeos { | 28 namespace chromeos { |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, false)).Times(0); | 569 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, false)).Times(0); |
| 569 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, true)).Times(1); | 570 EXPECT_CALL(*user_manager_, SaveForceOnlineSignin(kTestUser, true)).Times(1); |
| 570 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); | 571 limiter_->SignedIn(UserContext::AUTH_FLOW_OFFLINE); |
| 571 | 572 |
| 572 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( | 573 const base::Time last_gaia_signin_time = base::Time::FromInternalValue( |
| 573 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); | 574 prefs->GetInt64(prefs::kSAMLLastGAIASignInTime)); |
| 574 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); | 575 EXPECT_EQ(gaia_signin_time, last_gaia_signin_time); |
| 575 } | 576 } |
| 576 | 577 |
| 577 } // namespace chromeos | 578 } // namespace chromeos |
| OLD | NEW |