blob: 6aafac9f6987d3312581a2884ad05fa703da8a34 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ash/attestation/mock_tpm_challenge_key.h"
#include <utility>
using ::testing::Invoke;
using ::testing::WithArgs;
namespace ash {
namespace attestation {
MockTpmChallengeKey::MockTpmChallengeKey() = default;
MockTpmChallengeKey::~MockTpmChallengeKey() = default;
void MockTpmChallengeKey::EnableFake() {
ON_CALL(*this, BuildResponse)
.WillByDefault(WithArgs<2>(
Invoke(this, &MockTpmChallengeKey::FakeBuildResponseSuccess)));
}
void MockTpmChallengeKey::FakeBuildResponseSuccess(
TpmChallengeKeyCallback callback) {
std::move(callback).Run(
TpmChallengeKeyResult::MakeChallengeResponse("response"));
}
} // namespace attestation
} // namespace ash