blob: a82efc6e1d80f5822d66659ece26c59d57b15a1d [file] [log] [blame]
tbarzic340a4aa2011-06-09 20:27:58 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Alex Vakulenko015efd12014-07-30 16:23:04 -07005#ifndef IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_
6#define IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_
7
Ben Chan26c33e72014-08-07 00:30:44 -07008#include <stdint.h>
9
tbarzic340a4aa2011-06-09 20:27:58 -070010#include <string>
11
Ben Chan617dbb82014-06-17 22:46:34 -070012#include <gmock/gmock.h>
13#include <gtest/gtest.h>
14
15#include "image-burner/image_burner_utils_interfaces.h"
tbarzic340a4aa2011-06-09 20:27:58 -070016
17namespace imageburn {
18
19class MockFileSystemWriter : public FileSystemWriter {
20 public:
Ben Chan5be44ff2019-09-19 13:24:03 -070021 MOCK_METHOD(bool, Open, (const char*), (override));
22 MOCK_METHOD(bool, Close, (), (override));
23 MOCK_METHOD(int, Write, (const char*, int), (override));
tbarzic340a4aa2011-06-09 20:27:58 -070024};
25
26class MockFileSystemReader : public FileSystemReader {
27 public:
Ben Chan5be44ff2019-09-19 13:24:03 -070028 MOCK_METHOD(bool, Open, (const char*), (override));
29 MOCK_METHOD(bool, Close, (), (override));
30 MOCK_METHOD(int64_t, GetSize, (), (override));
31 MOCK_METHOD(int, Read, (char*, int), (override));
tbarzic340a4aa2011-06-09 20:27:58 -070032};
33
34class MockSignalSender : public SignalSender {
35 public:
Ben Chan5be44ff2019-09-19 13:24:03 -070036 MOCK_METHOD(void,
37 SendFinishedSignal,
38 (const char*, bool, const char*),
39 (override));
40 MOCK_METHOD(void,
41 SendProgressSignal,
42 (int64_t, int64_t, const char*),
43 (override));
tbarzic340a4aa2011-06-09 20:27:58 -070044};
45
Ben Chan58869eb2017-03-20 12:40:33 -070046class MockPathGetter : public PathGetter {
tbarzic340a4aa2011-06-09 20:27:58 -070047 public:
Ben Chan5be44ff2019-09-19 13:24:03 -070048 MOCK_METHOD(bool, GetRealPath, (const char*, std::string*), (override));
49 MOCK_METHOD(bool, GetRootPath, (std::string*), (override));
tbarzic340a4aa2011-06-09 20:27:58 -070050};
51
Ben Chan617dbb82014-06-17 22:46:34 -070052} // namespace imageburn
tbarzic340a4aa2011-06-09 20:27:58 -070053
Alex Vakulenko015efd12014-07-30 16:23:04 -070054#endif // IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_