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

Side by Side Diff: testing/libfuzzer/fuzzers/media_pipeline_fuzzer.cc

Issue 1757603002: media: Add media pipeline fuzzer test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 4 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
xhwang 2016/03/02 00:57:04 What's the recommendation about the location of th
kcc2 2016/03/02 01:00:11 My recommendation is to keep the fuzzing targets c
xhwang 2016/03/02 01:20:41 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/at_exit.h"
6 #include "base/command_line.h"
7 #include "base/logging.h"
8 #include "media/base/pipeline_status.h"
9 #include "media/test/pipeline_integration_test_base.h"
10
11 // Entry point for LibFuzzer.
12 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
13 // Media pipeline starts new threads, which needs AtExitManager.
14 base::AtExitManager at_exit;
15
16 // Media pipeline checks command line arguments internally.
17 base::CommandLine::Init(0, NULL);
DaleCurtis 2016/03/02 01:05:39 nullptr ?
xhwang 2016/03/02 01:20:41 Done.
18
19 media::PipelineIntegrationTestBase test;
20
21 DVLOG(1) << "Start";
kcc2 2016/03/02 01:00:11 No logging please -- it just slows down fuzzing.
xhwang 2016/03/02 01:20:41 Done.
22 media::PipelineStatus pipeline_status =
23 test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
24 if (pipeline_status != media::PIPELINE_OK)
25 return 0;
26
27 DVLOG(1) << "Play";
28 test.Play();
29 pipeline_status = test.WaitUntilEndedOrError();
30 if (pipeline_status != media::PIPELINE_OK)
31 return 0;
32
33 DVLOG(1) << "Seek";
34 test.Seek(base::TimeDelta::FromMilliseconds(0));
DaleCurtis 2016/03/02 01:05:39 Also just base::TimeDelta() here.
xhwang 2016/03/02 01:20:41 Done.
35
36 return 0;
37 }
OLDNEW
« testing/libfuzzer/fuzzers/BUILD.gn ('K') | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698