#include "third_party/blink/renderer/modules/breakout_box/media_stream_track_processor.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "media/base/video_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
#include "third_party/blink/public/web/web_heap.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_tester.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_stream_track_generator_init.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/readable_stream_default_reader.h"
#include "third_party/blink/renderer/core/streams/writable_stream.h"
#include "third_party/blink/renderer/core/streams/writable_stream_default_writer.h"
#include "third_party/blink/renderer/modules/breakout_box/media_stream_track_generator.h"
#include "third_party/blink/renderer/modules/breakout_box/metrics.h"
#include "third_party/blink/renderer/modules/breakout_box/pushable_media_stream_audio_source.h"
#include "third_party/blink/renderer/modules/breakout_box/pushable_media_stream_video_source.h"
#include "third_party/blink/renderer/modules/breakout_box/stream_test_utils.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_track.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_audio_sink.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_sink.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_source.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_track.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_component_impl.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
#include "third_party/blink/renderer/platform/testing/io_task_runner_testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
_;
namespace blink {
namespace {
std::unique_ptr<PushableMediaStreamAudioSource> CreatePushableAudioSource() { … }
PushableMediaStreamVideoSource* CreatePushableVideoSource() { … }
MediaStreamTrack* CreateAudioMediaStreamTrack(
ExecutionContext* context,
std::unique_ptr<MediaStreamAudioSource> source) { … }
}
class MediaStreamTrackProcessorTest : public testing::Test { … };
TEST_F(MediaStreamTrackProcessorTest, VideoFramesAreExposed) { … }
TEST_F(MediaStreamTrackProcessorTest, AudioDataAreExposed) { … }
TEST_F(MediaStreamTrackProcessorTest, CanceledReadableDisconnects) { … }
TEST_F(MediaStreamTrackProcessorTest, ProcessorConnectsToGenerator) { … }
TEST_F(MediaStreamTrackProcessorTest, NullInputTrack) { … }
TEST_F(MediaStreamTrackProcessorTest, EndedTrack) { … }
TEST_F(MediaStreamTrackProcessorTest, VideoCloseOnTrackEnd) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_VideoNoCloseOnTrackDisable …
#else
#define MAYBE_VideoNoCloseOnTrackDisable …
#endif
TEST_F(MediaStreamTrackProcessorTest, MAYBE_VideoNoCloseOnTrackDisable) { … }
TEST_F(MediaStreamTrackProcessorTest, AudioCloseOnTrackEnd) { … }
TEST_F(MediaStreamTrackProcessorTest, AudioNoCloseOnTrackDisable) { … }
}