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

Unified Diff: media/test/pipeline_integration_fuzzertest.cc

Issue 1761603002: media: Handle "encrypted" event in pipeline_integration_fuzzertest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only 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
Index: media/test/pipeline_integration_fuzzertest.cc
diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc
index a00b3281a9b3fb935cb52dbebeb3c28c1a1c2e55..0ffd817664a5f813f550a92a9855fb46cfabdab6 100644
--- a/media/test/pipeline_integration_fuzzertest.cc
+++ b/media/test/pipeline_integration_fuzzertest.cc
@@ -4,13 +4,26 @@
#include <stddef.h>
#include <stdint.h>
+#include <vector>
#include "base/at_exit.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "media/base/eme_constants.h"
#include "media/base/pipeline_status.h"
#include "media/test/pipeline_integration_test_base.h"
+namespace {
+
+void OnEncryptedMediaInitData(media::PipelineIntegrationTestBase* test,
+ media::EmeInitDataType /* type */,
+ const std::vector<uint8_t>& /* init_data */) {
+ test->OnError(media::PIPELINE_ERROR_INITIALIZATION_FAILED);
ddorwin 2016/03/03 17:47:47 LOG(WARNING) with an explanation? At least explain
xhwang 2016/03/03 19:41:32 fuzzer owners don't like logs in fuzzer tests: ht
ddorwin 2016/03/03 19:46:20 As a comment then? This one might be worth loggin
xhwang 2016/03/03 21:13:31 Added a comment and a TODO.
+}
+
+} // namespace
+
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Media pipeline starts new threads, which needs AtExitManager.
@@ -21,6 +34,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
media::PipelineIntegrationTestBase test;
+ test.set_encrypted_media_init_data_cb(
+ base::Bind(&OnEncryptedMediaInitData, &test));
+
media::PipelineStatus pipeline_status =
test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
if (pipeline_status != media::PIPELINE_OK)
« no previous file with comments | « no previous file | media/test/pipeline_integration_test_base.h » ('j') | media/test/pipeline_integration_test_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698