| # Copyright 2018 The Chromium Authors | 
 | # Use of this source code is governed by a BSD-style license that can be | 
 | # found in the LICENSE file. | 
 |  | 
 | import("//build/config/ui.gni") | 
 | import("//media/gpu/args.gni") | 
 | import("//media/media_options.gni") | 
 |  | 
 | if (enable_av1_decoder && | 
 |     (use_linux_video_acceleration || is_win || is_android)) { | 
 |   test("video_decode_accelerator_tests") { | 
 |     testonly = true | 
 |     sources = [ | 
 |       "video_decode_accelerator_test_suite.cc", | 
 |       "video_decode_accelerator_test_suite.h", | 
 |       "video_decode_accelerator_tests.cc", | 
 |     ] | 
 |     data = [ "//media/test/data/" ] | 
 |     deps = [ | 
 |       ":frame_file_writer", | 
 |       ":frame_validator", | 
 |       ":helpers", | 
 |       ":test_helpers", | 
 |       ":video_player", | 
 |       ":video_player_test_environment", | 
 |       "//base/test:test_support", | 
 |       "//media:test_support", | 
 |       "//media/gpu:buildflags", | 
 |       "//testing/gmock", | 
 |       "//testing/gtest", | 
 |     ] | 
 |  | 
 |     if (is_chromeos || is_linux) { | 
 |       deps += [ "//media/gpu/chromeos:common" ] | 
 |     } | 
 |  | 
 |     if (use_vaapi) { | 
 |       data_deps = [ "//media/gpu/vaapi/test/fake_libva_driver:fake_drv_video" ] | 
 |     } | 
 |  | 
 |     if (use_v4l2_codec) { | 
 |       deps += [ "//media/gpu/v4l2" ] | 
 |     } | 
 |  | 
 |     # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and | 
 |     # enable the diagnostic by removing this line. | 
 |     configs += [ "//build/config/compiler:no_exit_time_destructors" ] | 
 |   } | 
 |  | 
 |   test("video_decode_accelerator_perf_tests") { | 
 |     testonly = true | 
 |     sources = [ "video_decode_accelerator_perf_tests.cc" ] | 
 |     data = [ "//media/test/data/" ] | 
 |     deps = [ | 
 |       ":helpers", | 
 |       ":video_player", | 
 |       ":video_player_test_environment", | 
 |       "//media:test_support", | 
 |       "//media/gpu:buildflags", | 
 |       "//testing/gtest", | 
 |     ] | 
 |  | 
 |     if (use_linux_video_acceleration) { | 
 |       deps += [ "//sandbox/linux:sandbox_services" ] | 
 |     } | 
 |  | 
 |     # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and | 
 |     # enable the diagnostic by removing this line. | 
 |     configs += [ "//build/config/compiler:no_exit_time_destructors" ] | 
 |   } | 
 |  | 
 |   test("video_encode_accelerator_tests") { | 
 |     testonly = true | 
 |     sources = [ "video_encode_accelerator_tests.cc" ] | 
 |     data = [ "//media/test/data/" ] | 
 |     deps = [ | 
 |       ":frame_file_writer", | 
 |       ":frame_validator", | 
 |       ":helpers", | 
 |       ":test_helpers", | 
 |       ":video_encoder", | 
 |       ":video_encoder_test_environment", | 
 |       "//media:test_support", | 
 |       "//media/gpu:buildflags", | 
 |       "//testing/gmock", | 
 |       "//testing/gtest", | 
 |     ] | 
 |  | 
 |     if (is_android) { | 
 |       deps += [ | 
 |         # The test needs the java dependencies to add the java classes for their | 
 |         # native counterparts to the test apk. | 
 |         "//media/base/android:media_java", | 
 |       ] | 
 |     } | 
 |   } | 
 |  | 
 |   test("video_encode_accelerator_perf_tests") { | 
 |     testonly = true | 
 |     sources = [ "video_encode_accelerator_perf_tests.cc" ] | 
 |     data = [ "//media/test/data/" ] | 
 |     deps = [ | 
 |       ":frame_validator", | 
 |       ":helpers", | 
 |       ":test_helpers", | 
 |       ":video_encoder", | 
 |       ":video_encoder_test_environment", | 
 |       "//base/test:test_support", | 
 |       "//media:test_support", | 
 |       "//media/gpu:buildflags", | 
 |       "//testing/gtest", | 
 |     ] | 
 |   } | 
 | } | 
 |  | 
 | source_set("helpers") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "image.cc", | 
 |     "image.h", | 
 |     "image_quality_metrics.cc", | 
 |     "image_quality_metrics.h", | 
 |     "raw_video.cc", | 
 |     "raw_video.h", | 
 |     "video_bitstream.cc", | 
 |     "video_bitstream.h", | 
 |     "video_frame_helpers.cc", | 
 |     "video_frame_helpers.h", | 
 |   ] | 
 |   deps = [ | 
 |     "//base", | 
 |     "//base/test:test_config", | 
 |     "//base/test:test_support", | 
 |     "//crypto", | 
 |     "//gpu:test_support", | 
 |     "//gpu/ipc/common", | 
 |     "//media:test_support", | 
 |     "//media/gpu", | 
 |     "//third_party/ffmpeg", | 
 |     "//third_party/libyuv", | 
 |   ] | 
 |   public_deps = [ "//testing/gtest" ] | 
 |  | 
 |   # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and | 
 |   # enable the diagnostic by removing this line. | 
 |   configs += [ "//build/config/compiler:no_exit_time_destructors" ] | 
 | } | 
 |  | 
 | source_set("frame_validator") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_frame_validator.cc", | 
 |     "video_frame_validator.h", | 
 |   ] | 
 |   deps = [ | 
 |     ":helpers", | 
 |     ":test_helpers", | 
 |     "//crypto", | 
 |     "//gpu:test_support", | 
 |     "//media/gpu", | 
 |     "//testing/gmock", | 
 |   ] | 
 |  | 
 |   # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and | 
 |   # enable the diagnostic by removing this line. | 
 |   configs += [ "//build/config/compiler:no_exit_time_destructors" ] | 
 | } | 
 |  | 
 | source_set("frame_file_writer") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_frame_file_writer.cc", | 
 |     "video_frame_file_writer.h", | 
 |   ] | 
 |   deps = [ | 
 |     ":helpers", | 
 |     "//media/gpu", | 
 |     "//ui/gfx/codec", | 
 |   ] | 
 | } | 
 |  | 
 | source_set("test_helpers") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_test_helpers.cc", | 
 |     "video_test_helpers.h", | 
 |   ] | 
 |   public_deps = [ | 
 |     ":helpers", | 
 |     "//media:test_support", | 
 |   ] | 
 |   deps = [ | 
 |     "//gpu:test_support", | 
 |     "//media/gpu", | 
 |     "//mojo/public/cpp/system", | 
 |     "//testing/gmock", | 
 |     "//testing/gtest", | 
 |     "//third_party/libyuv", | 
 |   ] | 
 | } | 
 |  | 
 | static_library("video_player") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_player/decoder_listener.cc", | 
 |     "video_player/decoder_listener.h", | 
 |     "video_player/decoder_wrapper.cc", | 
 |     "video_player/decoder_wrapper.h", | 
 |     "video_player/frame_renderer_dummy.cc", | 
 |     "video_player/frame_renderer_dummy.h", | 
 |     "video_player/test_vda_video_decoder.cc", | 
 |     "video_player/test_vda_video_decoder.h", | 
 |   ] | 
 |   deps = [ | 
 |     ":test_helpers", | 
 |     "//gpu:test_support", | 
 |     "//media/gpu", | 
 |     "//testing/gmock", | 
 |     "//testing/gtest", | 
 |   ] | 
 |  | 
 |   if (use_linux_video_acceleration) { | 
 |     sources += [ | 
 |       "video_player/mappable_video_frame_converter.cc", | 
 |       "video_player/mappable_video_frame_converter.h", | 
 |     ] | 
 |     deps += [ "//media/gpu/chromeos:common" ] | 
 |   } | 
 | } | 
 |  | 
 | static_library("video_test_environment") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_test_environment.cc", | 
 |     "video_test_environment.h", | 
 |   ] | 
 |  | 
 |   deps = [ | 
 |     ":helpers", | 
 |     "//base", | 
 |     "//base/test:test_support", | 
 |     "//media:test_support", | 
 |     "//media/gpu", | 
 |     "//mojo/core/embedder", | 
 |   ] | 
 |  | 
 |   public_deps = [ | 
 |     ":frame_file_writer", | 
 |     "//testing/gtest", | 
 |   ] | 
 | } | 
 |  | 
 | static_library("video_player_test_environment") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_player/video_player_test_environment.cc", | 
 |     "video_player/video_player_test_environment.h", | 
 |   ] | 
 |   data = [ "//media/test/data/" ] | 
 |   deps = [ | 
 |     ":frame_file_writer", | 
 |     ":helpers", | 
 |     ":video_player", | 
 |     ":video_test_environment", | 
 |     "//media/gpu", | 
 |   ] | 
 | } | 
 |  | 
 | static_library("video_encoder") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "bitstream_helpers.cc", | 
 |     "bitstream_helpers.h", | 
 |     "video_encoder/bitstream_file_writer.cc", | 
 |     "video_encoder/bitstream_file_writer.h", | 
 |     "video_encoder/bitstream_validator.cc", | 
 |     "video_encoder/bitstream_validator.h", | 
 |     "video_encoder/decoder_buffer_validator.cc", | 
 |     "video_encoder/decoder_buffer_validator.h", | 
 |     "video_encoder/video_encoder.cc", | 
 |     "video_encoder/video_encoder.h", | 
 |     "video_encoder/video_encoder_client.cc", | 
 |     "video_encoder/video_encoder_client.h", | 
 |   ] | 
 |   public_deps = [ "//third_party/libgav1:libgav1_parser" ] | 
 |   deps = [ | 
 |     ":test_helpers", | 
 |     "//gpu:test_support", | 
 |     "//media/gpu", | 
 |     "//testing/gmock", | 
 |     "//testing/gtest", | 
 |   ] | 
 | } | 
 |  | 
 | static_library("video_encoder_test_environment") { | 
 |   testonly = true | 
 |   sources = [ | 
 |     "video_encoder/video_encoder_test_environment.cc", | 
 |     "video_encoder/video_encoder_test_environment.h", | 
 |   ] | 
 |   data = [ "//media/test/data/" ] | 
 |   public_deps = [ | 
 |     ":helpers", | 
 |     ":video_test_environment", | 
 |     "//media/gpu", | 
 |   ] | 
 |   deps = [ "//base" ] | 
 | } | 
 |  | 
 | if (use_linux_video_acceleration) { | 
 |   static_library("image_processor") { | 
 |     testonly = true | 
 |     sources = [ | 
 |       "image_processor/image_processor_client.cc", | 
 |       "image_processor/image_processor_client.h", | 
 |     ] | 
 |     deps = [ | 
 |       ":helpers", | 
 |       "//gpu:test_support", | 
 |       "//media:test_support", | 
 |       "//media/gpu", | 
 |       "//media/gpu/chromeos", | 
 |       "//testing/gmock", | 
 |       "//testing/gtest", | 
 |       "//third_party/libyuv", | 
 |     ] | 
 |     data = [ "//media/test/data/" ] | 
 |   } | 
 | } | 
 |  | 
 | if (is_chromeos) { | 
 |   static_library("local_gpu_memory_buffer_manager") { | 
 |     testonly = true | 
 |     sources = [ | 
 |       "test_gbm_buffer_manager.cc", | 
 |       "test_gbm_buffer_manager.h", | 
 |     ] | 
 |     deps = [ | 
 |       "//base", | 
 |       "//build/config/linux/libdrm", | 
 |       "//gpu/command_buffer/client", | 
 |       "//gpu/ipc/common:surface_handle_type", | 
 |       "//third_party/minigbm", | 
 |       "//ui/gfx:memory_buffer", | 
 |       "//ui/gfx/geometry", | 
 |       "//ui/gfx/linux:gbm", | 
 |     ] | 
 |   } | 
 | } |