OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" | 8 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
9 #include "chrome/browser/chromeos/settings/cros_settings.h" | 9 #include "chrome/browser/chromeos/settings/cros_settings.h" |
10 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 TEST_F(AttestationPolicyObserverTest, UnregisteredPolicyClient) { | 98 TEST_F(AttestationPolicyObserverTest, UnregisteredPolicyClient) { |
99 policy_client_.SetDMToken(""); | 99 policy_client_.SetDMToken(""); |
100 Run(); | 100 Run(); |
101 } | 101 } |
102 | 102 |
103 TEST_F(AttestationPolicyObserverTest, NewCertificate) { | 103 TEST_F(AttestationPolicyObserverTest, NewCertificate) { |
104 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) | 104 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) |
105 .WillOnce(WithArgs<2>(Invoke(DBusCallbackFalse))); | 105 .WillOnce(WithArgs<2>(Invoke(DBusCallbackFalse))); |
106 EXPECT_CALL(attestation_flow_, GetCertificate(_, _)) | 106 EXPECT_CALL(attestation_flow_, GetCertificate(_, _, _)) |
107 .WillOnce(WithArgs<1>(Invoke(CertCallbackSuccess))); | 107 .WillOnce(WithArgs<2>(Invoke(CertCallbackSuccess))); |
108 Run(); | 108 Run(); |
109 } | 109 } |
110 | 110 |
111 TEST_F(AttestationPolicyObserverTest, KeyExists) { | 111 TEST_F(AttestationPolicyObserverTest, KeyExists) { |
112 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) | 112 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) |
113 .WillOnce(WithArgs<2>(Invoke(DBusCallbackTrue))); | 113 .WillOnce(WithArgs<2>(Invoke(DBusCallbackTrue))); |
114 EXPECT_CALL(cryptohome_client_, TpmAttestationGetCertificate(_, _, _)) | 114 EXPECT_CALL(cryptohome_client_, TpmAttestationGetCertificate(_, _, _)) |
115 .WillOnce(WithArgs<2>(Invoke(DBusDataCallback))); | 115 .WillOnce(WithArgs<2>(Invoke(DBusDataCallback))); |
116 Run(); | 116 Run(); |
117 } | 117 } |
118 | 118 |
119 } // namespace attestation | 119 } // namespace attestation |
120 } // namespace chromeos | 120 } // namespace chromeos |
OLD | NEW |