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

Side by Side 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, 2 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 unified diff | Download patch
« no previous file with comments | « content/test/fuzzer/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/origin_trials/trial_token.h"
6
5 #include <stddef.h> 7 #include <stddef.h>
6 #include <stdint.h> 8 #include <stdint.h>
7 9
8 #include "base/at_exit.h" 10 #include "base/at_exit.h"
9 #include "base/i18n/icu_util.h" 11 #include "base/i18n/icu_util.h"
12 #include "content/test/fuzzer/fuzzer_support.h"
10 #include "url/gurl.h" 13 #include "url/gurl.h"
11 14
12 struct TestCase { 15 struct TestCase {
13 TestCase() { 16 TestCase() {
14 CHECK(base::i18n::InitializeICU()); 17 CHECK(base::i18n::InitializeICU());
15 } 18 }
16 19
17 // used by ICU integration. 20 // used by ICU integration.
18 base::AtExitManager at_exit_manager; 21 base::AtExitManager at_exit_manager;
19 }; 22 };
20 23
21 TestCase* test_case = new TestCase(); 24 TestCase* test_case = new TestCase();
22 25
23 // Entry point for LibFuzzer. 26 // Entry point for LibFuzzer.
24 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 27 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
25 GURL url(std::string(reinterpret_cast<const char*>(data), size)); 28 content::TrialToken::Parse(std::string(reinterpret_cast<const char*>(data),
29 size));
26 return 0; 30 return 0;
27 } 31 }
OLDNEW
« 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