chromium/content/browser/media/media_capabilities_browsertest.cc

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

#include <string>
#include <string_view>

#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "media/base/media_switches.h"
#include "media/base/test_data_util.h"

namespace {

constexpr std::string_view kDecodeTestFile =;
constexpr std::string_view kSupported =;
constexpr std::u16string_view kSupported16 =;
constexpr std::string_view kUnsupported =;
constexpr std::u16string_view kUnsupported16 =;
constexpr std::string_view kError =;
constexpr std::u16string_view kError16 =;
constexpr std::string_view kFileString =;
constexpr std::string_view kMediaSourceString =;
constexpr std::string_view kWebRtcString =;
constexpr std::string_view kInvalid =;

#if BUILDFLAG(USE_PROPRIETARY_CODECS)
constexpr std::string_view kPropSupported = kSupported;
#else
constexpr std::string_view kPropSupported =;
#endif  // USE_PROPRIETARY_CODECS

enum StreamType {};

enum ConfigType {};

}  // namespace

namespace content {

class MediaCapabilitiesTest : public ContentBrowserTest {};

// Adds param for query type (file vs media-source) to
class MediaCapabilitiesTestWithConfigType
    : public MediaCapabilitiesTest,
      public testing::WithParamInterface<ConfigType> {};

// Cover basic codec support of content types where the answer of support
// (or not) should be common to both "media-source" and "file" query types.
// for more exhaustive codec string testing.
IN_PROC_BROWSER_TEST_P(MediaCapabilitiesTestWithConfigType,
                       CommonVideoDecodeTypes) {}

// Cover basic codec support. See media_canplaytype_browsertest.cc for more
// exhaustive codec string testing.
IN_PROC_BROWSER_TEST_P(MediaCapabilitiesTestWithConfigType,
                       CommonAudioDecodeTypes) {}

IN_PROC_BROWSER_TEST_P(MediaCapabilitiesTestWithConfigType,
                       NonMediaSourceDecodeTypes) {}

// Cover basic spatial rendering support.
IN_PROC_BROWSER_TEST_P(MediaCapabilitiesTestWithConfigType,
                       AudioTypesWithSpatialRendering) {}

// Cover basic HDR support.
IN_PROC_BROWSER_TEST_P(MediaCapabilitiesTestWithConfigType,
                       VideoTypesWithDynamicRange) {}

INSTANTIATE_TEST_SUITE_P();
INSTANTIATE_TEST_SUITE_P();
INSTANTIATE_TEST_SUITE_P();

}  // namespace content