Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: content/test/fuzzer/origin_trial_token_fuzzer.cc

Issue 2383623002: Add a fuzzer for the Origin Trial token parser (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/fuzzer/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/fuzzer/origin_trial_token_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/url_parse_fuzzer.cc b/content/test/fuzzer/origin_trial_token_fuzzer.cc
similarity index 64%
copy from testing/libfuzzer/fuzzers/url_parse_fuzzer.cc
copy to content/test/fuzzer/origin_trial_token_fuzzer.cc
index e2e814da6e1e6cd70589416d0189a4b00d6dfa2f..8d8ccb619795d6ac132a8ec7171dd8abf40fb616 100644
--- a/testing/libfuzzer/fuzzers/url_parse_fuzzer.cc
+++ b/content/test/fuzzer/origin_trial_token_fuzzer.cc
@@ -1,12 +1,15 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/common/origin_trials/trial_token.h"
+
#include <stddef.h>
#include <stdint.h>
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
+#include "content/test/fuzzer/fuzzer_support.h"
#include "url/gurl.h"
struct TestCase {
@@ -22,6 +25,7 @@ TestCase* test_case = new TestCase();
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- GURL url(std::string(reinterpret_cast<const char*>(data), size));
+ content::TrialToken::Parse(std::string(reinterpret_cast<const char*>(data),
+ size));
return 0;
}
« no previous file with comments | « content/test/fuzzer/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698