Shaka Packager SDK
Loading...
Searching...
No Matches
mock_aes_cryptor.h
1// Copyright 2018 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_MEDIA_BASE_MOCK_AES_CRYPTOR_H_
8#define PACKAGER_MEDIA_BASE_MOCK_AES_CRYPTOR_H_
9
10#include <cstdint>
11
12#include <packager/media/base/aes_cryptor.h>
13
14namespace shaka {
15namespace media {
16
17class MockAesCryptor : public AesCryptor {
18 public:
19 MockAesCryptor() : AesCryptor(kDontUseConstantIv) {}
20
21 MOCK_METHOD2(InitializeWithIv,
22 bool(const std::vector<uint8_t>& key,
23 const std::vector<uint8_t>& iv));
24 MOCK_METHOD4(CryptInternal,
25 bool(const uint8_t* text,
26 size_t text_size,
27 uint8_t* crypt_text,
28 size_t* crypt_text_size));
29 MOCK_METHOD0(SetIvInternal, void());
30};
31
32} // namespace media
33} // namespace shaka
34
35#endif // PACKAGER_MEDIA_BASE_MOCK_AES_CRYPTOR_H_
virtual bool InitializeWithIv(const std::vector< uint8_t > &key, const std::vector< uint8_t > &iv)=0
const std::vector< uint8_t > & iv() const
Definition aes_cryptor.h:86
All the methods that are virtual are virtual for mocking.