Commit 796ed59b authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

[third_party] Use FuzzedDataProvider included in LLVM package.

Bug: 991200
Change-Id: Ib7ce5dce09154d5970f664a6caf28f0544a67abd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774224Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Auto-Submit: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691475}
parent 9dd4f35a
......@@ -37,10 +37,7 @@ template("fuzzer_test") {
if (!disable_libfuzzer && (use_fuzzing_engine || is_linux)) {
assert(defined(invoker.sources), "Need sources in $target_name.")
test_deps = [
"//testing/libfuzzer:libfuzzer_main",
"//third_party/libFuzzer:fuzzed_data_provider",
]
test_deps = [ "//testing/libfuzzer:libfuzzer_main" ]
if (defined(invoker.deps)) {
test_deps += invoker.deps
......
......@@ -353,8 +353,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
There is [FuzzedDataProvider] class that might be helpful for writing fuzz
targets using that approach. In order to use it, add
`#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"` to your fuzz
target source file. To learn more about `FuzzedDataProvider`, check out the
`#include <fuzzer/FuzzedDataProvider.h>` to your fuzz target source file. To
learn more about `FuzzedDataProvider`, check out the
[google/fuzzing documentation page] on it.
Note that it's not recommended to use `FuzzedDataProvider` unless you actually
......
......@@ -1561,8 +1561,6 @@ jumbo_static_library("test_support") {
"testing/fake_graphics_layer_client.h",
"testing/font_test_helpers.cc",
"testing/font_test_helpers.h",
"testing/fuzzed_data_provider.cc",
"testing/fuzzed_data_provider.h",
"testing/histogram_tester.cc",
"testing/histogram_tester.h",
"testing/io_task_runner_testing_platform_support.cc",
......@@ -1601,6 +1599,14 @@ jumbo_static_library("test_support") {
"testing/weburl_loader_mock_factory_impl.h",
]
# fuzzed_data_provider may not work with a custom toolchain.
if (custom_toolchain == "") {
sources += [
"testing/fuzzed_data_provider.cc",
"testing/fuzzed_data_provider.h",
]
}
configs += [
":blink_platform_pch",
"//third_party/blink/renderer:config",
......
......@@ -5,10 +5,11 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TESTING_FUZZED_DATA_PROVIDER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TESTING_FUZZED_DATA_PROVIDER_H_
#include <fuzzer/FuzzedDataProvider.h>
#include "base/macros.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"
namespace blink {
......
......@@ -5,10 +5,11 @@
#include <stddef.h>
#include <stdint.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <vector>
#include "third_party/ced/src/compact_enc_det/compact_enc_det.h"
#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"
namespace {
constexpr size_t kMaxInputSize = 64 * 1024;
......
......@@ -5,10 +5,11 @@
#include <stddef.h>
#include <stdint.h>
#include <fuzzer/FuzzedDataProvider.h>
#include "leveldb/db.h"
#include "leveldb/env.h"
#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"
#include "util/testharness.h"
using leveldb::DB;
......
......@@ -80,12 +80,3 @@ if (use_afl) {
configs += fuzzing_engine_add_configs
}
}
source_set("fuzzed_data_provider") {
sources = [
"src/utils/FuzzedDataProvider.h",
]
configs -= fuzzing_engine_remove_configs
configs += fuzzing_engine_add_configs
}
......@@ -7,10 +7,11 @@
#include <stdint.h>
#include <stdlib.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <vector>
#include "base/scoped_generic.h"
#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"
#include "third_party/minizip/src/mz.h"
#include "third_party/minizip/src/mz_strm_mem.h"
#include "third_party/minizip/src/mz_zip.h"
......
......@@ -5,10 +5,11 @@
#include <stddef.h>
#include <stdint.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <string>
#include <vector>
#include "third_party/libFuzzer/src/utils/FuzzedDataProvider.h"
#include "third_party/sfntly/src/cpp/src/sample/chromium/font_subsetter.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment