Chromium Code Reviews| 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) |