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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "chrome/browser/chromeos/attestation/attestation_signed_data.pb.h" | |
18 #include "chrome/browser/chromeos/attestation/fake_certificate.h" | 17 #include "chrome/browser/chromeos/attestation/fake_certificate.h" |
19 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" | 18 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
20 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 19 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
21 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" | 20 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" |
22 #include "chrome/browser/profiles/profile_impl.h" | 21 #include "chrome/browser/profiles/profile_impl.h" |
23 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chromeos/attestation/attestation.pb.h" |
24 #include "chromeos/attestation/mock_attestation_flow.h" | 24 #include "chromeos/attestation/mock_attestation_flow.h" |
25 #include "chromeos/cryptohome/mock_async_method_caller.h" | 25 #include "chromeos/cryptohome/mock_async_method_caller.h" |
26 #include "chromeos/dbus/fake_cryptohome_client.h" | 26 #include "chromeos/dbus/fake_cryptohome_client.h" |
27 #include "chromeos/settings/cros_settings_names.h" | 27 #include "chromeos/settings/cros_settings_names.h" |
28 #include "content/public/test/test_browser_thread.h" | 28 #include "content/public/test/test_browser_thread.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
30 | 30 |
31 using testing::_; | 31 using testing::_; |
32 using testing::DoAll; | 32 using testing::DoAll; |
33 using testing::Invoke; | 33 using testing::Invoke; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 TEST_F(PlatformVerificationFlowTest, AttestationNotPrepared) { | 398 TEST_F(PlatformVerificationFlowTest, AttestationNotPrepared) { |
399 fake_cryptohome_client_.set_attestation_enrolled(false); | 399 fake_cryptohome_client_.set_attestation_enrolled(false); |
400 fake_cryptohome_client_.set_attestation_prepared(false); | 400 fake_cryptohome_client_.set_attestation_prepared(false); |
401 verifier_->ChallengePlatformKey(NULL, kTestID, kTestChallenge, callback_); | 401 verifier_->ChallengePlatformKey(NULL, kTestID, kTestChallenge, callback_); |
402 base::RunLoop().RunUntilIdle(); | 402 base::RunLoop().RunUntilIdle(); |
403 EXPECT_EQ(PlatformVerificationFlow::PLATFORM_NOT_VERIFIED, result_); | 403 EXPECT_EQ(PlatformVerificationFlow::PLATFORM_NOT_VERIFIED, result_); |
404 } | 404 } |
405 | 405 |
406 } // namespace attestation | 406 } // namespace attestation |
407 } // namespace chromeos | 407 } // namespace chromeos |
OLD | NEW |