blob: 598bcb35e586af54b66464c4aac2754cde8eac6e [file] [log] [blame]
// Copyright (c) 2014 The Chromium OS 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 "cryptohome/mock_chaps_client_factory.h"
#include <chaps/token_manager_client_mock.h>
#include <gmock/gmock.h>
using testing::_;
using testing::DoAll;
using testing::NiceMock;
using testing::Return;
using testing::SetArgPointee;
namespace cryptohome {
MockChapsClientFactory::MockChapsClientFactory() {}
MockChapsClientFactory::~MockChapsClientFactory() {}
chaps::TokenManagerClient* MockChapsClientFactory::New() {
NiceMock<chaps::TokenManagerClientMock>* mock =
new NiceMock<chaps::TokenManagerClientMock>();
ON_CALL(*mock, LoadToken(_, _, _, _, _))
.WillByDefault(DoAll(SetArgPointee<4>(0), Return(true)));
return mock;
}
} // namespace cryptohome