diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 23:52:02 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 23:52:02 +0000 |
commit | d9d3ff3e2010839f81ef5522cb14dfb2a08dc401 (patch) | |
tree | 79fd3e3590fa4323072f9396659fb3835bb8f566 /media | |
parent | 81d05c6f01a286a4ca537f20c2637570204a87b2 (diff) | |
download | chromium_src-d9d3ff3e2010839f81ef5522cb14dfb2a08dc401.zip chromium_src-d9d3ff3e2010839f81ef5522cb14dfb2a08dc401.tar.gz chromium_src-d9d3ff3e2010839f81ef5522cb14dfb2a08dc401.tar.bz2 |
Fix crashing in FFmpegGlueTest.Write and friends
BUG=36037
TEST=FFmpegGlueTest.* runs on build bot
FFmpegGlueTest.Write was crashing on build bots due to that it
has dependencies on previous test to run. And strangely the build bot
didn't run all the test cases, resulting the crash.
This is fixed by extracting the initialization step and putting it
into a common test setup task.
Review URL: http://codereview.chromium.org/668034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/ffmpeg_glue_unittest.cc | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/media/filters/ffmpeg_glue_unittest.cc b/media/filters/ffmpeg_glue_unittest.cc index 65e4878..3bf65e4 100644 --- a/media/filters/ffmpeg_glue_unittest.cc +++ b/media/filters/ffmpeg_glue_unittest.cc @@ -35,10 +35,20 @@ class MockProtocol : public FFmpegURLProtocol { class FFmpegGlueTest : public ::testing::Test { public: FFmpegGlueTest() { + } + + virtual void SetUp() { MockFFmpeg::set(&mock_ffmpeg_); + + // Singleton should initialize FFmpeg. + CHECK(FFmpegGlue::get()); + + // Assign our static copy of URLProtocol for the rest of the tests. + protocol_ = MockFFmpeg::protocol(); + CHECK(protocol_); } - virtual ~FFmpegGlueTest() { + virtual void TearDown() { MockFFmpeg::set(NULL); } @@ -67,13 +77,6 @@ class FFmpegGlueTest : public ::testing::Test { URLProtocol* FFmpegGlueTest::protocol_ = NULL; TEST_F(FFmpegGlueTest, InitializeFFmpeg) { - // Singleton should initialize FFmpeg. - FFmpegGlue* glue = FFmpegGlue::get(); - EXPECT_TRUE(glue); - - // Assign our static copy of URLProtocol for the rest of the tests. - protocol_ = MockFFmpeg::protocol(); - // Make sure URLProtocol was filled out correctly. EXPECT_STREQ("http", protocol_->name); EXPECT_TRUE(protocol_->url_close); @@ -182,9 +185,7 @@ TEST_F(FFmpegGlueTest, OpenClose) { mock_ffmpeg_.CheckPoint(2); } -// This test is crashing on build bot. See bug: -// http://code.google.com/p/chromium/issues/detail?id=36037. -TEST_F(FFmpegGlueTest, DISABLED_Write) { +TEST_F(FFmpegGlueTest, Write) { scoped_ptr<StrictMock<MockProtocol> > protocol( new StrictMock<MockProtocol>()); URLContext context; @@ -202,9 +203,7 @@ TEST_F(FFmpegGlueTest, DISABLED_Write) { protocol_->url_close(&context); } -// This test is crashing on build bot. See bug: -// http://code.google.com/p/chromium/issues/detail?id=36037. -TEST_F(FFmpegGlueTest, DISABLED_Read) { +TEST_F(FFmpegGlueTest, Read) { scoped_ptr<StrictMock<MockProtocol> > protocol( new StrictMock<MockProtocol>()); URLContext context; @@ -230,9 +229,7 @@ TEST_F(FFmpegGlueTest, DISABLED_Read) { protocol_->url_close(&context); } -// This test is crashing on build bot. See bug: -// http://code.google.com/p/chromium/issues/detail?id=36037. -TEST_F(FFmpegGlueTest, DISABLED_Seek) { +TEST_F(FFmpegGlueTest, Seek) { scoped_ptr<StrictMock<MockProtocol> > protocol( new StrictMock<MockProtocol>()); URLContext context; @@ -308,9 +305,7 @@ TEST_F(FFmpegGlueTest, DISABLED_Seek) { protocol_->url_close(&context); } -// This test is crashing on build bot. See bug: -// http://code.google.com/p/chromium/issues/detail?id=36037. -TEST_F(FFmpegGlueTest, DISABLED_Destroy) { +TEST_F(FFmpegGlueTest, Destroy) { // Create our protocol and add them to the glue layer. scoped_ptr<StrictMock<Destroyable<MockProtocol> > > protocol( new StrictMock<Destroyable<MockProtocol> >()); |