From 65590011ef779b4bdaf64c87a358f809a19c1367 Mon Sep 17 00:00:00 2001 From: dalecurtis Date: Mon, 5 Jan 2015 18:02:56 -0800 Subject: [PATCH] Enable PipelineIntegrationTests in mojo! This hooks up our pipeline integration tests into mojo and removes the existing primitive pipeline test. There's a bit of nastiness with mojo not setting up the media library or command line, probably something we'll want in its own module later. The following tests had to be disabled because the actual rendering happens in a separate process and required information is unavailable: - Any tests which perform hash checks. - Any tests which exercise EME. - Any tests which look at the video frame formats. There also seems to be a couple intermittent crashes which need to be debugged in follow up investigations: - Sometimes all tests complete successfully but a "Segmentation fault (core dumped)" shows after printing the summary. No core is actually written and it won't happen under gdb thus far :-/ - Once the WriteDataRaw() call in MojoDemuxerStreamImpl() failed with MOJO_RESULT_FAILED_PRECONDITION for reasons unknown. BUG=440850 TEST=all enabled tests pass! Review URL: https://codereview.chromium.org/806443002 Cr-Commit-Position: refs/heads/master@{#310036} --- media/mojo/services/BUILD.gn | 22 +--- media/mojo/services/media_renderer_apptest.cc | 162 -------------------------- media/test/BUILD.gn | 38 ++++++ media/test/DEPS | 3 + media/test/pipeline_integration_test.cc | 147 +++++++++++++++++------ media/test/pipeline_integration_test_base.h | 2 +- 6 files changed, 157 insertions(+), 217 deletions(-) delete mode 100644 media/mojo/services/media_renderer_apptest.cc create mode 100644 media/test/DEPS diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn index c014a00f45f9..6096a079e247 100644 --- a/media/mojo/services/BUILD.gn +++ b/media/mojo/services/BUILD.gn @@ -163,28 +163,16 @@ if (!is_component_build) { ] } - # Not a 'test' because this is loaded via mojo_shell as an app. - # To run the test: + # Note, this 'test' must be loaded via mojo_shell as an app: + # # out/Debug/mojo_shell mojo:media_test - # You can get "mojo_shell" using mojo/public/tools/download_shell_binary.py + # + # To get "mojo_shell" you must specify "use_prebuilt_mojo_shell=true" in GN. mojo_native_application("media_test") { testonly = true - sources = [ - "media_renderer_apptest.cc", - ] deps = [ - ":media", - ":renderer_proxy", - "//base", - "//media", - "//media/mojo/interfaces", - "//media:shared_memory_support", - "//mojo/application", - "//mojo/application:test_support", - "//mojo/common", - "//mojo/environment:chromium", - "//mojo/public/c/system:for_shared_library", + "//media/test:mojo_pipeline_integration_tests", ] } } diff --git a/media/mojo/services/media_renderer_apptest.cc b/media/mojo/services/media_renderer_apptest.cc deleted file mode 100644 index 99d60ec5eff2..000000000000 --- a/media/mojo/services/media_renderer_apptest.cc +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2014 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/bind.h" -#include "base/message_loop/message_loop.h" -#include "base/run_loop.h" -#include "media/base/audio_decoder_config.h" -#include "media/base/channel_layout.h" -#include "media/base/demuxer_stream_provider.h" -#include "media/base/sample_format.h" -#include "media/base/video_decoder_config.h" -#include "media/mojo/services/mojo_renderer_impl.h" -#include "mojo/public/cpp/application/application_delegate.h" -#include "mojo/public/cpp/application/application_impl.h" -#include "mojo/public/cpp/application/application_test_base.h" -#include "mojo/public/cpp/application/connect.h" - -namespace { - -// This class is here to give the gtest class access to the -// mojo::ApplicationImpl so that the tests can connect to other applications. -class MojoRendererTestHelper : public mojo::ApplicationDelegate { - public: - MojoRendererTestHelper() : application_impl_(NULL) {} - ~MojoRendererTestHelper() override {} - - // ApplicationDelegate implementation. - void Initialize(mojo::ApplicationImpl* app) override { - application_impl_ = app; - } - - mojo::ApplicationImpl* application_impl() { return application_impl_; } - - private: - mojo::ApplicationImpl* application_impl_; - - DISALLOW_COPY_AND_ASSIGN(MojoRendererTestHelper); -}; - -// TODO(tim): Make media::FakeDemuxerStream support audio and use that for the -// DemuxerStream implementation instead. -class FakeDemuxerStream : public media::DemuxerStreamProvider, - public media::DemuxerStream { - public: - FakeDemuxerStream() {} - ~FakeDemuxerStream() override {} - - // media::Demuxer implementation. - media::DemuxerStream* GetStream(media::DemuxerStream::Type type) override { - if (type == media::DemuxerStream::AUDIO) - return this; - return nullptr; - } - - // media::DemuxerStream implementation. - void Read(const ReadCB& read_cb) override {} - - media::AudioDecoderConfig audio_decoder_config() override { - media::AudioDecoderConfig config; - config.Initialize(media::kCodecAAC, - media::kSampleFormatU8, - media::CHANNEL_LAYOUT_SURROUND, - 48000, - NULL, - 0, - false, - false, - base::TimeDelta(), - 0); - return config; - } - - media::VideoDecoderConfig video_decoder_config() override { - NOTREACHED(); - return media::VideoDecoderConfig(); - } - - media::DemuxerStream::Type type() const override { - return media::DemuxerStream::AUDIO; - } - - void EnableBitstreamConverter() override {} - - bool SupportsConfigChanges() override { return true; } - - media::VideoRotation video_rotation() override { - NOTREACHED(); - return media::VIDEO_ROTATION_0; - } - - private: - DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); -}; - -} // namespace - -namespace media { - -class MojoRendererTest : public mojo::test::ApplicationTestBase { - public: - MojoRendererTest() : service_provider_(NULL) {} - ~MojoRendererTest() override {} - - protected: - // ApplicationTestBase implementation. - mojo::ApplicationDelegate* GetApplicationDelegate() override { - return &mojo_renderer_test_helper_; - } - - void SetUp() override { - ApplicationTestBase::SetUp(); - demuxer_stream_provider_.reset(new FakeDemuxerStream()); - service_provider_ = - application_impl() - ->ConnectToApplication("mojo:media") - ->GetServiceProvider(); - } - - mojo::MediaRendererPtr CreateMediaRenderer() { - mojo::MediaRendererPtr mojo_media_renderer; - mojo::ConnectToService(service_provider_, - &mojo_media_renderer); - return mojo_media_renderer.Pass(); - } - - DemuxerStreamProvider* stream_provider() { - return demuxer_stream_provider_.get(); - } - scoped_refptr task_runner() { - return base::MessageLoop::current()->task_runner(); - } - - private: - MojoRendererTestHelper mojo_renderer_test_helper_; - scoped_ptr demuxer_stream_provider_; - mojo::ServiceProvider* service_provider_; - - DISALLOW_COPY_AND_ASSIGN(MojoRendererTest); -}; - -void ErrorCallback(PipelineStatus* output, PipelineStatus status) { - *output = status; -} - -// Tests that a MojoRendererImpl can successfully establish communication -// with a MojoRendererService and set up a MojoDemuxerStream -// connection. The test also initializes a media::AudioRendererImpl which -// will error-out expectedly due to lack of support for decoder selection. -TEST_F(MojoRendererTest, BasicInitialize) { - MojoRendererImpl mojo_renderer_impl(task_runner(), CreateMediaRenderer()); - PipelineStatus expected_error(PIPELINE_OK); - mojo_renderer_impl.Initialize( - stream_provider(), base::MessageLoop::current()->QuitClosure(), - media::StatisticsCB(), media::BufferingStateCB(), - media::Renderer::PaintCB(), base::Closure(), - base::Bind(&ErrorCallback, &expected_error)); - base::MessageLoop::current()->Run(); - EXPECT_EQ(PIPELINE_OK, expected_error); -} - -} // namespace media diff --git a/media/test/BUILD.gn b/media/test/BUILD.gn index 2ce266bf48fe..1337e9e28aab 100644 --- a/media/test/BUILD.gn +++ b/media/test/BUILD.gn @@ -71,3 +71,41 @@ source_set("pipeline_integration_perftests") { ] } } + +if (!is_component_build) { + source_set("mojo_pipeline_integration_tests") { + testonly = true + + if (media_use_ffmpeg) { + sources = [ + "pipeline_integration_test.cc", + ] + + defines = [ "MOJO_RENDERER" ] + + deps = [ + ":pipeline_integration_test_base", + "//base", + "//base/test:test_support", + "//media", + "//media:test_support", + "//media/audio:test_support", + "//media/base:test_support", + "//media/mojo/interfaces", + "//media/mojo/services:media", + "//media/mojo/services:renderer_proxy", + "//media/mojo/services:renderer_service", + "//mojo/application", + "//mojo/application:test_support", + "//testing/gtest", + "//ui/gfx/geometry", + "//ui/gfx:test_support", + + # TODO(dalecurtis): Required since the gmock header is included in the + # header for pipeline_integration_test_base.h. This should be moved into + # the .cc file to avoid the extra dependency here. + "//testing/gmock", + ] + } + } +} diff --git a/media/test/DEPS b/media/test/DEPS new file mode 100644 index 000000000000..ef8ad28d9d44 --- /dev/null +++ b/media/test/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+mojo/public", +] diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc index 279c12221ce2..aa61f3a9d16d 100644 --- a/media/test/pipeline_integration_test.cc +++ b/media/test/pipeline_integration_test.cc @@ -10,6 +10,7 @@ #include "media/base/cdm_callback_promise.h" #include "media/base/cdm_context.h" #include "media/base/decoder_buffer.h" +#include "media/base/media.h" #include "media/base/media_keys.h" #include "media/base/media_switches.h" #include "media/base/test_data_util.h" @@ -20,6 +21,30 @@ #include "media/test/pipeline_integration_test_base.h" #include "testing/gmock/include/gmock/gmock.h" +#if defined(MOJO_RENDERER) +#include "media/mojo/services/mojo_renderer_impl.h" +#include "mojo/public/cpp/application/application_impl.h" +#include "mojo/public/cpp/application/application_test_base.h" +#include "mojo/public/cpp/application/connect.h" + +// TODO(dalecurtis): The mojo renderer is in another process, so we have no way +// currently to get hashes for video and audio samples. This also means that +// real audio plays out for each test. +#define EXPECT_HASH_EQ(a, b) +#define EXPECT_VIDEO_FORMAT_EQ(a, b) + +// TODO(xhwang): EME support is not complete for the mojo renderer, so all +// encrypted tests are currently disabled. +#define DISABLE_EME_TESTS 1 + +// TODO(xhwang,dalecurtis): Text tracks are not currently supported by the mojo +// renderer. +#define DISABLE_TEXT_TRACK_TESTS 1 +#else +#define EXPECT_HASH_EQ(a, b) EXPECT_EQ(a, b) +#define EXPECT_VIDEO_FORMAT_EQ(a, b) EXPECT_EQ(a, b) +#endif + using testing::_; using testing::AnyNumber; using testing::AtLeast; @@ -40,9 +65,11 @@ const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\""; #if defined(USE_PROPRIETARY_CODECS) const char kADTS[] = "audio/aac"; const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; -const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; +#if !defined(DISABLE_EME_TESTS) +const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; +#endif // !defined(DISABLE_EME_TESTS) const char kMP3[] = "audio/mpeg"; #endif // defined(USE_PROPRIETARY_CODECS) @@ -70,8 +97,10 @@ const int kVP9WebMFileDurationMs = 2736; const int kVP8AWebMFileDurationMs = 2733; #if defined(USE_PROPRIETARY_CODECS) +#if !defined(DISABLE_EME_TESTS) const int k640IsoFileDurationMs = 2737; const int k640IsoCencFileDurationMs = 2736; +#endif // !defined(DISABLE_EME_TESTS) const int k1280IsoFileDurationMs = 2736; const int k1280IsoAVC3FileDurationMs = 2736; #endif // defined(USE_PROPRIETARY_CODECS) @@ -556,9 +585,41 @@ class MockMediaSource { base::TimeDelta last_timestamp_offset_; }; -class PipelineIntegrationTest - : public testing::Test, - public PipelineIntegrationTestBase { +#if defined(MOJO_RENDERER) +class PipelineIntegrationTestHost : public mojo::test::ApplicationTestBase, + public PipelineIntegrationTestBase { + public: + bool ShouldCreateDefaultRunLoop() override { return false; } + + void SetUp() override { + ApplicationTestBase::SetUp(); + + // TODO(dalecurtis): For some reason this isn't done... + if (!base::CommandLine::InitializedForCurrentProcess()) { + base::CommandLine::Init(0, NULL); + InitializeMediaLibraryForTesting(); + } + } + + protected: + scoped_ptr CreateRenderer() override { + mojo::ServiceProvider* service_provider = + application_impl() + ->ConnectToApplication("mojo://media") + ->GetServiceProvider(); + + mojo::MediaRendererPtr mojo_media_renderer; + mojo::ConnectToService(service_provider, &mojo_media_renderer); + return make_scoped_ptr(new MojoRendererImpl(message_loop_.task_runner(), + mojo_media_renderer.Pass())); + } +}; +#else +class PipelineIntegrationTestHost : public testing::Test, + public PipelineIntegrationTestBase {}; +#endif + +class PipelineIntegrationTest : public PipelineIntegrationTestHost { public: void StartPipelineWithMediaSource(MockMediaSource* source) { EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1)); @@ -686,8 +747,8 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackHashed) { ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash()); - EXPECT_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash()); + EXPECT_HASH_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash()); + EXPECT_HASH_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash()); EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null()); } @@ -698,8 +759,8 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackLive) { ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash()); - EXPECT_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash()); + EXPECT_HASH_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash()); + EXPECT_HASH_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash()); // TODO: Fix FFmpeg code to return higher resolution time values so // we don't have to truncate our expectations here. @@ -711,10 +772,11 @@ TEST_F(PipelineIntegrationTest, F32PlaybackHashed) { ASSERT_EQ(PIPELINE_OK, Start("sfx_f32le.wav", kHashed)); Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(std::string(kNullVideoHash), GetVideoHash()); - EXPECT_EQ("3.03,2.86,2.99,3.31,3.57,4.06,", GetAudioHash()); + EXPECT_HASH_EQ(std::string(kNullVideoHash), GetVideoHash()); + EXPECT_HASH_EQ("3.03,2.86,2.99,3.31,3.57,4.06,", GetAudioHash()); } +#if !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, BasicPlaybackEncrypted) { FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); set_encrypted_media_init_data_cb( @@ -729,6 +791,7 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackEncrypted) { ASSERT_TRUE(WaitUntilOnEnded()); Stop(); } +#endif // !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource) { MockMediaSource source("bear-320x240.webm", kWebM, 219229); @@ -842,7 +905,7 @@ TEST_F(PipelineIntegrationTest, DISABLED_MediaSource_Opus_Seeking_WebM) { ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ("0.76,0.20,-0.82,-0.58,-1.29,-0.29,", GetAudioHash()); + EXPECT_HASH_EQ("0.76,0.20,-0.82,-0.58,-1.29,-0.29,", GetAudioHash()); source.Abort(); Stop(); @@ -873,6 +936,7 @@ TEST_F(PipelineIntegrationTest, MediaSource_ConfigChange_WebM) { Stop(); } +#if !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, MediaSource_ConfigChange_Encrypted_WebM) { MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM, kAppendWholeFile); @@ -957,6 +1021,7 @@ TEST_F(PipelineIntegrationTest, EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); source.Abort(); } +#endif // !defined(DISABLE_EME_TESTS) #if defined(USE_PROPRIETARY_CODECS) TEST_F(PipelineIntegrationTest, MediaSource_ADTS) { @@ -1003,7 +1068,7 @@ TEST_F(PipelineIntegrationTest, MediaSource_ADTS_TimestampOffset) { EXPECT_TRUE(WaitUntilOnEnded()); // Verify preroll is stripped. - EXPECT_EQ("-0.06,0.97,-0.90,-0.70,-0.53,-0.34,", GetAudioHash()); + EXPECT_HASH_EQ("-0.06,0.97,-0.90,-0.70,-0.53,-0.34,", GetAudioHash()); } TEST_F(PipelineIntegrationTest, BasicPlaybackHashed_MP3) { @@ -1014,7 +1079,7 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackHashed_MP3) { ASSERT_TRUE(WaitUntilOnEnded()); // Verify codec delay and preroll are stripped. - EXPECT_EQ("1.30,2.72,4.56,5.08,3.74,2.03,", GetAudioHash()); + EXPECT_HASH_EQ("1.30,2.72,4.56,5.08,3.74,2.03,", GetAudioHash()); } TEST_F(PipelineIntegrationTest, MediaSource_MP3) { @@ -1031,7 +1096,7 @@ TEST_F(PipelineIntegrationTest, MediaSource_MP3) { EXPECT_TRUE(WaitUntilOnEnded()); // Verify that codec delay was stripped. - EXPECT_EQ("1.01,2.71,4.18,4.32,3.04,1.12,", GetAudioHash()); + EXPECT_HASH_EQ("1.01,2.71,4.18,4.32,3.04,1.12,", GetAudioHash()); } TEST_F(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { @@ -1098,6 +1163,7 @@ TEST_F(PipelineIntegrationTest, MediaSource_ConfigChange_MP4) { Stop(); } +#if !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly) { MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, @@ -1211,6 +1277,7 @@ TEST_F(PipelineIntegrationTest, EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); source.Abort(); } +#endif // !defined(DISABLE_EME_TESTS) // Verify files which change configuration midstream fail gracefully. TEST_F(PipelineIntegrationTest, MidStreamConfigChangesFail) { @@ -1227,6 +1294,7 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_16x9AspectRatio) { ASSERT_TRUE(WaitUntilOnEnded()); } +#if !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, EncryptedPlayback_WebM) { MockMediaSource source("bear-320x240-av_enc-av.webm", kWebM, 219816); FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); @@ -1273,8 +1341,10 @@ TEST_F(PipelineIntegrationTest, EncryptedPlayback_NoEncryptedFrames_WebM) { source.Abort(); Stop(); } +#endif // !defined(DISABLE_EME_TESTS) #if defined(USE_PROPRIETARY_CODECS) +#if !defined(DISABLE_EME_TESTS) TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_VideoOnly) { MockMediaSource source("bear-1280x720-v_frag-cenc.mp4", kMP4Video, kAppendWholeFile); @@ -1341,24 +1411,6 @@ TEST_F(PipelineIntegrationTest, Stop(); } -TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_AVC3) { - MockMediaSource source("bear-1280x720-v_frag-avc3.mp4", kMP4VideoAVC3, - kAppendWholeFile); - StartPipelineWithMediaSource(&source); - source.EndOfStream(); - - EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); - EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); - EXPECT_EQ(k1280IsoAVC3FileDurationMs, - pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); - - Play(); - - ASSERT_TRUE(WaitUntilOnEnded()); - source.Abort(); - Stop(); -} - TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_KeyRotation_Video) { MockMediaSource source("bear-1280x720-v_frag-cenc-key_rotation.mp4", kMP4Video, kAppendWholeFile); @@ -1390,7 +1442,26 @@ TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_KeyRotation_Audio) { source.Abort(); Stop(); } -#endif +#endif // !defined(DISABLE_EME_TESTS) + +TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_AVC3) { + MockMediaSource source("bear-1280x720-v_frag-avc3.mp4", kMP4VideoAVC3, + kAppendWholeFile); + StartPipelineWithMediaSource(&source); + source.EndOfStream(); + + EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); + EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); + EXPECT_EQ(k1280IsoAVC3FileDurationMs, + pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); + + Play(); + + ASSERT_TRUE(WaitUntilOnEnded()); + source.Abort(); + Stop(); +} +#endif // defined(USE_PROPRIETARY_CODECS) TEST_F(PipelineIntegrationTest, SeekWhilePaused) { ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm")); @@ -1459,7 +1530,7 @@ TEST_F(PipelineIntegrationTest, Rotated_Metadata_270) { // Verify audio decoder & renderer can handle aborted demuxer reads. TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) { ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", kAudioOnlyWebM, - 8192, + 16384, base::TimeDelta::FromMilliseconds(464), base::TimeDelta::FromMilliseconds(617), 0x10CA, 19730)); @@ -1501,7 +1572,7 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a.webm")); Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); + EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV12A); } // Verify that VP8A video with odd width/height can be played back. @@ -1509,7 +1580,7 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_Odd_WebM) { ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a-odd-dimensions.webm")); Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); + EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV12A); } // Verify that VP9 video with odd width/height can be played back. @@ -1519,6 +1590,7 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Odd_WebM) { ASSERT_TRUE(WaitUntilOnEnded()); } +#if !defined(DISABLE_TEXT_TRACK_TESTS) // Verify that VP8 video with inband text track can be played back. TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { EXPECT_CALL(*this, OnAddTextTrack(_, _)); @@ -1526,13 +1598,14 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { Play(); ASSERT_TRUE(WaitUntilOnEnded()); } +#endif // !defined(DISABLE_TEXT_TRACK_TESTS) // Verify that VP9 video with 4:4:4 subsampling can be played back. TEST_F(PipelineIntegrationTest, P444_VP9_WebM) { ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-P444.webm")); Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(last_video_frame_format_, VideoFrame::YV24); + EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV24); } // Verify that videos with an odd frame size playback successfully. diff --git a/media/test/pipeline_integration_test_base.h b/media/test/pipeline_integration_test_base.h index 905cb7540867..02eada541826 100644 --- a/media/test/pipeline_integration_test_base.h +++ b/media/test/pipeline_integration_test_base.h @@ -130,7 +130,7 @@ class PipelineIntegrationTestBase { void CreateDemuxer(const std::string& filename); // Creates and returns a Renderer. - scoped_ptr CreateRenderer(); + virtual scoped_ptr CreateRenderer(); void OnVideoFramePaint(const scoped_refptr& frame); -- 2.11.4.GIT