diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 00:11:07 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 00:11:07 +0000 |
commit | 5214f719b7009c844604ffca4a24d741ec10bb6d (patch) | |
tree | 1a031b75bf46a55ab5380c7eb85bf9ca25338f15 /media/base | |
parent | bacc94464e429a3c650158f3d5c786752506a98c (diff) | |
download | chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.zip chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.tar.gz chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.tar.bz2 |
Make the generated stubs weak. Enable the unittests that had conflicting symbols.
Also move some of the old mocks into their own namespace. They were causing linker confusion due to inlining or something which generated bad test executables that segfaulted.
Review URL: http://codereview.chromium.org/126170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/mock_media_filters.h | 9 | ||||
-rw-r--r-- | media/base/pipeline_impl_unittest.cc | 11 | ||||
-rw-r--r-- | media/base/video_frame_impl_unittest.cc | 4 |
3 files changed, 17 insertions, 7 deletions
diff --git a/media/base/mock_media_filters.h b/media/base/mock_media_filters.h index 1d215c4..b8a8f74 100644 --- a/media/base/mock_media_filters.h +++ b/media/base/mock_media_filters.h @@ -1,6 +1,11 @@ // Copyright (c) 2009 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. +// +// TODO(ajwong): This whole file is deprecated in favor or gmock style mocks. +// The deprecated classes have been moved into the old_mocks to avoid colliding +// with the newer mock classes. Once all the unittests have been migrated, this +// should be deleted. #ifndef MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ #define MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ @@ -20,6 +25,8 @@ namespace media { +namespace old_mocks { + // Behaviors for MockDataSource filter. enum MockDataSourceBehavior { MOCK_DATA_SOURCE_NORMAL_INIT, @@ -667,6 +674,8 @@ class InitializationHelper { DISALLOW_COPY_AND_ASSIGN(InitializationHelper); }; +} // namespace old_mocks + } // namespace media #endif // MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc index adfc3a6..f28ee1c 100644 --- a/media/base/pipeline_impl_unittest.cc +++ b/media/base/pipeline_impl_unittest.cc @@ -36,7 +36,7 @@ class PipelineImplTest : public testing::Test { // was executed, false otherwise. bool InitializeAndWait() { DCHECK(!filters_); - filters_ = new media::MockFilterFactory(&config_); + filters_ = new media::old_mocks::MockFilterFactory(&config_); pipeline_.Start(filters_, "", NewCallback(this, &PipelineImplTest::OnInitialize)); return initialize_event_.TimedWait(base::TimeDelta::FromMilliseconds(500)); @@ -51,8 +51,8 @@ class PipelineImplTest : public testing::Test { // Fixture members. media::PipelineImpl pipeline_; - scoped_refptr<media::MockFilterFactory> filters_; - media::MockFilterConfig config_; + scoped_refptr<media::old_mocks::MockFilterFactory> filters_; + media::old_mocks::MockFilterConfig config_; bool initialize_result_; bool seek_result_; @@ -75,7 +75,7 @@ class PipelineImplTest : public testing::Test { }; TEST_F(PipelineImplTest, NeverInitializes) { - config_.data_source_behavior = media::MOCK_DATA_SOURCE_NEVER_INIT; + config_.data_source_behavior = media::old_mocks::MOCK_DATA_SOURCE_NEVER_INIT; // This test hangs during initialization by never calling // InitializationComplete(). Make sure we tear down the pipeline properly. @@ -96,7 +96,8 @@ TEST_F(PipelineImplTest, RequiredFilterMissing) { } TEST_F(PipelineImplTest, URLNotFound) { - config_.data_source_behavior = media::MOCK_DATA_SOURCE_URL_ERROR_IN_INIT; + config_.data_source_behavior = + media::old_mocks::MOCK_DATA_SOURCE_URL_ERROR_IN_INIT; ASSERT_TRUE(InitializeAndWait()); EXPECT_FALSE(initialize_result_); diff --git a/media/base/video_frame_impl_unittest.cc b/media/base/video_frame_impl_unittest.cc index fe0d37c..a6a1a6a 100644 --- a/media/base/video_frame_impl_unittest.cc +++ b/media/base/video_frame_impl_unittest.cc @@ -98,9 +98,9 @@ TEST(VideoFrameImpl, Basic) { EXPECT_FALSE(frame->IsDiscontinuous()); // Test VideoFrame implementation. - media::MockVideoDecoder::InitializeYV12Frame(frame, 0.0f); + media::old_mocks::MockVideoDecoder::InitializeYV12Frame(frame, 0.0f); ExpectFrameColor(frame, 0xFF000000); - media::MockVideoDecoder::InitializeYV12Frame(frame, 1.0f); + media::old_mocks::MockVideoDecoder::InitializeYV12Frame(frame, 1.0f); ExpectFrameColor(frame, 0xFFFFFFFF); // Test an empty frame. |