tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 1 | // 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 Vakulenko | 015efd1 | 2014-07-30 16:23:04 -0700 | [diff] [blame] | 5 | #ifndef IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_ |
| 6 | #define IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_ |
| 7 | |
Ben Chan | 26c33e7 | 2014-08-07 00:30:44 -0700 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 10 | #include <string> |
| 11 | |
Ben Chan | 617dbb8 | 2014-06-17 22:46:34 -0700 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | #include <gtest/gtest.h> |
| 14 | |
| 15 | #include "image-burner/image_burner_utils_interfaces.h" |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 16 | |
| 17 | namespace imageburn { |
| 18 | |
| 19 | class MockFileSystemWriter : public FileSystemWriter { |
| 20 | public: |
Ben Chan | 5be44ff | 2019-09-19 13:24:03 -0700 | [diff] [blame] | 21 | MOCK_METHOD(bool, Open, (const char*), (override)); |
| 22 | MOCK_METHOD(bool, Close, (), (override)); |
| 23 | MOCK_METHOD(int, Write, (const char*, int), (override)); |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | class MockFileSystemReader : public FileSystemReader { |
| 27 | public: |
Ben Chan | 5be44ff | 2019-09-19 13:24:03 -0700 | [diff] [blame] | 28 | 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)); |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | class MockSignalSender : public SignalSender { |
| 35 | public: |
Ben Chan | 5be44ff | 2019-09-19 13:24:03 -0700 | [diff] [blame] | 36 | 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)); |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
Ben Chan | 58869eb | 2017-03-20 12:40:33 -0700 | [diff] [blame] | 46 | class MockPathGetter : public PathGetter { |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 47 | public: |
Ben Chan | 5be44ff | 2019-09-19 13:24:03 -0700 | [diff] [blame] | 48 | MOCK_METHOD(bool, GetRealPath, (const char*, std::string*), (override)); |
| 49 | MOCK_METHOD(bool, GetRootPath, (std::string*), (override)); |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
Ben Chan | 617dbb8 | 2014-06-17 22:46:34 -0700 | [diff] [blame] | 52 | } // namespace imageburn |
tbarzic | 340a4aa | 2011-06-09 20:27:58 -0700 | [diff] [blame] | 53 | |
Alex Vakulenko | 015efd1 | 2014-07-30 16:23:04 -0700 | [diff] [blame] | 54 | #endif // IMAGE_BURNER_IMAGE_BURNER_TEST_UTILS_H_ |