#include "media/muxers/webm_muxer.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <string_view>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/ranges/algorithm.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "media/base/audio_codecs.h"
#include "media/base/audio_parameters.h"
#include "media/base/channel_layout.h"
#include "media/base/decoder_buffer.h"
#include "media/base/media_tracks.h"
#include "media/base/mock_media_log.h"
#include "media/base/stream_parser.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/video_codecs.h"
#include "media/base/video_frame.h"
#include "media/formats/webm/webm_stream_parser.h"
#include "media/muxers/live_webm_muxer_delegate.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AllOf;
AnyNumber;
AtLeast;
ElementsAre;
Eq;
InSequence;
Mock;
Not;
Pair;
Pointee;
Property;
Return;
Sequence;
TestWithParam;
UnorderedElementsAre;
ValuesIn;
WithArgs;
namespace media {
struct TestParams { … };
class WebmMuxerTest : public TestWithParam<TestParams> { … };
TEST_P(WebmMuxerTest, Write) { … }
TEST_P(WebmMuxerTest, OnEncodedVideoTwoFrames) { … }
TEST_P(WebmMuxerTest, OnEncodedVideoTwoAlphaFrames) { … }
TEST_P(WebmMuxerTest, OnEncodedAudioTwoFrames) { … }
TEST_P(WebmMuxerTest, ColorSpaceREC709IsPropagatedToTrack) { … }
TEST_P(WebmMuxerTest, ColorSpaceExtendedSRGBIsPropagatedToTrack) { … }
TEST_P(WebmMuxerTest, ColorSpaceHDR10IsPropagatedToTrack) { … }
TEST_P(WebmMuxerTest, ColorSpaceFullRangeHDR10IsPropagatedToTrack) { … }
const TestParams kTestCases[] = …;
INSTANTIATE_TEST_SUITE_P(…);
class WebmMuxerTestUnparametrized : public testing::Test { … };
TEST_F(WebmMuxerTestUnparametrized, HoldsAudioFramesBeforeVideo) { … }
TEST_F(WebmMuxerTestUnparametrized, HoldsVideoFramesBeforeAudio) { … }
TEST_F(WebmMuxerTestUnparametrized, HoldsAudioFramesUntilVideo) { … }
TEST_F(WebmMuxerTestUnparametrized, HoldsVideoFramesUntilAudio) { … }
TEST_F(WebmMuxerTestUnparametrized, EmitsVideoRightAway) { … }
TEST_F(WebmMuxerTestUnparametrized, EmitsAudioRightAway) { … }
TEST_F(WebmMuxerTestUnparametrized, HoldsDataUntilDurationExpiry) { … }
TEST_F(WebmMuxerTestUnparametrized, DurationExpiryLimitedByMaxFrequency) { … }
TEST_F(WebmMuxerTestUnparametrized, ForwardsAudioMuxingError) { … }
TEST_F(WebmMuxerTestUnparametrized, ForwardsVideoMuxingError) { … }
TEST_F(WebmMuxerTestUnparametrized, ForwardsAudioVideoMuxingError) { … }
}