chromium/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_sink_test.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_sink.h"

#include <cstdint>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "media/base/video_frame.h"
#include "testing/gmock/include/gmock/gmock.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/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_video_frame.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/frame_queue_underlying_source.h"
#include "third_party/blink/renderer/modules/breakout_box/pushable_media_stream_video_source.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_sink.h"
#include "third_party/blink/renderer/modules/webcodecs/video_frame.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h"
#include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.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 {
// Some of these tests rely on Now() being at least 1 minute.
// If this is not the case, affected tests might flake and should not run.
// TODO(crbug.com/343870500): Remove this once capture timestamps are exposed
// as part of WebCodecs VideoFrame metadata.
bool IsTooEarlyForTest() {}
}  // namespace

class MediaStreamVideoTrackUnderlyingSinkTest : public testing::Test {};

// TODO(1153092): Test flakes, likely due to completing before background
// thread has had chance to call OnVideoFrame().
TEST_F(MediaStreamVideoTrackUnderlyingSinkTest,
       DISABLED_WriteToStreamForwardsToMediaStreamSink) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest, WriteInvalidDataFails) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest, WriteToAbortedSinkFails) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest, GetGmbManager) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest,
       DeltaTimestampDoesNotWriteCaptureBeginTime) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest,
       CaptureTimestampWritesCaptureBeginTime) {}

TEST_F(MediaStreamVideoTrackUnderlyingSinkTest,
       DecisionToNotWriteCaptureTimeIsSticky) {}

}  // namespace blink