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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
# Copyright 2023 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/buildflag_header.gni")
import("//build/config/ozone.gni")
import("//build/config/ui.gni")
import("//chrome/test/fuzzing/in_process_fuzzer.gni")
import("//testing/libfuzzer/research/domatolpm/domatolpm.gni")
# This target exists to reference other test executables to bring these files
# into the build.
group("test") {
testonly = true
deps = [
"mojo_js_fuzzing:test",
"renderer_fuzzing:test",
"webidl_fuzzing:test",
]
}
if (fuzzing_engine_supports_custom_main) {
static_library("in_process_fuzzer_runner") {
testonly = true
sources = [
"in_process_fuzzer.cc",
"in_process_fuzzer.h",
]
deps = [
":in_process_fuzzer_buildflags",
"//testing/libfuzzer:fuzzing_engine_no_main",
]
if (!is_android) {
# See crbug.com/375763408. We need the locales to properly run our
# fuzzers, but those aren't packed with //chrome/test:test_support for
# windows builds. This ensures we're depending on them for all the
# supported platforms.
deps += [ "//chrome:packed_resources" ]
}
public_deps = [
"//chrome/test:chrome_test_launcher",
"//chrome/test:test_support",
]
}
buildflag_header("in_process_fuzzer_buildflags") {
header = "in_process_fuzzer_buildflags.h"
flags = [
"IS_CENTIPEDE=$use_centipede",
"IS_LIBFUZZER=$use_libfuzzer",
"IS_FUZZILLI=$use_fuzzilli",
# crbug.com/1474421: remove these lines once the bug is fixed.
"DEBUG_CLUSTERFUZZ_FAILURE=$use_libfuzzer",
]
}
source_set("in_process_proto_fuzzer_runner") {
testonly = true
sources = [ "in_process_proto_fuzzer.h" ]
public_deps = [ ":in_process_fuzzer_runner" ]
}
}
if (!is_android) {
in_process_fuzzer("html_in_process_fuzzer") {
sources = [ "html_in_process_fuzzer.cc" ]
dict = "html_in_process_fuzzer.dictionary"
}
in_process_fuzzer("js_in_process_fuzzer") {
sources = [ "js_in_process_fuzzer.cc" ]
deps = [ ":in_process_fuzzer_buildflags" ]
is_fuzzilli_compatible = true
}
in_process_proto_fuzzer("page_load_in_process_fuzzer") {
sources = [ "page_load_in_process_fuzzer.cc" ]
proto_source = "page_load_in_process_fuzzer.proto"
seed_corpus_sources = [
"page_load_in_process_fuzzer_seed_corpus/cross_origin.textproto",
"page_load_in_process_fuzzer_seed_corpus/network.textproto",
"page_load_in_process_fuzzer_seed_corpus/simple.textproto",
]
testcase_proto_kind = "test.fuzzing.page_load_fuzzing.FuzzCase"
}
in_process_proto_fuzzer("speech_synthesis_in_process_fuzzer") {
sources = [ "speech_synthesis_in_process_fuzzer.cc" ]
proto_source = "speech_synthesis_in_process_fuzzer.proto"
}
# Disable kombucha_in_process_fuzzer temporarily https://crbug.com/401073471
# in_process_proto_fuzzer("kombucha_in_process_fuzzer") {
# sources = [
# "kombucha_in_process_fuzzer.cc",
# "kombucha_in_process_fuzzer.h",
# ]
#
# proto_source = "kombucha_in_process_fuzzer.proto"
#
# deps = [
# ":in_process_fuzzer_buildflags",
# "//chrome:packed_resources",
# "//chrome/app:command_ids",
# "//chrome/browser/ui:browser_element_identifiers",
# "//chrome/browser/ui:ui_features",
# ]
#
# # Used for UI controls
# if (use_aura) {
# deps += [ "//ui/aura:test_support" ]
# }
# if (use_aura && use_ozone) {
# deps += [
# "//ui/ozone",
# "//ui/platform_window/common:common",
# ]
# }
# }
# We cannot disable instrumenting protobuf generated files on MSAN builds,
# which makes the build time explode and fail the CQ.
if (!is_msan) {
domatolpm_fuzzer("domato_html_fuzzer_grammar") {
template_file = "//third_party/domato/src/template.html"
grammars = [
"jsfuzzer://chrome/test/fuzzing/domato_html_in_process_fuzzer_grammar/js.txt",
"cssfuzzer://third_party/domato/src/rules/css.txt",
"htmlfuzzer://chrome/test/fuzzing/domato_html_in_process_fuzzer_grammar/html.txt",
]
}
in_process_fuzzer("domato_html_in_process_fuzzer") {
sources = [ "domato_html_in_process_fuzzer.cc" ]
deps = [
":domato_html_fuzzer_grammar",
"//testing/libfuzzer/research/domatolpm:domatolpm_context",
"//third_party/libprotobuf-mutator",
]
}
}
domatolpm_fuzzer("webcodecs_fuzzer_grammar") {
template_file = "//chrome/test/fuzzing/webcodecs_in_process_fuzzer_grammar/template.html"
grammars = [ "webcodecs_fuzzer://chrome/test/fuzzing/webcodecs_in_process_fuzzer_grammar/webcodecs.txt" ]
}
in_process_fuzzer("webcodecs_in_process_fuzzer") {
sources = [ "webcodecs_in_process_fuzzer.cc" ]
deps = [
":webcodecs_fuzzer_grammar",
"//chrome/test/fuzzing:in_process_proto_fuzzer_runner",
"//testing/libfuzzer/research/domatolpm:domatolpm_context",
"//third_party/libprotobuf-mutator",
]
}
domatolpm_fuzzer("notification_service_fuzzer_grammar") {
template_file = "//chrome/test/fuzzing/notification_service_in_process_fuzzer_grammar/template.js"
grammars = [ "notification_service_fuzzer://chrome/test/fuzzing/notification_service_in_process_fuzzer_grammar/notification_service.txt" ]
}
copy("notification_service_in_process_fuzzer_html") {
sources = [ "//chrome/test/fuzzing/notification_service_in_process_fuzzer_grammar/notification_service_in_process_fuzzer.html" ]
outputs = [ "$root_out_dir/notification_service_in_process_fuzzer.html" ]
}
in_process_fuzzer("notification_service_in_process_fuzzer") {
sources = [ "notification_service_in_process_fuzzer.cc" ]
deps = [
":notification_service_fuzzer_grammar",
":notification_service_in_process_fuzzer_html",
"//chrome/test/fuzzing:in_process_proto_fuzzer_runner",
"//testing/libfuzzer/research/domatolpm:domatolpm_context",
"//third_party/libprotobuf-mutator",
]
data_deps = [ ":notification_service_in_process_fuzzer_html" ]
data = [ "$root_gen_dir/" ]
}
if (is_linux) {
in_process_proto_fuzzer("atspi_in_process_fuzzer") {
sources = [ "atspi_in_process_fuzzer.cc" ]
libfuzzer_options = [
"max_len=4096",
"timeout=90",
]
centipede_options = [ "timeout=90" ]
proto_source = "atspi_in_process_fuzzer.proto"
deps = [ "//sql" ]
}
}
}
|