| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ | 5 #ifndef MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ |
| 6 #define MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ | 6 #define MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <limits> |
| 9 |
| 8 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 9 #include "media/base/demuxer.h" | 11 #include "media/base/demuxer.h" |
| 10 #include "media/base/pipeline_status.h" | 12 #include "media/base/pipeline_status.h" |
| 11 #include "media/filters/chunk_demuxer.h" | 13 #include "media/filters/chunk_demuxer.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 13 | 15 |
| 14 namespace media { | 16 namespace media { |
| 15 | 17 |
| 16 // Indicates that the whole file should be appended. | 18 // Indicates that the whole file should be appended. |
| 17 extern const size_t kAppendWholeFile; | 19 constexpr size_t kAppendWholeFile = std::numeric_limits<size_t>::max(); |
| 18 | 20 |
| 19 // Helper class that emulates calls made on the ChunkDemuxer by the | 21 // Helper class that emulates calls made on the ChunkDemuxer by the |
| 20 // Media Source API. | 22 // Media Source API. |
| 21 class MockMediaSource { | 23 class MockMediaSource { |
| 22 public: | 24 public: |
| 23 MockMediaSource(const std::string& filename, | 25 MockMediaSource(const std::string& filename, |
| 24 const std::string& mimetype, | 26 const std::string& mimetype, |
| 25 size_t initial_append_size); | 27 size_t initial_append_size); |
| 26 ~MockMediaSource(); | 28 ~MockMediaSource(); |
| 27 | 29 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 PipelineStatusCB demuxer_failure_cb_; | 80 PipelineStatusCB demuxer_failure_cb_; |
| 79 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 81 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 80 base::TimeDelta last_timestamp_offset_; | 82 base::TimeDelta last_timestamp_offset_; |
| 81 | 83 |
| 82 DISALLOW_COPY_AND_ASSIGN(MockMediaSource); | 84 DISALLOW_COPY_AND_ASSIGN(MockMediaSource); |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } // namespace media | 87 } // namespace media |
| 86 | 88 |
| 87 #endif // MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ | 89 #endif // MEDIA_TEST_MOCK_MEDIA_SOURCE_H_ |
| OLD | NEW |