blob: 1d092089b26db5461fb5db92036059a23d82919d [file] [log] [blame]
// Copyright (c) 2012 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.
#ifndef CHAPS_SLOT_MANAGER_MOCK_H_
#define CHAPS_SLOT_MANAGER_MOCK_H_
#include <string>
#include <vector>
#include <base/macros.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "chaps/slot_manager.h"
#include "pkcs11/cryptoki.h"
namespace chaps {
class SlotManagerMock : public SlotManager {
public:
SlotManagerMock();
virtual ~SlotManagerMock();
MOCK_METHOD0(GetSlotCount, int());
MOCK_CONST_METHOD2(IsTokenPresent, bool(const brillo::SecureBlob&, int));
MOCK_CONST_METHOD2(IsTokenAccessible, bool(const brillo::SecureBlob&,
int));
MOCK_CONST_METHOD3(GetSlotInfo, void(const brillo::SecureBlob&, int,
CK_SLOT_INFO*));
MOCK_CONST_METHOD3(GetTokenInfo, void(const brillo::SecureBlob&, int,
CK_TOKEN_INFO*));
MOCK_CONST_METHOD2(GetMechanismInfo, MechanismMap* (
const brillo::SecureBlob&, int));
MOCK_METHOD3(OpenSession, int(const brillo::SecureBlob&, int, bool));
MOCK_METHOD2(CloseSession, bool(const brillo::SecureBlob&, int));
MOCK_METHOD2(CloseAllSessions, void(const brillo::SecureBlob&, int));
MOCK_CONST_METHOD3(GetSession, bool(const brillo::SecureBlob&, int,
Session**));
private:
DISALLOW_COPY_AND_ASSIGN(SlotManagerMock);
};
} // namespace chaps
#endif // CHAPS_SLOT_MANAGER_MOCK_H_