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 <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/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" | 10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" |
11 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" | 11 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
12 #include "chrome/browser/chromeos/settings/cros_settings.h" | 12 #include "chrome/browser/chromeos/settings/cros_settings.h" |
13 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 13 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
14 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" | 14 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
15 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" | |
16 #include "chromeos/attestation/mock_attestation_flow.h" | 15 #include "chromeos/attestation/mock_attestation_flow.h" |
17 #include "chromeos/dbus/mock_cryptohome_client.h" | 16 #include "chromeos/dbus/mock_cryptohome_client.h" |
18 #include "chromeos/settings/cros_settings_names.h" | 17 #include "chromeos/settings/cros_settings_names.h" |
| 18 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" |
19 #include "content/public/test/test_browser_thread.h" | 19 #include "content/public/test/test_browser_thread.h" |
20 #include "crypto/rsa_private_key.h" | 20 #include "crypto/rsa_private_key.h" |
21 #include "net/cert/x509_certificate.h" | 21 #include "net/cert/x509_certificate.h" |
22 #include "net/cert/x509_util.h" | 22 #include "net/cert/x509_util.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 using testing::_; | 25 using testing::_; |
26 using testing::Invoke; | 26 using testing::Invoke; |
27 using testing::StrictMock; | 27 using testing::StrictMock; |
28 using testing::WithArgs; | 28 using testing::WithArgs; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 SetupMocks(MOCK_NEW_KEY, ""); | 299 SetupMocks(MOCK_NEW_KEY, ""); |
300 // Simulate a DBus failure. | 300 // Simulate a DBus failure. |
301 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _, _)) | 301 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _, _)) |
302 .WillOnce(WithArgs<3>(Invoke(DBusCallbackError))) | 302 .WillOnce(WithArgs<3>(Invoke(DBusCallbackError))) |
303 .WillRepeatedly(WithArgs<3>(Invoke(DBusCallbackFalse))); | 303 .WillRepeatedly(WithArgs<3>(Invoke(DBusCallbackFalse))); |
304 Run(); | 304 Run(); |
305 } | 305 } |
306 | 306 |
307 } // namespace attestation | 307 } // namespace attestation |
308 } // namespace chromeos | 308 } // namespace chromeos |
OLD | NEW |