attestation: make dep injection easier

Ensure that dependencies are propagated to
Attestation prior to use.  They could be pushed
via chained set_*() calls, but that seems unecessary
at present.

Additionally, define MockAttestation to avoid needing
to do dep injection all the time.

TEST=unittests pass in link
BUG=none

Change-Id: I4508008546fb4e65279681ca890d58be86fcfc22
Reviewed-on: https://chromium-review.googlesource.com/187700
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
6 files changed
tree: 80649378c6e8405012eee989466bc38f2b7a2f6c
  1. etc/
  2. attestation.cc
  3. attestation.h
  4. attestation.proto
  5. attestation_task.cc
  6. attestation_task.h
  7. attestation_unittest.cc
  8. common.mk
  9. credentials.h
  10. crypto.cc
  11. crypto.h
  12. crypto_unittest.cc
  13. cryptohome-path.cc
  14. cryptohome.cc
  15. cryptohome.xml
  16. cryptohome_common.h
  17. cryptohome_event_source.cc
  18. cryptohome_event_source.h
  19. cryptohome_event_source_unittest.cc
  20. cryptohome_testrunner.cc
  21. cryptohomed.cc
  22. cryptolib.cc
  23. cryptolib.h
  24. dbus_transition.cc
  25. dbus_transition.h
  26. email_to_image
  27. homedirs.cc
  28. homedirs.h
  29. homedirs_unittest.cc
  30. inherit-review-settings-ok
  31. install_attributes.cc
  32. install_attributes.h
  33. install_attributes.proto
  34. install_attributes_unittest.cc
  35. interface.cc
  36. interface.h
  37. key_parameters.proto
  38. keystore.h
  39. LICENSE
  40. lockbox-cache-main.cc
  41. lockbox-cache-tpm.cc
  42. lockbox-cache-tpm.h
  43. lockbox-cache.cc
  44. lockbox-cache.h
  45. lockbox.cc
  46. lockbox.h
  47. lockbox_unittest.cc
  48. make_tests.cc
  49. make_tests.h
  50. make_tests.sh
  51. Makefile
  52. marshal.list
  53. mock_attestation.h
  54. mock_crypto.h
  55. mock_homedirs.cc
  56. mock_homedirs.h
  57. mock_install_attributes.cc
  58. mock_install_attributes.h
  59. mock_keystore.cc
  60. mock_keystore.h
  61. mock_lockbox.cc
  62. mock_lockbox.h
  63. mock_mount.cc
  64. mock_mount.h
  65. mock_mount_factory.h
  66. mock_pkcs11_init.cc
  67. mock_pkcs11_init.h
  68. mock_platform.cc
  69. mock_platform.h
  70. mock_service.cc
  71. mock_service.h
  72. mock_tpm.cc
  73. mock_tpm.h
  74. mock_user_oldest_activity_timestamp_cache.cc
  75. mock_user_oldest_activity_timestamp_cache.h
  76. mock_user_session.cc
  77. mock_user_session.h
  78. mock_vault_keyset.cc
  79. mock_vault_keyset.h
  80. mock_vault_keyset_factory.h
  81. mount-encrypted.c
  82. mount-encrypted.h
  83. mount-helpers.c
  84. mount-helpers.h
  85. mount.cc
  86. mount.h
  87. mount_factory.cc
  88. mount_factory.h
  89. mount_stack.cc
  90. mount_stack.h
  91. mount_stack_unittest.cc
  92. mount_task.cc
  93. mount_task.h
  94. mount_task_unittest.cc
  95. mount_unittest.cc
  96. OWNERS
  97. pam_mount.conf.xml
  98. pkcs11_init.cc
  99. pkcs11_init.h
  100. pkcs11_keystore.cc
  101. pkcs11_keystore.h
  102. pkcs11_keystore_unittest.cc
  103. platform.cc
  104. platform.h
  105. README
  106. README.dbus
  107. README.homedirs
  108. README.lockbox
  109. README.tpm
  110. service.cc
  111. service.h
  112. service_unittest.cc
  113. stateful_recovery.cc
  114. stateful_recovery.h
  115. stateful_recovery_unittest.cc
  116. stub_tpm.h
  117. tpm.cc
  118. tpm.h
  119. tpm_init.cc
  120. tpm_init.h
  121. tpm_status.proto
  122. user_oldest_activity_timestamp_cache.cc
  123. user_oldest_activity_timestamp_cache.h
  124. user_oldest_activity_timestamp_cache_unittest.cc
  125. user_session.cc
  126. user_session.h
  127. user_session_unittest.cc
  128. username_passkey.cc
  129. username_passkey.h
  130. username_passkey_unittest.cc
  131. vault_keyset.cc
  132. vault_keyset.h
  133. vault_keyset.proto
  134. vault_keyset_factory.cc
  135. vault_keyset_factory.h
  136. vault_keyset_unittest.cc
  137. WATCHLISTS