chromium/media/gpu/vaapi/vaapi_image_decode_accelerator_worker_unittest.cc

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

#include <stddef.h>
#include <stdint.h>
#include <va/va.h>

#include <memory>
#include <utility>
#include <vector>

#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_info.h"
#include "gpu/ipc/service/image_decode_accelerator_worker.h"
#include "media/gpu/vaapi/vaapi_image_decode_accelerator_worker.h"
#include "media/gpu/vaapi/vaapi_image_decoder.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/linux/native_pixmap_dmabuf.h"
#include "ui/gfx/native_pixmap_handle.h"

_;
AllOf;
InSequence;
IsNull;
NotNull;
Property;
Return;
StrictMock;

namespace media {
namespace {

constexpr gfx::BufferFormat kFormatForDecodes =;

constexpr gfx::Size kVaSurfaceResolution(128, 256);

constexpr gfx::Size kVisibleSize(120, 250);

constexpr size_t kWebPFileAndVp8ChunkHeaderSizeInBytes =;

// clang-format off
constexpr uint8_t kJpegPFileHeader[] =;

constexpr uint8_t kLossyWebPFileHeader[] =;
// clang-format on

constexpr base::span<const uint8_t, 3u> kJpegEncodedData =;

constexpr base::span<const uint8_t, kWebPFileAndVp8ChunkHeaderSizeInBytes>
    kLossyWebPEncodedData =;

class MockNativePixmapDmaBuf : public gfx::NativePixmapDmaBuf {};

class MockVaapiImageDecoder : public VaapiImageDecoder {};

}  // namespace

class VaapiImageDecodeAcceleratorWorkerTest : public testing::Test {};

ACTION_P2(ExportAsNativePixmapDmaBufSuccessfully,
          va_surface_resolution,
          visible_size) {}

TEST_F(VaapiImageDecodeAcceleratorWorkerTest, ImageDecodeSucceeds) {}

TEST_F(VaapiImageDecodeAcceleratorWorkerTest, ImageDecodeFails) {}

TEST_F(VaapiImageDecodeAcceleratorWorkerTest, UnknownImageDecodeFails) {}

}  // namespace media