Commit c59b53c1 authored by Michael Ershov's avatar Michael Ershov Committed by Commit Bot

Rewrite unit tests for TpmChallengeKey

Before this CL tpm_challenge_key_unittest.cc contained tests for
TpmChallengeKey, TpmChallengeKeySubtle and TpmChallengeKeyResult.
Now it will test only TpmChallengeKey, other parts are separated
into their own test sets (in previous CL).

Bug: 1090723
Test: TpmChallenge*
Change-Id: I66aa20a6d69e77a2865b77bacc819d0be61756d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2228555
Commit-Queue: Michael Ershov <miersh@google.com>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797252}
parent 115ebd8b
...@@ -4,26 +4,21 @@ ...@@ -4,26 +4,21 @@
#include "chrome/browser/chromeos/attestation/tpm_challenge_key.h" #include "chrome/browser/chromeos/attestation/tpm_challenge_key.h"
#include "base/base64.h" #include <memory>
#include <string>
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/check_op.h" #include "base/memory/weak_ptr.h"
#include "base/compiler_specific.h" #include "base/sequence_checker.h"
#include "base/strings/stringprintf.h" #include "chrome/browser/chromeos/attestation/tpm_challenge_key_result.h"
#include "base/values.h" #include "chrome/browser/chromeos/attestation/tpm_challenge_key_subtle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/attestation/attestation_ca_client.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chromeos/cryptohome/async_method_caller.h" #include "chromeos/dbus/constants/attestation_constants.h"
#include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/tpm/install_attributes.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
class Profile;
class AttestationFlow;
namespace chromeos { namespace chromeos {
namespace attestation { namespace attestation {
......
...@@ -559,15 +559,5 @@ void TpmChallengeKeySubtleImpl::RegisterKeyCallback( ...@@ -559,15 +559,5 @@ void TpmChallengeKeySubtleImpl::RegisterKeyCallback(
std::move(callback_).Run(Result::MakeSuccess()); std::move(callback_).Run(Result::MakeSuccess());
} }
void TpmChallengeKeySubtleImpl::RunCallback(
const TpmChallengeKeyResult& result) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!callback_.is_null());
TpmChallengeKeyCallback local_callback = std::move(callback_);
callback_.Reset();
std::move(local_callback).Run(result);
// |this| may be destructed after |callback_| is run.
}
} // namespace attestation } // namespace attestation
} // namespace chromeos } // namespace chromeos
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment