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

Unified Diff: media/test/pipeline_integration_fuzzertest.cc

Issue 1757603002: media: Add media pipeline fuzzer test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 10 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 | « media/test/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/pipeline_integration_fuzzertest.cc
diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b9fa6b7c5469b03c36817998f58a9d0c348689d5
--- /dev/null
+++ b/media/test/pipeline_integration_fuzzertest.cc
@@ -0,0 +1,34 @@
+// 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 "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "media/base/pipeline_status.h"
+#include "media/test/pipeline_integration_test_base.h"
+
+// Entry point for LibFuzzer.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // Media pipeline starts new threads, which needs AtExitManager.
+ base::AtExitManager at_exit;
+
+ // Media pipeline checks command line arguments internally.
+ base::CommandLine::Init(0, nullptr);
+
+ media::PipelineIntegrationTestBase test;
+
+ media::PipelineStatus pipeline_status =
+ test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
+ if (pipeline_status != media::PIPELINE_OK)
+ return 0;
+
+ test.Play();
+ pipeline_status = test.WaitUntilEndedOrError();
+ if (pipeline_status != media::PIPELINE_OK)
+ return 0;
+
+ test.Seek(base::TimeDelta());
+
+ return 0;
+}
« no previous file with comments | « media/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698