1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34

media / filters / stream_parser_factory_unittest.cc [blame]

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

#include "media/filters/stream_parser_factory.h"

#include "base/test/scoped_feature_list.h"
#include "media/base/media_switches.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media {

TEST(StreamParserFactoryTest, HlsProbeParserTest) {
  EXPECT_NE(StreamParserFactory::CreateRelaxedParser(
                RelaxedParserSupportedType::kMP2T),
            nullptr);
  EXPECT_NE(StreamParserFactory::CreateRelaxedParser(
                RelaxedParserSupportedType::kAAC),
            nullptr);

  // These are feature gated!
  EXPECT_EQ(StreamParserFactory::CreateRelaxedParser(
                RelaxedParserSupportedType::kMP4),
            nullptr);

  {
    base::test::ScopedFeatureList enable_mp4{kBuiltInHlsMP4};
    EXPECT_NE(StreamParserFactory::CreateRelaxedParser(
                  RelaxedParserSupportedType::kMP4),
              nullptr);
  }
}

}  // namespace media