| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 EXPECT_CALL(mock_attestation_flow_, | 190 EXPECT_CALL(mock_attestation_flow_, |
| 191 GetCertificate(PROFILE_CONTENT_PROTECTION_CERTIFICATE, | 191 GetCertificate(PROFILE_CONTENT_PROTECTION_CERTIFICATE, |
| 192 kTestEmail, kTestID, _, _)) | 192 kTestEmail, kTestID, _, _)) |
| 193 .WillRepeatedly(WithArgs<4>(Invoke( | 193 .WillRepeatedly(WithArgs<4>(Invoke( |
| 194 this, &PlatformVerificationFlowTest::FakeGetCertificate))); | 194 this, &PlatformVerificationFlowTest::FakeGetCertificate))); |
| 195 | 195 |
| 196 // Configure the mock AsyncMethodCaller to call FakeSignChallenge. | 196 // Configure the mock AsyncMethodCaller to call FakeSignChallenge. |
| 197 std::string expected_key_name = std::string(kContentProtectionKeyPrefix) + | 197 std::string expected_key_name = std::string(kContentProtectionKeyPrefix) + |
| 198 std::string(kTestID); | 198 std::string(kTestID); |
| 199 EXPECT_CALL(mock_async_caller_, | 199 EXPECT_CALL(mock_async_caller_, |
| 200 TpmAttestationSignSimpleChallenge(KEY_USER, expected_key_name, | 200 TpmAttestationSignSimpleChallenge(KEY_USER, kTestEmail, |
| 201 expected_key_name, |
| 201 kTestChallenge, _)) | 202 kTestChallenge, _)) |
| 202 .WillRepeatedly(WithArgs<3>(Invoke( | 203 .WillRepeatedly(WithArgs<4>(Invoke( |
| 203 this, &PlatformVerificationFlowTest::FakeSignChallenge))); | 204 this, &PlatformVerificationFlowTest::FakeSignChallenge))); |
| 204 } | 205 } |
| 205 | 206 |
| 206 void FakeGetCertificate( | 207 void FakeGetCertificate( |
| 207 const AttestationFlow::CertificateCallback& callback) { | 208 const AttestationFlow::CertificateCallback& callback) { |
| 208 base::MessageLoop::current()->PostTask(FROM_HERE, | 209 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 209 base::Bind(callback, | 210 base::Bind(callback, |
| 210 certificate_success_, | 211 certificate_success_, |
| 211 kTestCertificate)); | 212 kTestCertificate)); |
| 212 } | 213 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 447 |
| 447 TEST_F(PlatformVerificationFlowTest, FastCheckDBusFailure) { | 448 TEST_F(PlatformVerificationFlowTest, FastCheckDBusFailure) { |
| 448 fake_cryptohome_client_.set_call_status(DBUS_METHOD_CALL_FAILURE); | 449 fake_cryptohome_client_.set_call_status(DBUS_METHOD_CALL_FAILURE); |
| 449 verifier_->CheckPlatformState(check_state_callback_); | 450 verifier_->CheckPlatformState(check_state_callback_); |
| 450 base::RunLoop().RunUntilIdle(); | 451 base::RunLoop().RunUntilIdle(); |
| 451 EXPECT_FALSE(check_state_result_); | 452 EXPECT_FALSE(check_state_result_); |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace attestation | 455 } // namespace attestation |
| 455 } // namespace chromeos | 456 } // namespace chromeos |
| OLD | NEW |