blob: 8d50f70145a89a197451c2e701643ca99ba08115 [file] [log] [blame]
# Copyright 2021 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
static_library("loader") {
has_pedantic_warnings = true
sources = [
"blob_fetcher.cc",
"blob_fetcher.h",
"cache_fetcher.cc",
"cache_fetcher.h",
"cors_preflight.cc",
"cors_preflight.h",
"cors_preflight_cache.cc",
"cors_preflight_cache.h",
"decoder.h",
"embedded_fetcher.cc",
"embedded_fetcher.h",
"error_fetcher.cc",
"error_fetcher.h",
"fetch_interceptor_coordinator.cc",
"fetch_interceptor_coordinator.h",
"fetcher.cc",
"fetcher.h",
"fetcher_cache.cc",
"fetcher_cache.h",
"fetcher_factory.cc",
"fetcher_factory.h",
"file_fetcher.cc",
"file_fetcher.h",
"font/remote_typeface_cache.h",
"font/typeface_decoder.cc",
"font/typeface_decoder.h",
"image/animated_image_tracker.cc",
"image/animated_image_tracker.h",
"image/animated_webp_image.cc",
"image/animated_webp_image.h",
"image/dummy_gif_image_decoder.cc",
"image/dummy_gif_image_decoder.h",
"image/failure_image_decoder.h",
"image/image.h",
"image/image_cache.h",
"image/image_data_decoder.cc",
"image/image_data_decoder.h",
"image/image_decoder.cc",
"image/image_decoder.h",
"image/image_decoder_starboard.cc",
"image/image_decoder_starboard.h",
"image/image_encoder.cc",
"image/image_encoder.h",
"image/jpeg_image_decoder.cc",
"image/jpeg_image_decoder.h",
"image/lottie_animation.cc",
"image/lottie_animation.h",
"image/lottie_animation_decoder.cc",
"image/lottie_animation_decoder.h",
"image/png_image_decoder.cc",
"image/png_image_decoder.h",
"image/stub_image_decoder.h",
"image/threaded_image_decoder_proxy.cc",
"image/threaded_image_decoder_proxy.h",
"image/webp_image_decoder.cc",
"image/webp_image_decoder.h",
"loader.cc",
"loader.h",
"loader_factory.cc",
"loader_factory.h",
"loader_types.h",
"mesh/mesh_cache.h",
"mesh/mesh_decoder.cc",
"mesh/mesh_decoder.h",
"mesh/mesh_projection.h",
"mesh/projection_codec/constants.h",
"mesh/projection_codec/indexed_vert.cc",
"mesh/projection_codec/indexed_vert.h",
"mesh/projection_codec/projection_decoder.cc",
"mesh/projection_codec/projection_decoder.h",
"net_fetcher.cc",
"net_fetcher.h",
"resource_cache.cc",
"resource_cache.h",
"script_loader_factory.cc",
"script_loader_factory.h",
"switches.cc",
"switches.h",
"sync_loader.cc",
"sync_loader.h",
"text_decoder.h",
"url_fetcher_string_writer.cc",
"url_fetcher_string_writer.h",
]
configs -= [ "//starboard/build/config:size" ]
configs += [ "//starboard/build/config:speed" ]
deps = [
":embed_loader_resources_as_header_files",
":origin",
"//cobalt/base",
"//cobalt/configuration",
"//cobalt/csp",
"//cobalt/math",
"//cobalt/network",
"//cobalt/render_tree",
"//cobalt/renderer/test/png_utils",
"//cobalt/web",
"//nb",
"//third_party/libjpeg-turbo:libjpeg",
"//third_party/libpng",
"//third_party/libwebp",
"//third_party/protobuf:protobuf_lite",
"//url",
]
if (!is_gold) {
sources += [
"about_fetcher.cc",
"about_fetcher.h",
]
defines = [ "ENABLE_ABOUT_SCHEME" ]
deps += [ "//cobalt/renderer/test/jpeg_utils" ]
}
}
static_library("origin") {
sources = [
"origin.cc",
"origin.h",
]
deps = [
"//base",
"//url",
]
}
action("embed_loader_resources_as_header_files") {
script = "//cobalt/build/generate_data_header.py"
inputs = [
"embedded_resources/black_splash_screen.html",
"embedded_resources/cobalt_splash_screen.css",
"embedded_resources/cobalt_splash_screen.html",
"embedded_resources/cobalt_word_logo_356.png",
"embedded_resources/dialog.css",
"embedded_resources/dialog.js",
"embedded_resources/equirectangular_40_40.msh",
"embedded_resources/splash_screen.js",
"embedded_resources/unable_message.html.template",
"embedded_resources/update_message.html.template",
"embedded_resources/black_splash_screen.html",
"embedded_resources/cobalt_splash_screen.html",
]
outputs = [ "$target_gen_dir/embedded_resources.h" ]
args = [
"LoaderEmbeddedResources",
rebase_path(outputs[0], root_build_dir),
rebase_path("embedded_resources", root_build_dir),
]
}
target(gtest_target_type, "loader_test") {
testonly = true
has_pedantic_warnings = true
sources = [
"blob_fetcher_test.cc",
"fetcher_factory_test.cc",
"fetcher_test.h",
"file_fetcher_test.cc",
"font/typeface_decoder_test.cc",
"image/image_decoder_test.cc",
"image/image_decoder_unit_test.cc",
"loader_test.cc",
"mesh/mesh_decoder_test.cc",
"text_decoder_test.cc",
]
configs -= [ "//starboard/build/config:size" ]
configs += [ "//starboard/build/config:speed" ]
deps = [
":loader",
"//cobalt/base:base",
"//cobalt/dom",
"//cobalt/dom_parser",
"//cobalt/math:math",
"//cobalt/render_tree",
"//cobalt/test:run_all_unittests",
"//testing/gmock",
"//testing/gtest",
"//third_party/ots:ots",
]
data_deps = [ ":copy_loader_test_data" ]
}
copy("copy_loader_test_data") {
install_content = true
sources = [
"testdata/baseline_jpeg.jpg",
"testdata/empty.txt",
"testdata/icons.ttf",
"testdata/icons.woff",
"testdata/icons.woff2",
"testdata/interlaced_png.png",
"testdata/non_interlaced_png.png",
"testdata/performance-spike.html",
"testdata/progressive_jpeg.jpg",
"testdata/projection.box",
"testdata/sandbox01.jpg",
"testdata/sandbox01.png",
"testdata/sandbox01.webp",
"testdata/sandbox02.jpg",
"testdata/sandbox02.png",
"testdata/sandbox02.webp",
"testdata/sandbox03.jpg",
"testdata/sandbox03.png",
"testdata/sandbox03.webp",
"testdata/sandbox04.jpg",
"testdata/sandbox04.webp",
"testdata/sandbox05.jpg",
"testdata/sandbox05.webp",
"testdata/sandbox06.jpg",
"testdata/sandbox06.webp",
"testdata/sandbox07.jpg",
"testdata/sandbox07.webp",
"testdata/sandbox08.jpg",
"testdata/sandbox08.webp",
"testdata/sandbox09.jpg",
"testdata/sandbox09.webp",
"testdata/sandbox10.jpg",
"testdata/sandbox10.webp",
"testdata/sandbox11.jpg",
"testdata/sandbox11.webp",
"testdata/sandbox12.jpg",
"testdata/sandbox12.webp",
"testdata/sandbox13.jpg",
"testdata/sandbox14.jpg",
"testdata/sandbox14.webp",
"testdata/sandbox15.jpg",
"testdata/sandbox15.webp",
"testdata/sandbox16.jpg",
"testdata/sandbox16.webp",
"testdata/sandbox17.jpg",
"testdata/sandbox18.jpg",
"testdata/vsauce_sm.webp",
"testdata/webp_image.webp",
]
file_path = "{{source_root_relative_dir}}/{{source_file_part}}"
outputs = [ "$sb_static_contents_output_data_dir/test/$file_path" ]
}